Class TLcdPOLColorTable

java.lang.Object
com.luciad.format.pol.TLcdPOLColorTable
All Implemented Interfaces:
ILcdPOLColorTable, ILcdCloneable, Cloneable

public class TLcdPOLColorTable extends Object implements ILcdPOLColorTable, ILcdCloneable
A color table to render POL elements graphically. It maps a integer key to a corresponding color.
  • Field Details

    • sColours

      public static final Color[] sColours
      Colors used for default color tables created.
  • Constructor Details

    • TLcdPOLColorTable

      public TLcdPOLColorTable()
      Creates a new (empty) pol color table.
  • Method Details

    • createDefaultPolColorTable

      public static ILcdPOLColorTable createDefaultPolColorTable()
      Creates a color table using the values in sColours.
      Returns:
      a new color table with default values
    • addColor

      public int addColor(Color aColor)
      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

      public Color putColor(int aIndex, Color aColor)
      Adds a color to the table with the specified key.
      Parameters:
      aIndex - the key of the new color
      aColor - the new color to be added
      Returns:
      the previous value with that key
    • getColor

      public Color getColor(int aIndex)
      Getter for a specific element in the ILcdPOLColorTable.
      Specified by:
      getColor in interface ILcdPOLColorTable
      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 interface ILcdPOLColorTable
      Returns:
      the number of colors in this POL color table.
    • clone

      public Object clone()
      Description copied from interface: ILcdCloneable

      Makes Object.clone() public.

      When for example extending from 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 interface ILcdCloneable
      Overrides:
      clone in class Object
      See Also: