Class PaletteListModel
java.lang.Object
javax.swing.AbstractListModel
org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.colorchooser.PaletteListModel
- All Implemented Interfaces:
Serializable
,ListModel
PaletteListModel manages a list of PaletteEntry.
- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractListModel
listenerList
-
Constructor Summary
ConstructorsConstructorDescriptionPaletteListModel
(String name, String info, PaletteEntry[] entries) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionint
computeClosestIndex
(Color referenceColor) Computes the index of the color which comes closest to the specified color.int
Returns the index of the color which is closest to the current color in the color chooser, or -1 of no such color exists.getElementAt
(int index) getInfo()
getName()
int
getSize()
void
setClosestIndex
(int newValue) Sets the index of the color which is closest to the current color in the color chooser.void
void
toString()
Used for displaying the name of the palette in the combo box of the ColorPalettesChooser.Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
-
Constructor Details
-
PaletteListModel
Creates a new instance.
-
-
Method Details
-
setName
-
getName
-
setInfo
-
getInfo
-
getElementAt
-
getSize
public int getSize() -
toString
Used for displaying the name of the palette in the combo box of the ColorPalettesChooser. -
computeClosestIndex
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.
-