Class RJColorPickerButton

All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, SwingConstants

public class RJColorPickerButton extends JButton
This class is a label subclass with a popup menu attached to implement popup menus.
See Also:
  • Constructor Details

    • RJColorPickerButton

      public RJColorPickerButton()
      Creates a new menu button.
  • Method Details

    • getColor

      public Color getColor()
      Returns the color picker button's color.
    • setColor

      public void setColor(Color aColor)
      Sets the color picker button's color.
    • getTitle

      public String getTitle()
      Returns the title shown at top of popup menu.
    • setTitle

      public void setTitle(String aValue)
      Sets the title shown at top of the popup menu.
    • getSaveColor

      public boolean getSaveColor()
      Returns whether to save color to preferences.
    • setSaveColor

      public void setSaveColor(boolean doSave)
      Sets wether to save color to preferences.
    • processMouseEvent

      protected void processMouseEvent(MouseEvent anEvent)
      Override button version to trigger popup menu if on right border.
      Overrides:
      processMouseEvent in class JComponent
    • getPopupMenu

      public JPopupMenu getPopupMenu()
      Returns the menu button's popup menu.
    • setIcon

      public void setIcon(Icon anIcon)
      Overridden to take a base icon and set derived version with popup arrow. Also derives other icon versions.
      Overrides:
      setIcon in class AbstractButton
    • getRealIcon

      public Icon getRealIcon()
      Returns the real icon.
    • setFont

      public void setFont(Font aFont)
      Sets the font for the menu button.
      Overrides:
      setFont in class JComponent
    • getColorButtons

      public JPanel getColorButtons()
      Returns a panel with color buttons in it.
    • getDownArrowIcon

      public Icon getDownArrowIcon()
      Returns an Icon of a down arrow.