Package com.luciad.format.pol
Class TLcdPOLColorTable
java.lang.Object
com.luciad.format.pol.TLcdPOLColorTable
- All Implemented Interfaces:
ILcdPOLColorTable
,ILcdCloneable
,Cloneable
A color table to render POL elements graphically. It maps a integer key to a corresponding color.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Adds a new color with key equal to current size of the table + 1.clone()
MakesObject.clone()
public.static ILcdPOLColorTable
Creates a color table using the values insColours
.getColor
(int aIndex) Getter for a specific element in theILcdPOLColorTable
.int
Returns the number of colors in this POL color table.Adds a color to the table with the specified key.
-
Field Details
-
sColours
Colors used for default color tables created.
-
-
Constructor Details
-
TLcdPOLColorTable
public TLcdPOLColorTable()Creates a new (empty) pol color table.
-
-
Method Details
-
createDefaultPolColorTable
Creates a color table using the values insColours
.- Returns:
- a new color table with default values
-
addColor
Adds a new color with key equal to current size of the table + 1. (useful when filling the table in the correct order).- Parameters:
aColor
- the color to be added to the table.- Returns:
- the key corresponding to this color.
-
putColor
Adds a color to the table with the specified key.- Parameters:
aIndex
- the key of the new coloraColor
- the new color to be added- Returns:
- the previous value with that key
-
getColor
Getter for a specific element in theILcdPOLColorTable
.- Specified by:
getColor
in interfaceILcdPOLColorTable
- Parameters:
aIndex
- The index.- Returns:
- The color associated with index i.
null
is returned when there's no associated color.
-
getColorCount
public int getColorCount()Description copied from interface:ILcdPOLColorTable
Returns the number of colors in this POL color table.- Specified by:
getColorCount
in interfaceILcdPOLColorTable
- Returns:
- the number of colors in this POL color table.
-
clone
Description copied from interface:ILcdCloneable
Makes
When for example extending fromObject.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 ); } }
- Specified by:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classObject
- See Also:
-