public class PaletteListModel
extends javax.swing.AbstractListModel
Constructor and Description |
---|
PaletteListModel(java.lang.String name,
java.lang.String info,
PaletteEntry[] entries)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
int |
computeClosestIndex(java.awt.Color referenceColor)
Computes the index of the color which comes closest to the specified
color.
|
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.
|
java.lang.Object |
getElementAt(int index) |
java.lang.String |
getInfo() |
java.lang.String |
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 |
setInfo(java.lang.String newValue) |
void |
setName(java.lang.String newValue) |
java.lang.String |
toString()
Used for displaying the name of the palette in the combo box
of the ColorPalettesChooser.
|
public PaletteListModel(java.lang.String name, java.lang.String info, PaletteEntry[] entries)
Note: For efficiency reasons this method stores the passed in array internally without copying it. Do not modify the array after invoking this method.
public void setName(java.lang.String newValue)
public java.lang.String getName()
public void setInfo(java.lang.String newValue)
public java.lang.String getInfo()
public java.lang.Object getElementAt(int index)
public int getSize()
public java.lang.String toString()
toString
in class java.lang.Object
public int computeClosestIndex(java.awt.Color referenceColor)
public void setClosestIndex(int newValue)
newValue
- closest index or -1, if no color is close.public int getClosestIndex()