|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgcspy.vis.utils.Factory
public class Factory
Factory for GUI components
Constructor Summary | |
---|---|
Factory()
|
Method Summary | |
---|---|
static javax.swing.JPanel |
createBorderPanel()
Create a new panel with a border layout |
static javax.swing.JButton |
createButton(java.lang.String text)
Create a JButton |
static javax.swing.JButton |
createButton(java.lang.String text,
java.awt.event.ActionListener al)
Create a JButton |
static javax.swing.JButton |
createButton(java.lang.String text,
boolean enabled)
Create a JButton |
static javax.swing.JButton |
createButton(java.lang.String text,
boolean enabled,
java.awt.event.ActionListener al)
Create a JButton |
static javax.swing.JButton |
createButton(java.lang.String text,
boolean enabled,
boolean small,
java.awt.event.ActionListener al)
Create a JButton |
static javax.swing.JButton |
createButton(java.lang.String text,
boolean enabled,
boolean small,
java.lang.String toolTipText,
java.awt.event.ActionListener al)
Create a JButton |
static javax.swing.JButton |
createButton(java.lang.String text,
boolean enabled,
java.lang.String toolTipText,
java.awt.event.ActionListener al)
Create a JButton |
static javax.swing.JCheckBox |
createCheckBox()
Create a new labelled JCheckBox |
static javax.swing.JCheckBox |
createCheckBox(boolean selected)
Create a new labelled JCheckBox |
static javax.swing.JCheckBox |
createCheckBox(java.lang.String text)
Create a new labelled JCheckBox |
static javax.swing.JCheckBox |
createCheckBox(java.lang.String text,
boolean selected)
Create a new labelled JCheckBox |
static javax.swing.JCheckBox |
createCheckBox(java.lang.String text,
boolean selected,
java.awt.event.ActionListener al)
Create a new labelled JCheckBox |
static javax.swing.JCheckBox |
createCheckBox(java.lang.String text,
boolean enabled,
boolean selected,
java.awt.event.ActionListener al)
Create a new labelled JCheckBox |
static javax.swing.JCheckBoxMenuItem |
createCheckBoxMenuItem(java.lang.String text)
Create a new JCheckBoxMenuItem |
static javax.swing.JCheckBoxMenuItem |
createCheckBoxMenuItem(java.lang.String text,
boolean state)
Create a new JCheckBoxMenuItem |
static javax.swing.JCheckBoxMenuItem |
createCheckBoxMenuItem(java.lang.String text,
boolean state,
java.awt.event.ActionListener al)
Create a new JCheckBoxMenuItem |
static javax.swing.JComboBox |
createComboBox()
Create a new combo box |
static javax.swing.JComboBox |
createComboBox(java.awt.event.ActionListener al)
Create a new combo box |
static javax.swing.JPanel |
createEmptyPanel(int border)
Create an empty panel with a border |
static javax.swing.JPanel |
createEmptyPanel(int border,
java.awt.Component comp)
Place a component in a new panel with a border |
static javax.swing.JPanel |
createEmptyPanel(int width,
int height)
Create an empty panel |
static javax.swing.JPanel |
createFlowPanel(int align)
Create a new panel with a flow layout |
static javax.swing.JPanel |
createGridPanel(int rows,
int columns)
Create a new panel with a title, using grid layout |
static javax.swing.JPanel |
createGridPanel(int rows,
int columns,
java.lang.String title)
Create a new panel with a title, using grid layout |
static javax.swing.JButton |
createIconButton(javax.swing.Icon icon)
Create a JButton with an icon |
static javax.swing.JButton |
createIconButton(javax.swing.Icon icon,
boolean enable,
java.awt.event.ActionListener al)
Create a JButton with an icon |
static javax.swing.JButton |
createIconButton(javax.swing.Icon icon,
boolean enable,
java.lang.String toolTipText,
java.awt.event.ActionListener al)
Create a JButton with an icon |
static javax.swing.JLabel |
createLabel(java.lang.String text)
Create a JLabel |
static javax.swing.JLabel |
createLabel(java.lang.String text,
boolean enabled)
Create a JLabel |
static javax.swing.JLabel |
createLabel(java.lang.String text,
int alignment)
Create a JLabel |
static javax.swing.JLabel |
createLabel(java.lang.String text,
int alignment,
boolean bold)
Create a JLabel |
static javax.swing.JMenu |
createMenu(java.lang.String title)
Create a new JMenu |
static javax.swing.JMenuItem |
createMenuItem(java.lang.String text)
Create a new JMenuItem |
static javax.swing.JMenuItem |
createMenuItem(java.lang.String text,
java.awt.event.ActionListener al)
Create a new JMenuItem |
static javax.swing.JMenuItem |
createMenuItem(java.lang.String text,
boolean enable,
java.awt.event.ActionListener al)
Create a new JMenuItem |
static javax.swing.border.TitledBorder |
createPlainBorder()
Create a new plain border |
static javax.swing.JTable |
createTable(javax.swing.table.TableModel model)
Create a new table |
static javax.swing.JTable |
createTable(javax.swing.table.TableModel model,
boolean resizable,
boolean auto)
Create a new table |
static javax.swing.JTextArea |
createTextArea(int rows,
int columns,
boolean editable)
Text Areas **** |
static javax.swing.JTextArea |
createTextArea(int rows,
int columns,
boolean editable,
boolean monospaced)
Create a new text area |
static javax.swing.JTextField |
createTextField(int columns,
boolean editable)
Create a new text field |
static javax.swing.JTextField |
createTextField(java.lang.String text,
int columns,
boolean editable)
Create a new text field |
static javax.swing.border.TitledBorder |
createTitledBorder(java.lang.String title)
Create a new titled border |
static javax.swing.JPanel |
createTitlePanel(java.lang.String title)
Create a new panel with a title |
static javax.swing.JPanel |
createTitlePanel(java.lang.String title,
java.awt.Component comp)
Place a component in a panel with a title |
static void |
deselectCheckBox(javax.swing.JCheckBox checkBox)
Make a check box unselected |
static void |
disableButton(javax.swing.JButton button)
Disable a JButton |
static void |
disableCheckBox(javax.swing.JCheckBox checkBox)
Disable a check box |
static void |
disableComboBox(javax.swing.JComboBox comboBox)
Disable a combo box |
static void |
disableLabel(javax.swing.JLabel label)
Disable a JLabel |
static void |
disableMenuItem(javax.swing.JMenuItem menuItem)
Disable a JMenuItem |
static void |
disableTextArea(javax.swing.JTextArea area)
Disable a text area |
static void |
disableTextField(javax.swing.JTextField textField)
Disable a text field |
static void |
enableButton(javax.swing.JButton button)
Enable a JButton |
static void |
enableCheckBox(javax.swing.JCheckBox checkBox)
Enable a check box |
static void |
enableComboBox(javax.swing.JComboBox comboBox)
Enable a combo box |
static void |
enableLabel(javax.swing.JLabel label)
Enable a JLabel |
static void |
enableMenuItem(javax.swing.JMenuItem menuItem)
Enable a JMenuItem |
static void |
enableTextArea(javax.swing.JTextArea area)
Enable a text area |
static void |
enableTextField(javax.swing.JTextField textField)
Enable a text field |
static void |
selectCheckBox(javax.swing.JCheckBox checkBox)
Make a check box selected |
static void |
setColumnWidth(javax.swing.JTable table,
int col,
int width)
Set the width of a column of a table |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Factory()
Method Detail |
---|
public static javax.swing.JButton createButton(java.lang.String text)
text
- The label to use
public static javax.swing.JButton createButton(java.lang.String text, java.awt.event.ActionListener al)
text
- The label to useal
- An ActionListener for the button
public static javax.swing.JButton createButton(java.lang.String text, boolean enabled)
text
- The label to useenabled
- Is the button enabled?
public static javax.swing.JButton createButton(java.lang.String text, boolean enabled, java.awt.event.ActionListener al)
text
- The label to useenabled
- Is the button enabled?al
- An ActionListener for the button
public static javax.swing.JButton createButton(java.lang.String text, boolean enabled, boolean small, java.awt.event.ActionListener al)
text
- The label to useenabled
- Is the button enabled?small
- Is the button's font size small?al
- An ActionListener for the button
public static javax.swing.JButton createButton(java.lang.String text, boolean enabled, java.lang.String toolTipText, java.awt.event.ActionListener al)
text
- The label to useenabled
- Is the button enabled?toolTipText
- tool-tip text for the buttonal
- An ActionListener for the button
public static javax.swing.JButton createButton(java.lang.String text, boolean enabled, boolean small, java.lang.String toolTipText, java.awt.event.ActionListener al)
text
- The label to useenabled
- Is the button enabled?small
- Is the button's font size small?toolTipText
- tool-tip text for the buttonal
- An ActionListener for the button
public static void enableButton(javax.swing.JButton button)
button
- the buttonpublic static void disableButton(javax.swing.JButton button)
button
- the buttonpublic static javax.swing.JButton createIconButton(javax.swing.Icon icon)
icon
- The icon
public static javax.swing.JButton createIconButton(javax.swing.Icon icon, boolean enable, java.awt.event.ActionListener al)
icon
- The iconenable
- Is the button enabled?al
- ActionListener for the button
public static javax.swing.JButton createIconButton(javax.swing.Icon icon, boolean enable, java.lang.String toolTipText, java.awt.event.ActionListener al)
icon
- The iconenable
- Is the button enabled?toolTipText
- Tool-tip text for the buttonal
- ActionListener for the button
public static javax.swing.JCheckBoxMenuItem createCheckBoxMenuItem(java.lang.String text)
text
- The text for the menu item
public static javax.swing.JCheckBoxMenuItem createCheckBoxMenuItem(java.lang.String text, boolean state)
text
- The text for the menu itemstate
- The state of the check-box
public static javax.swing.JCheckBoxMenuItem createCheckBoxMenuItem(java.lang.String text, boolean state, java.awt.event.ActionListener al)
text
- The text for the menu itemstate
- The state of the check-boxal
- An ActionListener for the item
public static javax.swing.JCheckBox createCheckBox()
public static javax.swing.JCheckBox createCheckBox(boolean selected)
selected
- Is the box selected?
public static javax.swing.JCheckBox createCheckBox(java.lang.String text)
text
- The text to label the check-box
public static javax.swing.JCheckBox createCheckBox(java.lang.String text, boolean selected)
text
- The text to label the check-boxselected
- Is the box selected?
public static javax.swing.JCheckBox createCheckBox(java.lang.String text, boolean selected, java.awt.event.ActionListener al)
text
- The text to label the check-boxselected
- Is the box selected?al
- An ActionListener for the check-box
public static javax.swing.JCheckBox createCheckBox(java.lang.String text, boolean enabled, boolean selected, java.awt.event.ActionListener al)
text
- The text to label the check-boxenabled
- Is the check-box enabled?selected
- Is the box selected?al
- An ActionListener for the check-box
public static void selectCheckBox(javax.swing.JCheckBox checkBox)
checkBox
- The check boxpublic static void deselectCheckBox(javax.swing.JCheckBox checkBox)
checkBox
- The check boxpublic static void enableCheckBox(javax.swing.JCheckBox checkBox)
checkBox
- The check boxpublic static void disableCheckBox(javax.swing.JCheckBox checkBox)
checkBox
- The check boxpublic static javax.swing.JComboBox createComboBox()
public static javax.swing.JComboBox createComboBox(java.awt.event.ActionListener al)
al
- An ActionListener
public static void enableComboBox(javax.swing.JComboBox comboBox)
comboBox
- the combo boxpublic static void disableComboBox(javax.swing.JComboBox comboBox)
comboBox
- the combo boxpublic static javax.swing.JLabel createLabel(java.lang.String text, int alignment)
text
- Text for the labelalignment
- Horizontal alignment
public static javax.swing.JLabel createLabel(java.lang.String text, int alignment, boolean bold)
text
- Text for the labelalignment
- Horizontal alignmentbold
- Should the font be bold?
public static javax.swing.JLabel createLabel(java.lang.String text)
text
- Text for the label
public static javax.swing.JLabel createLabel(java.lang.String text, boolean enabled)
text
- Text for the labelenabled
- True if the label is enabled
public static void enableLabel(javax.swing.JLabel label)
label
- the JLabelpublic static void disableLabel(javax.swing.JLabel label)
label
- the JLabelpublic static javax.swing.JMenu createMenu(java.lang.String title)
title
- The text for the menu
public static javax.swing.JMenuItem createMenuItem(java.lang.String text)
text
- The text for the menu item
public static javax.swing.JMenuItem createMenuItem(java.lang.String text, java.awt.event.ActionListener al)
text
- The text for the menu itemal
- An ActionListener for the item
public static javax.swing.JMenuItem createMenuItem(java.lang.String text, boolean enable, java.awt.event.ActionListener al)
text
- The text for the menu itemenable
- Is the item enabled?al
- An ActionListener for the item
public static void enableMenuItem(javax.swing.JMenuItem menuItem)
menuItem
- the JMenuItempublic static void disableMenuItem(javax.swing.JMenuItem menuItem)
menuItem
- the JMenuItempublic static javax.swing.JPanel createEmptyPanel(int width, int height)
width
- The width of the panelheight
- The height of the panel
[Why not use a box Box? ]public static javax.swing.JPanel createEmptyPanel(int border)
border
- the width of the border
public static javax.swing.JPanel createEmptyPanel(int border, java.awt.Component comp)
border
- the width of the bordercomp
- the component
public static javax.swing.JPanel createTitlePanel(java.lang.String title)
title
- the title
public static javax.swing.JPanel createTitlePanel(java.lang.String title, java.awt.Component comp)
title
- The titlecomp
- The component
public static javax.swing.JPanel createBorderPanel()
public static javax.swing.JPanel createFlowPanel(int align)
align
- The alignment
public static javax.swing.JPanel createGridPanel(int rows, int columns)
rows
- The number of rowscolumns
- The number of columns
public static javax.swing.JPanel createGridPanel(int rows, int columns, java.lang.String title)
rows
- The number of rowscolumns
- The number of columnstitle
- the title of the panel
public static javax.swing.JTable createTable(javax.swing.table.TableModel model)
model
- The table's model
public static javax.swing.JTable createTable(javax.swing.table.TableModel model, boolean resizable, boolean auto)
model
- The table's modelresizable
- Treu if the user can resize/reorder columns?auto
- True if columns are automatically created from the model
public static void setColumnWidth(javax.swing.JTable table, int col, int width)
table
- The tablecol
- The column numberwidth
- The new widthpublic static javax.swing.JTextArea createTextArea(int rows, int columns, boolean editable)
public static javax.swing.JTextArea createTextArea(int rows, int columns, boolean editable, boolean monospaced)
rows
- The number of rowscolumns
- The number of columnseditable
- True if the text area is editablemonospaced
- True if the font is monospaced
public static void enableTextArea(javax.swing.JTextArea area)
area
- The test areapublic static void disableTextArea(javax.swing.JTextArea area)
area
- The test areapublic static javax.swing.JTextField createTextField(int columns, boolean editable)
columns
- The columns in the fieldeditable
- True if the field is editable
public static javax.swing.JTextField createTextField(java.lang.String text, int columns, boolean editable)
text
- The text to place in the fieldcolumns
- The columns in the fieldeditable
- True if the field is editable
public static void enableTextField(javax.swing.JTextField textField)
textField
- The test fieldpublic static void disableTextField(javax.swing.JTextField textField)
textField
- The test fieldpublic static javax.swing.border.TitledBorder createPlainBorder()
public static javax.swing.border.TitledBorder createTitledBorder(java.lang.String title)
title
- The title to use
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |