Package docking.options.editor
Class ButtonPanelFactory
java.lang.Object
docking.options.editor.ButtonPanelFactory
Class with static methods to create a JButton with a raised bevel border,
and to create a JPanel with buttons created by calling the
createButton() method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intButton that has a down arrow.static final intButton that has a left arrow.static final intButton that has a right arrow.static final DimensionDimension for the arrow button.static final intButton that has an up arrow.static final FontFont for the browse button label.static final IconText for the browse button.static final DimensionDimension for the browse button.static final intButton that indicates a file chooser to browse.static final intButton for cancel.static final intButton that indicates an edit operation.static final intButton for OK.static final charlayout the buttons on the panel created with createButtonPanel() horizontally along the X-axisstatic final charlayout the buttons on the panel created with createButtonPanel() vertically along the Y-axis -
Method Summary
Modifier and TypeMethodDescriptionstatic JButtoncreateButton(int buttonType) Create a button with specified type.static JButtoncreateButton(String text) Create a button with the given text.static JPanelcreateButtonPanel(JButton[] buttons) Create the panel for the buttons; the button are aligned vertically; the side margins on the panel has a default value of 20.static JPanelcreateButtonPanel(JButton[] buttons, char alignment) Create the panel for the buttons; the button are aligned as specified; the side margins on the panel has a default value of 20.static JPanelcreateButtonPanel(JButton[] buttons, int sideMargin) Create the panel for the buttons; the button are aligned vertically; use sideMargin value for side margins on the panel.static JPanelcreateButtonPanel(JButton[] buttons, int sideMargin, char alignment) Create the panel for the buttons; the button are aligned as specified; use sideMargin value for side margins on the panel, and use either X_AXIS or Y_AXIS as the alignment specification.static JButtoncreateImageButton(String imageFile, String alternateText, Dimension preferredSize) Create an button that has an icon created from the given imageFile.static JButtoncreateImageButton(ImageIcon buttonIcon, String alternateText, Dimension preferredSize) Create a button with the given icon.
-
Field Details
-
X_AXIS
public static final char X_AXISlayout the buttons on the panel created with createButtonPanel() horizontally along the X-axis- See Also:
-
Y_AXIS
public static final char Y_AXISlayout the buttons on the panel created with createButtonPanel() vertically along the Y-axis- See Also:
-
ARROW_UP_TYPE
public static final int ARROW_UP_TYPEButton that has an up arrow.- See Also:
-
ARROW_DOWN_TYPE
public static final int ARROW_DOWN_TYPEButton that has a down arrow.- See Also:
-
BROWSE_TYPE
public static final int BROWSE_TYPEButton that indicates a file chooser to browse.- See Also:
-
CANCEL_TYPE
public static final int CANCEL_TYPEButton for cancel.- See Also:
-
EDIT_TYPE
public static final int EDIT_TYPEButton that indicates an edit operation.- See Also:
-
OK_TYPE
public static final int OK_TYPEButton for OK.- See Also:
-
ARROW_LEFT_TYPE
public static final int ARROW_LEFT_TYPEButton that has a left arrow.- See Also:
-
ARROW_RIGHT_TYPE
public static final int ARROW_RIGHT_TYPEButton that has a right arrow.- See Also:
-
ARROW_SIZE
Dimension for the arrow button. -
BROWSE_SIZE
Dimension for the browse button. -
BROWSE_ICON
Text for the browse button. -
BROWSE_FONT
Font for the browse button label.
-
-
Method Details
-
createButton
Create a button with specified type.- Parameters:
buttonType- the type of button to create.
-
createButton
Create a button with the given text.- Parameters:
text- the text to use in the button.
-
createButtonPanel
Create the panel for the buttons; the button are aligned vertically; the side margins on the panel has a default value of 20.- Parameters:
buttons- the array of buttons to put in the panel.
-
createButtonPanel
Create the panel for the buttons; the button are aligned as specified; the side margins on the panel has a default value of 20.- Parameters:
buttons- the array buttons to put in the panel.alignment- either X_AXIS or Y_AXIS
-
createButtonPanel
Create the panel for the buttons; the button are aligned vertically; use sideMargin value for side margins on the panel.- Parameters:
buttons- the array buttons to put in the panel.sideMargin- the amount of margin space to use on the sides.
-
createButtonPanel
Create the panel for the buttons; the button are aligned as specified; use sideMargin value for side margins on the panel, and use either X_AXIS or Y_AXIS as the alignment specification.- Parameters:
buttons- the array buttons to put in the panel.alignment- either X_AXIS or Y_AXIS
-
createImageButton
public static JButton createImageButton(String imageFile, String alternateText, Dimension preferredSize) Create an button that has an icon created from the given imageFile.- Parameters:
imageFile- icon filenamealternateText- text to use if the icon could not be loadedpreferredSize- size that the button would like to be- Returns:
- JButton new button
-
createImageButton
public static JButton createImageButton(ImageIcon buttonIcon, String alternateText, Dimension preferredSize) Create a button with the given icon.- Parameters:
buttonIcon- icon for the buttonalternateText- text to use if the icon could not be loadedpreferredSize- size that the button would like to be- Returns:
- JButton new button
-