|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.nih.mipav.view.components.WidgetFactory
public class WidgetFactory
This class is a collection of GUI widget generation methods. Widgets are created in a MIPAV-consistent manner and style.
Nested Class Summary | |
---|---|
static class |
WidgetFactory.ScrollTextArea
ScrollPane with an accessible JTextArea |
Field Summary | |
---|---|
static Font |
courier10
A 10 point, plain, courier font. |
static Font |
courier12
A 12 point, plain, courier font. |
static Font |
courier12B
A 12 point, bold, courier font. |
static Font |
font10
A 10 point, plain, serif font. |
static Font |
font12
A 12 point, plain, serif font. |
static Font |
font12B
A 12 point, bold, serif font. |
static Font |
font12I
A 12 point, italic, serif font. |
static Font |
font13B
A 13 point, bold, serif font. |
static Font |
font14
A 14 point, plain, serif font. |
static Font |
font14B
A 14 point, bold, serif font. |
static Font |
font16B
A 16 point, bold, serif font. |
static Font |
font18B
A 18 point, bold, serif font. |
Constructor Summary | |
---|---|
WidgetFactory()
|
Method Summary | |
---|---|
static JCheckBox |
buildCheckBox(String label,
boolean isSelected)
Builds a new check box component. |
static JCheckBox |
buildCheckBox(String label,
boolean isSelected,
ItemListener listener)
Builds a new check box component. |
static JButton |
buildIconButton(Icon icon,
String toolTip,
String action,
ActionListener listener)
Helper method to build a icon button. |
static JLabel |
buildLabel(String text)
Builds a label with the proper font and font color. |
static JPasswordField |
buildPasswordField()
Helper method to create a password field with the proper font and font color. |
static Border |
buildPressedButtonBorder()
Builds a new border of the type used when a toggle button is depressed. |
static JRadioButton |
buildRadioButton(String label,
boolean isSelected,
ButtonGroup group)
Builds a new radio button component. |
static JScrollPane |
buildScrollPane(JComponent component)
Create a new scroll pane, containing a component. |
static JScrollPane |
buildScrollPane(JComponent component,
int preferredWidth,
int preferredHeight)
Create a new scroll pane, containing a component. |
static WidgetFactory.ScrollTextArea |
buildScrollTextArea(Color bg)
|
static JTextArea |
buildTextArea(String text,
boolean isEditable)
Builds a new text area. |
static JButton |
buildTextButton(String text,
String toolTip,
String action,
ActionListener listener)
Helper method to build a text button. |
static JTextField |
buildTextField(String text)
Helper method to create a text field with the proper font and font color. |
static Border |
buildTitledBorder(String title)
Builds a titled border with the given title, an etched border, and the proper font and color. |
static Border |
buildToolbarBorder()
Builds a new border of the type used by toolbars. |
static Dimension |
getDefaultButtonSize()
Returns the default size used for most text buttons. |
static ImageIcon |
getIcon(String name)
Finds the icon of the specified name. |
static Image |
getIconImage(String name)
Finds the image of the specified name. |
static JToolBar |
initToolbar()
Create a blank toolbar and set it up. |
static JButton |
makeToolbarSeparator()
Makes a separator for the use in the toolbars - a button with the proper icon. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Font font10
public static final Font font12
public static final Font font12B
public static final Font font12I
public static final Font font13B
public static final Font font14
public static final Font font14B
public static final Font font16B
public static final Font font18B
public static final Font courier10
public static final Font courier12
public static final Font courier12B
Constructor Detail |
---|
public WidgetFactory()
Method Detail |
---|
public static final JCheckBox buildCheckBox(String label, boolean isSelected)
label
- the label to place in front of the check boxisSelected
- whether the check box should initially be selected
public static final JCheckBox buildCheckBox(String label, boolean isSelected, ItemListener listener)
label
- the label to place in front of the check boxisSelected
- whether the check box should initially be selectedlistener
- the object to notify of ItemEvents generated by this check box (on selection/deselction)
public static final JLabel buildLabel(String text)
text
- text of the label
public static final JPasswordField buildPasswordField()
public static final Border buildPressedButtonBorder()
public static final JRadioButton buildRadioButton(String label, boolean isSelected, ButtonGroup group)
label
- the label to place in front of the radio buttonisSelected
- whether the check box should initially be selectedgroup
- the button group to add the new radio button to
public static final JScrollPane buildScrollPane(JComponent component)
component
- the component to put inside the scroll pane
public static final JScrollPane buildScrollPane(JComponent component, int preferredWidth, int preferredHeight)
component
- the component to put inside the scroll panepreferredWidth
- the width of the scroll panepreferredHeight
- the height of the scroll pane
public static final JTextArea buildTextArea(String text, boolean isEditable)
text
- the text to put inside the text areaisEditable
- whether the text area should be editable by the user
public static final JButton buildTextButton(String text, String toolTip, String action, ActionListener listener)
text
- Text for button.toolTip
- Tool tip to be associated with button.action
- Action command for button.listener
- the listener for this button's actions
public static final JButton buildIconButton(Icon icon, String toolTip, String action, ActionListener listener)
icon
- icon for button.toolTip
- Tool tip to be associated with button.action
- Action command for button.listener
- the listener for this button's actions
public static final JTextField buildTextField(String text)
text
- Text int the field.
public static final Border buildTitledBorder(String title)
title
- the title of the border
public static final Border buildToolbarBorder()
public static final Dimension getDefaultButtonSize()
public static final ImageIcon getIcon(String name)
name
- name of the icon
public static final Image getIconImage(String name) throws FileNotFoundException
name
- name of the image
FileNotFoundException
- if we can't find the icon filepublic static final JToolBar initToolbar()
public static final JButton makeToolbarSeparator()
public static final WidgetFactory.ScrollTextArea buildScrollTextArea(Color bg)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |