public class TLcdPOLColorTable extends Object implements ILcdPOLColorTable, ILcdCloneable
Modifier and Type | Field and Description |
---|---|
static Color[] |
sColours
Colors used for default color tables created.
|
Constructor and Description |
---|
TLcdPOLColorTable()
Creates a new (empty) pol color table.
|
Modifier and Type | Method and Description |
---|---|
int |
addColor(Color aColor)
Adds a new color with key equal to current size of the table + 1.
|
Object |
clone()
Makes
Object.clone() public. |
static ILcdPOLColorTable |
createDefaultPolColorTable()
Creates a color table using the values in
sColours . |
Color |
getColor(int aIndex)
Getter for a specific element in the
ILcdPOLColorTable . |
int |
getColorCount()
Returns the number of colors in this POL color table.
|
Color |
putColor(int aIndex,
Color aColor)
Adds a color to the table with the specified key.
|
public static final Color[] sColours
public TLcdPOLColorTable()
public static ILcdPOLColorTable createDefaultPolColorTable()
sColours
.public int addColor(Color aColor)
aColor
- the color to be added to the table.public Color putColor(int aIndex, Color aColor)
aIndex
- the key of the new coloraColor
- the new color to be addedpublic Color getColor(int aIndex)
ILcdPOLColorTable
.getColor
in interface ILcdPOLColorTable
aIndex
- The index.null
is returned when there's no associated color.public int getColorCount()
ILcdPOLColorTable
getColorCount
in interface ILcdPOLColorTable
public Object clone()
ILcdCloneable
Makes Object.clone()
public.
java.lang.Object
, it can be implemented like this:
public Object clone() {
try {
return super.clone();
} catch ( CloneNotSupportedException e ) {
// Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
throw new RuntimeException( e );
}
}
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()