Class DefaultRGBAChooserPanel

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

public class DefaultRGBAChooserPanel extends AbstractColorChooserPanel implements ChangeListener
The standard RGB chooser.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder.

See Also:
  • Field Details

    • redSlider

      protected JSlider redSlider
    • greenSlider

      protected JSlider greenSlider
    • blueSlider

      protected JSlider blueSlider
    • alphaSlider

      protected JSlider alphaSlider
    • redField

      protected JSpinner redField
    • blueField

      protected JSpinner blueField
    • greenField

      protected JSpinner greenField
    • alphaField

      protected JSpinner alphaField
  • Constructor Details

    • DefaultRGBAChooserPanel

      public DefaultRGBAChooserPanel()
  • Method Details

    • setAlpha

      public void setAlpha(int alpha)
    • 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.rgbMnemonic, 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.rgbDisplayedMnemonicIndex");.

      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
    • installChooserPanel

      public void installChooserPanel(JColorChooser enclosingChooser)
      The background color, foreground color, and font are already set to the defaults from the defaults table before this method is called.
      Overrides:
      installChooserPanel in class AbstractColorChooserPanel
    • buildChooser

      protected void buildChooser()
      Specified by:
      buildChooser in class AbstractColorChooserPanel
    • uninstallChooserPanel

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

      public void updateChooser()
      Specified by:
      updateChooser in class AbstractColorChooserPanel
    • stateChanged

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