Großmarkt

market.swing
Class ComponentFactory

java.lang.Object
  |
  +--market.swing.ComponentFactory

public class ComponentFactory
extends Object

Factory class for borders, JTextFields und JTFCheckables.


Field Summary
static int CENTER
           
static int LEFT
           
static int RIGHT
           
 
Constructor Summary
ComponentFactory()
           
 
Method Summary
static Border createInsetBorder()
          Creates a line border out that leaves some space around the object to which the border is set.
static Border createInsetBorder(Border border, int top, int left, int bottom, int right)
          Creates a compound border out that leaves some space around the object to which the border is set.
static Border createInsetBorder(String label)
          Creates a title border out that leaves some space around the object to which the border is set.
static JTextField createTextField(double value, int size, boolean editable, int alignment, boolean border)
          Creates a JTextField.
static JTextField createTextField(String text, int size, boolean editable, int alignment, boolean border)
          Creates a JTextField.
static JTextField createTextField(String text, int size, boolean editable, int alignment, Color color, boolean border)
          Creates a JTextField.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT

public static final int LEFT
See Also:
Constant Field Values

CENTER

public static final int CENTER
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values
Constructor Detail

ComponentFactory

public ComponentFactory()
Method Detail

createInsetBorder

public static Border createInsetBorder()
Creates a line border out that leaves some space around the object to which the border is set. This is achieved with the help of an empty border between the object and the line border.

Returns:
the border.

createInsetBorder

public static Border createInsetBorder(String label)
Creates a title border out that leaves some space around the object to which the border is set. This is achieved with the help of an empty border between the object and the title border.

Parameters:
label - the caption of the title border.
Returns:
the border.

createInsetBorder

public static Border createInsetBorder(Border border,
                                       int top,
                                       int left,
                                       int bottom,
                                       int right)
Creates a compound border out that leaves some space around the object to which the border is set. This is achieved with the help of an empty border between the object and the title border.

Parameters:
border - the outer border.
top - the top inset.
left - the left inset.
bottom - the bottom inset.
right - the right inset.
Returns:
the border.

createTextField

public static JTextField createTextField(String text,
                                         int size,
                                         boolean editable,
                                         int alignment,
                                         boolean border)
Creates a JTextField.

Parameters:
text - the text to be set.
size - the text field's size
editable - defines if text field is editable or not
alignment - the text's alignment in the text field (left, center, right)
border - defines if the text field should have a border.
Returns:
the created JTextField.

createTextField

public static JTextField createTextField(double value,
                                         int size,
                                         boolean editable,
                                         int alignment,
                                         boolean border)
Creates a JTextField.

Parameters:
value - the number to be set as text.
size - the text field's size
editable - defines if text field is editable or not
alignment - the text's alignment in the text field (left, center, right)
border - defines if the text field should have a border.
Returns:
the created JTextField.

createTextField

public static JTextField createTextField(String text,
                                         int size,
                                         boolean editable,
                                         int alignment,
                                         Color color,
                                         boolean border)
Creates a JTextField.

Parameters:
text - the text to be set.
size - the text field's size
editable - defines if text field is editable or not
alignment - the text's alignment in the text field (left, center, right)
color - the color of the text field's text.
border - defines if the text field should have a border.
Returns:
the created JTextField.

Großmarkt