Class PaletteListModel
java.lang.Object
javax.swing.AbstractListModel
org.pushingpixels.radiance.theming.internal.contrib.randelshofer.quaqua.colorchooser.PaletteListModel
- All Implemented Interfaces:
Serializable, ListModel
PaletteListModel manages a list of PaletteEntry.
- Version:
- 1.0 19 septembre 2005 Created.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intIndex of the color which is closest to the current color in the color chooser.private PaletteEntry[]private StringInformatation about the palette, such as the copyright.private StringName of the palette.Fields inherited from class AbstractListModel
listenerList -
Constructor Summary
ConstructorsConstructorDescriptionPaletteListModel(String name, String info, PaletteEntry[] entries) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionintcomputeClosestIndex(Color referenceColor) Computes the index of the color which comes closest to the specified color.intReturns 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()intgetSize()voidsetClosestIndex(int newValue) Sets the index of the color which is closest to the current color in the color chooser.voidvoidtoString()Used for displaying the name of the palette in the combo box of the ColorPalettesChooser.Methods inherited from class AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
-
Field Details
-
name
Name of the palette. -
info
Informatation about the palette, such as the copyright. -
entries
-
closestIndex
private int closestIndexIndex of the color which is closest to the current color in the color chooser.
-
-
Constructor Details
-
PaletteListModel
Creates a new instance.
-
-
Method Details
-
setName
-
getName
-
setInfo
-
getInfo
-
getElementAt
-
getSize
public int getSize() -
toString
-
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.
-