visidia.misc.colorpalette
Class ColorPalette

java.lang.Object
  extended by visidia.misc.colorpalette.ColorPalette
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CustomColorPalette, StandardColorPalette

public class ColorPalette
extends java.lang.Object
implements java.io.Serializable

ColorPalette is the base class for manipulating color palettes.

See Also:
Serialized Form

Field Summary
protected  java.util.Hashtable<java.lang.Object,java.awt.Color> table
          The table.
 
Constructor Summary
protected ColorPalette()
          Instantiates a new color palette.
 
Method Summary
 java.awt.Color getColor(java.lang.Object key)
          Gets the color associated to key.
 java.util.Enumeration<java.lang.Object> keys()
          Gets the keys.
 int size()
          Returns the number of colors in current palette.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected java.util.Hashtable<java.lang.Object,java.awt.Color> table
The table.

Constructor Detail

ColorPalette

protected ColorPalette()
Instantiates a new color palette.

Method Detail

getColor

public java.awt.Color getColor(java.lang.Object key)
Gets the color associated to key.

Parameters:
key - the key
Returns:
the color

keys

public java.util.Enumeration<java.lang.Object> keys()
Gets the keys.

Returns:
the keys

size

public int size()
Returns the number of colors in current palette.

Returns:
the palette size