Class ButtonPanelFactory

java.lang.Object
docking.options.editor.ButtonPanelFactory

public class ButtonPanelFactory extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Button that has a down arrow.
    static final int
    Button that has a left arrow.
    static final int
    Button that has a right arrow.
    static final Dimension
    Dimension for the arrow button.
    static final int
    Button that has an up arrow.
    static final Font
    Font for the browse button label.
    static final Icon
    Text for the browse button.
    static final Dimension
    Dimension for the browse button.
    static final int
    Button that indicates a file chooser to browse.
    static final int
    Button for cancel.
    static final int
    Button that indicates an edit operation.
    static final int
    Button for OK.
    static final char
    layout the buttons on the panel created with createButtonPanel() horizontally along the X-axis
    static final char
    layout the buttons on the panel created with createButtonPanel() vertically along the Y-axis
  • Method Summary

    Modifier and Type
    Method
    Description
    static JButton
    createButton(int buttonType)
    Create a button with specified type.
    static JButton
    Create a button with the given text.
    static JPanel
    Create the panel for the buttons; the button are aligned vertically; the side margins on the panel has a default value of 20.
    static JPanel
    createButtonPanel(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 JPanel
    createButtonPanel(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 JPanel
    createButtonPanel(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 JButton
    createImageButton(String imageFile, String alternateText, Dimension preferredSize)
    Create an button that has an icon created from the given imageFile.
    static JButton
    createImageButton(ImageIcon buttonIcon, String alternateText, Dimension preferredSize)
    Create a button with the given icon.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • X_AXIS

      public static final char X_AXIS
      layout the buttons on the panel created with createButtonPanel() horizontally along the X-axis
      See Also:
    • Y_AXIS

      public static final char Y_AXIS
      layout the buttons on the panel created with createButtonPanel() vertically along the Y-axis
      See Also:
    • ARROW_UP_TYPE

      public static final int ARROW_UP_TYPE
      Button that has an up arrow.
      See Also:
    • ARROW_DOWN_TYPE

      public static final int ARROW_DOWN_TYPE
      Button that has a down arrow.
      See Also:
    • BROWSE_TYPE

      public static final int BROWSE_TYPE
      Button that indicates a file chooser to browse.
      See Also:
    • CANCEL_TYPE

      public static final int CANCEL_TYPE
      Button for cancel.
      See Also:
    • EDIT_TYPE

      public static final int EDIT_TYPE
      Button that indicates an edit operation.
      See Also:
    • OK_TYPE

      public static final int OK_TYPE
      Button for OK.
      See Also:
    • ARROW_LEFT_TYPE

      public static final int ARROW_LEFT_TYPE
      Button that has a left arrow.
      See Also:
    • ARROW_RIGHT_TYPE

      public static final int ARROW_RIGHT_TYPE
      Button that has a right arrow.
      See Also:
    • ARROW_SIZE

      public static final Dimension ARROW_SIZE
      Dimension for the arrow button.
    • BROWSE_SIZE

      public static final Dimension BROWSE_SIZE
      Dimension for the browse button.
    • BROWSE_ICON

      public static final Icon BROWSE_ICON
      Text for the browse button.
    • BROWSE_FONT

      public static final Font BROWSE_FONT
      Font for the browse button label.
  • Method Details

    • createButton

      public static JButton createButton(int buttonType)
      Create a button with specified type.
      Parameters:
      buttonType - the type of button to create.
    • createButton

      public static JButton createButton(String text)
      Create a button with the given text.
      Parameters:
      text - the text to use in the button.
    • createButtonPanel

      public static JPanel createButtonPanel(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 JPanel createButtonPanel(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 JPanel createButtonPanel(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 JPanel createButtonPanel(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 JButton createImageButton(String imageFile, String alternateText, Dimension preferredSize)
      Create an button that has an icon created from the given imageFile.
      Parameters:
      imageFile - icon filename
      alternateText - text to use if the icon could not be loaded
      preferredSize - 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 button
      alternateText - text to use if the icon could not be loaded
      preferredSize - size that the button would like to be
      Returns:
      JButton new button