public class DefaultColorPaletteModel extends java.lang.Object implements ColorPaletteModel
Modifier and Type | Field and Description |
---|---|
protected javax.swing.event.ChangeEvent |
changeEvent |
protected java.util.List<java.awt.Color> |
colors |
protected int |
columnCount |
protected javax.swing.event.EventListenerList |
listenerList |
Constructor and Description |
---|
DefaultColorPaletteModel() |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(javax.swing.event.ChangeListener l)
Adds
listener as a listener to changes in the model. |
void |
bulkLoad(java.util.List<java.awt.Color> colors,
int columns)
Replaces all colors in the model, and my alter the structure (column/row count).
|
protected void |
fireStateChanged() |
java.awt.Color |
getColor(int row,
int column)
Returns the color at this location
|
int |
getColumnCount()
How many columns of colors in the palette
|
int |
getRowCount()
How many rows of colors in the palette?
|
void |
initDefaultColors() |
void |
removeChangeListener(javax.swing.event.ChangeListener l)
Removes
listener as a listener to changes in the model. |
void |
setColor(int row,
int column,
java.awt.Color color)
Change the color at a location
|
protected java.util.List<java.awt.Color> colors
protected int columnCount
protected transient javax.swing.event.ChangeEvent changeEvent
protected transient javax.swing.event.EventListenerList listenerList
public void initDefaultColors()
public int getColumnCount()
ColorPaletteModel
getColumnCount
in interface ColorPaletteModel
public int getRowCount()
ColorPaletteModel
getRowCount
in interface ColorPaletteModel
public java.awt.Color getColor(int row, int column)
ColorPaletteModel
getColor
in interface ColorPaletteModel
public void setColor(int row, int column, java.awt.Color color)
ColorPaletteModel
setColor
in interface ColorPaletteModel
public void bulkLoad(java.util.List<java.awt.Color> colors, int columns)
ColorPaletteModel
bulkLoad
in interface ColorPaletteModel
public void addChangeListener(javax.swing.event.ChangeListener l)
ColorPaletteModel
listener
as a listener to changes in the model.addChangeListener
in interface ColorPaletteModel
l
- the ChangeListener
to be addedpublic void removeChangeListener(javax.swing.event.ChangeListener l)
ColorPaletteModel
listener
as a listener to changes in the model.removeChangeListener
in interface ColorPaletteModel
l
- the ChangeListener
to be removedprotected void fireStateChanged()