gov.noaa.pmel.sgt
Class ColorMap

java.lang.Object
  extended by gov.noaa.pmel.sgt.ColorMap
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
CLIndexedColorMap, CLTransformColorMap, IndexedColorMap, TransformColorMap

public abstract class ColorMap
extends java.lang.Object
implements java.lang.Cloneable, java.beans.PropertyChangeListener, java.io.Serializable

ColorMap provides a mapping from an index or value to a Color. Several methods of mapping an index or value to a Color are summarized below.

IndexedColorMap
Color is determined from an array, the index computed from a Transform.
TransformColorMap
Red, green, blue Color components are computed from Transforms.
CLIndexedColorMap
Color is determined from and array, the index computed from a ContourLevels object.
CLTransformColorMap
Red, green, blue Color components are computed from Transforms, using the index computed from a ContourLevels object divided by the maximum index value.

Since:
1.0
Version:
$Revision$, $Date$
Author:
Donald Denbo
See Also:
Serialized Form

Field Summary
protected  boolean batch_
           
protected  boolean local_
           
protected  boolean modified_
           
 
Constructor Summary
ColorMap()
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add listener to changes in ColorMap properties.
abstract  ColorMap copy()
           
abstract  boolean equals(ColorMap cm)
          Test for equality of color maps.
protected  void firePropertyChange(java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue)
           
abstract  java.awt.Color getColor(double val)
          Get a Color.
abstract  Range2D getRange()
          Get the current user range for the Transforms or ContourLevel.
 boolean isBatch()
          Is the attribute in batch mode?
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove listener.
 void setBatch(boolean batch)
          Batch the changes to the ColorMap.
 void setBatch(boolean batch, boolean local)
          Batch the changes to the ColorMap and set local flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

batch_

protected boolean batch_

local_

protected boolean local_

modified_

protected boolean modified_
Constructor Detail

ColorMap

public ColorMap()
Method Detail

copy

public abstract ColorMap copy()

getColor

public abstract java.awt.Color getColor(double val)
Get a Color.

Parameters:
val - Value
Returns:
Color

getRange

public abstract Range2D getRange()
Get the current user range for the Transforms or ContourLevel.

Returns:
user range

equals

public abstract boolean equals(ColorMap cm)
Test for equality of color maps.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add listener to changes in ColorMap properties.


removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove listener.


propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

firePropertyChange

protected void firePropertyChange(java.lang.String name,
                                  java.lang.Object oldValue,
                                  java.lang.Object newValue)

setBatch

public void setBatch(boolean batch)
Batch the changes to the ColorMap.

Since:
3.0

setBatch

public void setBatch(boolean batch,
                     boolean local)
Batch the changes to the ColorMap and set local flag. Determines whether AttributeChangeEvent will be set local.

Since:
3.0

isBatch

public boolean isBatch()
Is the attribute in batch mode?

Since:
3.0