Class ColorComboBox

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JComboBox<Color>
uk.ac.starlink.util.gui.RenderingComboBox<Color>
uk.ac.starlink.ttools.gui.ColorComboBox
All Implemented Interfaces:
ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, ListDataListener, ListCellRenderer<Color>

public class ColorComboBox extends uk.ac.starlink.util.gui.RenderingComboBox<Color>
Combo box for selecting colours. Comes with its own renderer.
Since:
12 Jan 2006
Author:
Mark Taylor
See Also:
  • Constructor Details

    • ColorComboBox

      public ColorComboBox()
      Constructs a colour selector with a default set of colours.
    • ColorComboBox

      public ColorComboBox(Color[] colors)
      Constructs a colour selector with a given set of colours.
      Parameters:
      colors - colour array
  • Method Details

    • setSelectedColor

      public void setSelectedColor(Color color)
      Sets the currently selected colour.
      Parameters:
      color - colour to select
    • getSelectedColor

      public Color getSelectedColor()
      Returns the currently selected colour.
      Returns:
      selected colour
    • getRendererText

      protected String getRendererText(Color obj)
      Overrides:
      getRendererText in class uk.ac.starlink.util.gui.RenderingComboBox<Color>
    • getRendererIcon

      protected Icon getRendererIcon(Color obj)
      Overrides:
      getRendererIcon in class uk.ac.starlink.util.gui.RenderingComboBox<Color>