Serializable
, ListModel
public class PaletteListModel extends AbstractListModel
listenerList
Constructor | Description |
---|---|
PaletteListModel(String name,
String info,
PaletteEntry[] entries) |
Creates a new instance.
|
Modifier and Type | Method | Description |
---|---|---|
int |
computeClosestIndex(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.
|
Object |
getElementAt(int index) |
|
String |
getInfo() |
|
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(String newValue) |
|
void |
setName(String newValue) |
|
String |
toString() |
Used for displaying the name of the palette in the combo box
of the ColorPalettesChooser.
|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
public PaletteListModel(String name, String info, PaletteEntry[] entries)
public void setName(String newValue)
public String getName()
public void setInfo(String newValue)
public String getInfo()
public Object getElementAt(int index)
public int getSize()
public String toString()
public int computeClosestIndex(Color referenceColor)
public void setClosestIndex(int newValue)
newValue
- closest index or -1, if no color is close.public int getClosestIndex()