|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jwo.utils.gui.ComponentFactory
public class ComponentFactory
Provides the facilities to create customised components with a similar look and feel.
Constructor Summary | |
---|---|
ComponentFactory(Component component)
Initialises the factory with the settings from the given component. |
Method Summary | |
---|---|
Border |
defaultBorder()
The standard border to be placed around components. |
Font |
getFont()
Reports the standard font used by factory components. |
Font |
getSmallFont()
Reports the standard font used by 'small' factory components. |
JButton |
makeButton(String text)
Creates a button with the standard font for this component. |
JCheckBox |
makeCheckBox(String text,
boolean state)
Creates a check box with the standard font for this component. |
JComboBox |
makeComboBox()
Creates a combo box with the standard font for this component. |
JComboBox |
makeComboBox(String[] entries)
Creates a combo box with the given initial list of options in the standard font for this component. |
JTextField |
makeCopyableLabel(String text)
Creates a label that can be selected and copied and uses the standard font for this component. |
JTextField |
makeCopyableSmallLabel(String text)
Creates a label that can be selected and copied and uses the standard font for this component. |
JEditorPane |
makeEditorPane()
Creates a text area capable of displaying HTML. |
HTMLRadioButton |
makeHTMLRadioButton()
Creates a blank, unselected HTML radio button ready to display any HTML code. |
HTMLRadioButton |
makeHTMLRadioButton(String text,
boolean state)
Creates an HTML radio button capable of displaying any HTML code. |
HTMLRadioButton |
makeHTMLRadioButton(String text,
boolean state,
boolean validateXHTML)
Creates an HTML radio button capable of displaying any (X)HTML code. |
HTMLRadioButton |
makeHTMLRadioButton(String text,
boolean state,
HTMLEditorKit htmlEditorKit)
Creates an HTML radio button capable of displaying any (X)HTML code. |
ImageIcon |
makeImage(String fileName)
Creates an icon image that can be displayed in a component. |
JLabel |
makeLabel(String text)
Creates a centred label with the standard font for this component. |
JLabel |
makeLabel(String text,
int alignment)
Creates a label with given alignment in the standard font for this component. |
JList |
makeList(ListModel listModel)
Creates a list box with the standard font for this component. |
JList |
makeList(Object[] listData)
Creates a list box with the standard font for this component. |
JList |
makeList(Vector listData)
Creates a list box with the standard font for this component. |
JRadioButton |
makeRadioButton(String text,
boolean state)
Creates a radio button with the standard font for this component. |
JButton |
makeSmallButton(String text)
Creates a small button with a smaller version of the standard font for this component. |
JLabel |
makeSmallLabel(String text)
Creates a smaller centred label in the standard font for this component. |
JLabel |
makeSmallLabel(String text,
int alignment)
Creates a smaller label with given alignment in the standard font for this component. |
JToggleButton |
makeSmallToggleButton(String text,
boolean state)
Creates a small toggle button with the standard font for this component. |
SmoothedTextPane |
makeSmoothTextPane(String text)
Creates a smoothed text pane with the standard font for this component. |
JTextArea |
makeTextArea(String text)
Creates a text area with the standard font for this component. |
JTextField |
makeTextField(int width)
Creates a text field with the standard font for this component. |
JTextField |
makeTextField(String text,
int width)
Creates a text field with the standard font for this component. |
JTextPane |
makeTextPane(String text)
Creates a text pane with the standard font for this component. |
JTextField |
makeTippedTextField(int width)
Creates a text field with the standard font for this component. |
JTextField |
makeTippedTextField(String text,
int width)
Creates a text field with the standard font for this component. |
JPanel |
makeTitledBorder(String text)
Creates panel with a titled border with the given text. |
JPanel |
makeTitledBorder(String text,
SGLayout layout)
Creates panel with a titled border with the given text and layout. |
JToggleButton |
makeToggleButton(String text,
boolean state)
Creates a toggle button with the standard font for this component. |
URL |
searchFile(String fileName)
Looks for a given file in the classpath of the VM that uses this class. |
void |
setInteraction(boolean interaction)
Sets the interaction mode. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ComponentFactory(Component component)
component
- Component containing settings for customised components.Method Detail |
---|
public void setInteraction(boolean interaction)
interaction
- Determines if components are interactive.public URL searchFile(String fileName)
fileName
- Name of the file to search for (should be relative path).
public JLabel makeLabel(String text)
text
- Text to display as label.
public JLabel makeLabel(String text, int alignment)
text
- Text to display as label.alignment
- Label alignment (JLabel.LEFT, JLabel.CENTER, JLabel.RIGHT).
public JLabel makeSmallLabel(String text)
text
- Text to display as label.
public JLabel makeSmallLabel(String text, int alignment)
text
- Text to display as label.alignment
- Label alignment (JLabel.LEFT, JLabel.CENTER, JLabel.RIGHT).
public JTextField makeCopyableSmallLabel(String text)
text
- Text to display as label.
public JTextField makeCopyableLabel(String text)
text
- Text to display as label.
public JTextField makeTextField(int width)
width
- Number of characters to display.
public JTextField makeTextField(String text, int width)
text
- Initial text to be displayed.width
- Number of characters to display.
public JTextField makeTippedTextField(int width)
width
- Number of characters to display.
public JTextField makeTippedTextField(String text, int width)
text
- Initial text to be displayed.width
- Number of characters to display.
public JButton makeButton(String text)
text
- Text to be displayed in button.
public JButton makeSmallButton(String text)
text
- Text to be displayed in button.
public JCheckBox makeCheckBox(String text, boolean state)
text
- Text to be displayed next to check box.state
- Initial state of check box.
public JRadioButton makeRadioButton(String text, boolean state)
text
- Text to be displayed next to radio button.state
- Initial state of radio button.
public HTMLRadioButton makeHTMLRadioButton()
public HTMLRadioButton makeHTMLRadioButton(String text, boolean state)
text
- Text to be displayed next to radio button.state
- Initial state of radio button.
public HTMLRadioButton makeHTMLRadioButton(String text, boolean state, boolean validateXHTML)
text
- Text to be displayed next to radio button.state
- Initial state of radio button.validateXHTML
- Will validate for well formed XHTML if true.
public HTMLRadioButton makeHTMLRadioButton(String text, boolean state, HTMLEditorKit htmlEditorKit)
text
- Text to be displayed next to radio button.state
- Initial state of radio button.htmlEditorKit
- HTMLEditorKit to use.
public JToggleButton makeToggleButton(String text, boolean state)
text
- Text to be displayed in toggle button.state
- Initial state of toggle button.
public JToggleButton makeSmallToggleButton(String text, boolean state)
text
- Text to be displayed in toggle button.state
- Initial state of toggle button.
public JComboBox makeComboBox()
public JComboBox makeComboBox(String[] entries)
entries
- Initial list of entries to appear in combo box.
public JList makeList(Object[] listData)
listData
- Array of objects to be initially displayed in list box. The
objects should either be strings, have a toString()
method
or be icons. If they are not, the list will have to implement a custom
display.
public JList makeList(Vector listData)
listData
- Vector of objects to be initially displayed in list box. The
objects should either be strings, have a toString()
method
or be icons. If they are not, the list will have to implement a custom
display.
public JList makeList(ListModel listModel)
listModel
- ListModel containing objects to be initially displayed in list box.
The objects should either be strings, have a toString()
method or be icons. If they are not, the list will have to implement a
custom display.
public JTextArea makeTextArea(String text)
text
- Initial text to be displayed.
public JTextPane makeTextPane(String text)
text
- Initial text to be displayed.
public SmoothedTextPane makeSmoothTextPane(String text)
text
- Initial text to be displayed.
public JEditorPane makeEditorPane()
public JPanel makeTitledBorder(String text)
text
- Text to display in title.
public JPanel makeTitledBorder(String text, SGLayout layout)
text
- Text to display in title.layout
- Scaled grid layout used to arrange content.
public ImageIcon makeImage(String fileName)
fileName
- Name of image to search for.
public Border defaultBorder()
public Font getFont()
public Font getSmallFont()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |