java.lang.Object
javax.swing.AbstractListModel
org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.colorchooser.PaletteListModel
All Implemented Interfaces:
Serializable, ListModel

public class PaletteListModel extends AbstractListModel
PaletteListModel manages a list of PaletteEntry.
See Also:
  • Constructor Details

    • PaletteListModel

      public PaletteListModel(String name, String info, PaletteEntry[] entries)
      Creates a new instance.
  • Method Details

    • setName

      public void setName(String newValue)
    • getName

      public String getName()
    • setInfo

      public void setInfo(String newValue)
    • getInfo

      public String getInfo()
    • getElementAt

      public Object getElementAt(int index)
    • getSize

      public int getSize()
    • toString

      public String toString()
      Used for displaying the name of the palette in the combo box of the ColorPalettesChooser.
      Overrides:
      toString in class Object
    • computeClosestIndex

      public int computeClosestIndex(Color referenceColor)
      Computes the index of the color which comes closest to the specified color. This may return -1, if there is no sufficiently close color in the color list.
    • setClosestIndex

      public void setClosestIndex(int newValue)
      Sets the index of the color which is closest to the current color in the color chooser.
      Parameters:
      newValue - closest index or -1, if no color is close.
    • getClosestIndex

      public int getClosestIndex()
      Returns the index of the color which is closest to the current color in the color chooser, or -1 of no such color exists.