Class DefaultColorPaletteModel
- java.lang.Object
-
- com.inductiveautomation.ignition.client.util.gui.color.DefaultColorPaletteModel
-
- All Implemented Interfaces:
ColorPaletteModel
public class DefaultColorPaletteModel extends java.lang.Object implements ColorPaletteModel
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description DefaultColorPaletteModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChangeListener(javax.swing.event.ChangeListener l)
Addslistener
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 locationint
getColumnCount()
How many columns of colors in the paletteint
getRowCount()
How many rows of colors in the palette?void
initDefaultColors()
void
removeChangeListener(javax.swing.event.ChangeListener l)
Removeslistener
as a listener to changes in the model.void
setColor(int row, int column, java.awt.Color color)
Change the color at a location
-
-
-
Method Detail
-
initDefaultColors
public void initDefaultColors()
-
getColumnCount
public int getColumnCount()
Description copied from interface:ColorPaletteModel
How many columns of colors in the palette- Specified by:
getColumnCount
in interfaceColorPaletteModel
-
getRowCount
public int getRowCount()
Description copied from interface:ColorPaletteModel
How many rows of colors in the palette?- Specified by:
getRowCount
in interfaceColorPaletteModel
-
getColor
public java.awt.Color getColor(int row, int column)
Description copied from interface:ColorPaletteModel
Returns the color at this location- Specified by:
getColor
in interfaceColorPaletteModel
-
setColor
public void setColor(int row, int column, java.awt.Color color)
Description copied from interface:ColorPaletteModel
Change the color at a location- Specified by:
setColor
in interfaceColorPaletteModel
-
bulkLoad
public void bulkLoad(java.util.List<java.awt.Color> colors, int columns)
Description copied from interface:ColorPaletteModel
Replaces all colors in the model, and my alter the structure (column/row count). The size of the color list must be divisible by the new column count.- Specified by:
bulkLoad
in interfaceColorPaletteModel
-
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener l)
Description copied from interface:ColorPaletteModel
Addslistener
as a listener to changes in the model.- Specified by:
addChangeListener
in interfaceColorPaletteModel
- Parameters:
l
- theChangeListener
to be added
-
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener l)
Description copied from interface:ColorPaletteModel
Removeslistener
as a listener to changes in the model.- Specified by:
removeChangeListener
in interfaceColorPaletteModel
- Parameters:
l
- theChangeListener
to be removed
-
fireStateChanged
protected void fireStateChanged()
-
-