Class DefaultHSBChooserPanel

All Implemented Interfaces:
HierarchyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener

public class DefaultHSBChooserPanel extends AbstractColorChooserPanel implements ChangeListener, HierarchyListener
Implements the default HSB Color chooser
See Also:
  • Constructor Details

    • DefaultHSBChooserPanel

      public DefaultHSBChooserPanel()
  • Method Details

    • updateChooser

      public void updateChooser()
      Invoked automatically when the model's state changes. It is also called by installChooserPanel to allow you to set up the initial state of your chooser. Override this method to update your ChooserPanel.
      Specified by:
      updateChooser in class AbstractColorChooserPanel
    • installChooserPanel

      public void installChooserPanel(JColorChooser enclosingChooser)
      Overrides:
      installChooserPanel in class AbstractColorChooserPanel
    • uninstallChooserPanel

      public void uninstallChooserPanel(JColorChooser enclosingChooser)
      Invoked when the panel is removed from the chooser.
      Overrides:
      uninstallChooserPanel in class AbstractColorChooserPanel
    • buildChooser

      protected void buildChooser()
      Builds a new chooser panel.
      Specified by:
      buildChooser in class AbstractColorChooserPanel
    • buildSliderPalettePanel

      protected JComponent buildSliderPalettePanel()
    • createPaletteLabel

      protected JLabel createPaletteLabel()
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in class AbstractColorChooserPanel
    • getMnemonic

      public int getMnemonic()
      Provides a hint to the look and feel as to the KeyEvent.VK constant that can be used as a mnemonic to access the panel. A return value <= 0 indicates there is no mnemonic.

      The return value here is a hint, it is ultimately up to the look and feel to honor the return value in some meaningful way.

      This implementation looks up the value from the default ColorChooser.hsbMnemonic, or if it isn't available (or not an Integer) returns -1. The lookup for the default is done through the UIManager: UIManager.get("ColorChooser.rgbMnemonic");.

      Overrides:
      getMnemonic in class AbstractColorChooserPanel
      Returns:
      KeyEvent.VK constant identifying the mnemonic; <= 0 for no mnemonic
      Since:
      1.4
      See Also:
    • getDisplayedMnemonicIndex

      public int getDisplayedMnemonicIndex()
      Provides a hint to the look and feel as to the index of the character in getDisplayName that should be visually identified as the mnemonic. The look and feel should only use this if getMnemonic returns a value > 0.

      The return value here is a hint, it is ultimately up to the look and feel to honor the return value in some meaningful way. For example, a look and feel may wish to render each AbstractColorChooserPanel in a JTabbedPane, and further use this return value to underline a character in the getDisplayName.

      This implementation looks up the value from the default ColorChooser.rgbDisplayedMnemonicIndex, or if it isn't available (or not an Integer) returns -1. The lookup for the default is done through the UIManager: UIManager.get("ColorChooser.hsbDisplayedMnemonicIndex");.

      Overrides:
      getDisplayedMnemonicIndex in class AbstractColorChooserPanel
      Returns:
      Character index to render mnemonic for; -1 to provide no visual identifier for this panel.
      Since:
      1.4
      See Also:
    • getSmallDisplayIcon

      public Icon getSmallDisplayIcon()
      Specified by:
      getSmallDisplayIcon in class AbstractColorChooserPanel
    • getLargeDisplayIcon

      public Icon getLargeDisplayIcon()
      Specified by:
      getLargeDisplayIcon in class AbstractColorChooserPanel
    • stateChanged

      public void stateChanged(ChangeEvent e)
      Specified by:
      stateChanged in interface ChangeListener
    • hierarchyChanged

      public void hierarchyChanged(HierarchyEvent he)
      Specified by:
      hierarchyChanged in interface HierarchyListener