Package docking.options.editor
Class ButtonPanelFactory
- java.lang.Object
-
- docking.options.editor.ButtonPanelFactory
-
public class ButtonPanelFactory extends java.lang.ObjectClass 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
Fields Modifier and Type Field Description static intARROW_DOWN_TYPEButton that has a down arrow.static intARROW_LEFT_TYPEButton that has a left arrow.static intARROW_RIGHT_TYPEButton that has a right arrow.static java.awt.DimensionARROW_SIZEDimension for the arrow button.static intARROW_UP_TYPEButton that has an up arrow.static java.awt.FontBROWSE_FONTFont for the browse button label.static javax.swing.IconBROWSE_ICONText for the browse button.static java.awt.DimensionBROWSE_SIZEDimension for the browse button.static intBROWSE_TYPEButton that indicates a file chooser to browse.static intCANCEL_TYPEButton for cancel.static intEDIT_TYPEButton that indicates an edit operation.static intOK_TYPEButton for OK.static charX_AXISlayout the buttons on the panel created with createButtonPanel() horizontally along the X-axisstatic charY_AXISlayout the buttons on the panel created with createButtonPanel() vertically along the Y-axis
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.swing.JButtoncreateButton(int buttonType)Create a button with specified type.static javax.swing.JButtoncreateButton(java.lang.String text)Create a button with the given text.static javax.swing.JPanelcreateButtonPanel(javax.swing.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 javax.swing.JPanelcreateButtonPanel(javax.swing.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 javax.swing.JPanelcreateButtonPanel(javax.swing.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 javax.swing.JPanelcreateButtonPanel(javax.swing.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 javax.swing.JButtoncreateImageButton(java.lang.String imageFile, java.lang.String alternateText, java.awt.Dimension preferredSize)Create an button that has an icon created from the given imageFile.static javax.swing.JButtoncreateImageButton(javax.swing.ImageIcon buttonIcon, java.lang.String alternateText, java.awt.Dimension preferredSize)Create a button with the given icon.
-
-
-
Field Detail
-
X_AXIS
public static final char X_AXIS
layout the buttons on the panel created with createButtonPanel() horizontally along the X-axis- See Also:
- Constant Field Values
-
Y_AXIS
public static final char Y_AXIS
layout the buttons on the panel created with createButtonPanel() vertically along the Y-axis- See Also:
- Constant Field Values
-
ARROW_UP_TYPE
public static final int ARROW_UP_TYPE
Button that has an up arrow.- See Also:
- Constant Field Values
-
ARROW_DOWN_TYPE
public static final int ARROW_DOWN_TYPE
Button that has a down arrow.- See Also:
- Constant Field Values
-
BROWSE_TYPE
public static final int BROWSE_TYPE
Button that indicates a file chooser to browse.- See Also:
- Constant Field Values
-
CANCEL_TYPE
public static final int CANCEL_TYPE
Button for cancel.- See Also:
- Constant Field Values
-
EDIT_TYPE
public static final int EDIT_TYPE
Button that indicates an edit operation.- See Also:
- Constant Field Values
-
OK_TYPE
public static final int OK_TYPE
Button for OK.- See Also:
- Constant Field Values
-
ARROW_LEFT_TYPE
public static final int ARROW_LEFT_TYPE
Button that has a left arrow.- See Also:
- Constant Field Values
-
ARROW_RIGHT_TYPE
public static final int ARROW_RIGHT_TYPE
Button that has a right arrow.- See Also:
- Constant Field Values
-
ARROW_SIZE
public static final java.awt.Dimension ARROW_SIZE
Dimension for the arrow button.
-
BROWSE_SIZE
public static final java.awt.Dimension BROWSE_SIZE
Dimension for the browse button.
-
BROWSE_ICON
public static final javax.swing.Icon BROWSE_ICON
Text for the browse button.
-
BROWSE_FONT
public static final java.awt.Font BROWSE_FONT
Font for the browse button label.
-
-
Method Detail
-
createButton
public static javax.swing.JButton createButton(int buttonType)
Create a button with specified type.- Parameters:
buttonType- the type of button to create.
-
createButton
public static javax.swing.JButton createButton(java.lang.String text)
Create a button with the given text.- Parameters:
text- the text to use in the button.
-
createButtonPanel
public static javax.swing.JPanel createButtonPanel(javax.swing.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.- Parameters:
buttons- the array of buttons to put in the panel.
-
createButtonPanel
public static javax.swing.JPanel createButtonPanel(javax.swing.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.- Parameters:
buttons- the array buttons to put in the panel.alignment- either X_AXIS or Y_AXIS
-
createButtonPanel
public static javax.swing.JPanel createButtonPanel(javax.swing.JButton[] buttons, int sideMargin)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
public static javax.swing.JPanel createButtonPanel(javax.swing.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.- Parameters:
buttons- the array buttons to put in the panel.alignment- either X_AXIS or Y_AXIS
-
createImageButton
public static javax.swing.JButton createImageButton(java.lang.String imageFile, java.lang.String alternateText, java.awt.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 javax.swing.JButton createImageButton(javax.swing.ImageIcon buttonIcon, java.lang.String alternateText, java.awt.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
-
-