gov.noaa.pmel.sgt
Class CLIndexedColorMap

java.lang.Object
  |
  +--gov.noaa.pmel.sgt.ColorMap
        |
        +--gov.noaa.pmel.sgt.CLIndexedColorMap
All Implemented Interfaces:
java.lang.Cloneable, ContourLevelsAccess, java.util.EventListener, IndexedColor, java.beans.PropertyChangeListener

public class CLIndexedColorMap
extends ColorMap
implements java.lang.Cloneable, java.beans.PropertyChangeListener, IndexedColor, ContourLevelsAccess

CLIndexedColorMap provides a mapping from a value to a Color.

Since:
2.0
Version:
$Revision: 1.5 $, $Date: 2001/12/13 19:07:03 $
Author:
Donald Denbo

Constructor Summary
CLIndexedColorMap(java.awt.Color[] colors)
          Initialize the color map with an array of Color objects.
CLIndexedColorMap(float[] red, float[] green, float[] blue)
          Initialize the color map with float arrays of red, green, and blue.
CLIndexedColorMap(int[] red, int[] green, int[] blue)
          Intialize the color map with int arrays of red, green, and blue.
 
Method Summary
 ColorMap copy()
          Create a copy of the ColorMap object.
 boolean equals(ColorMap cm)
          Test for equality.
 java.awt.Color getColor(double val)
          Get a Color.
 java.awt.Color getColor(int indx)
          Get a Color.
 ContourLevels getContourLevels()
          Get ContourLevels.
 int getMaximumIndex()
          Get the maximum color index.
 Range2D getRange()
          Get the current user range for the ContourLevels object.
 void setColor(int indx, java.awt.Color colr)
          Change the Color.
 void setColor(int indx, int red, int green, int blue)
          Change the Color.
 void setContourLevels(ContourLevels cl)
          Set ContourLevels.
 
Methods inherited from class gov.noaa.pmel.sgt.ColorMap
addPropertyChangeListener, propertyChange, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Constructor Detail

CLIndexedColorMap

public CLIndexedColorMap(int[] red,
                         int[] green,
                         int[] blue)
Intialize the color map with int arrays of red, green, and blue. The arrays must be the same length.
Parameters:
red - Array of the red component 0 - 255.
green - Array of the green component 0 - 255.
blue - Array of the blue component 0 - 255.

CLIndexedColorMap

public CLIndexedColorMap(float[] red,
                         float[] green,
                         float[] blue)
Initialize the color map with float arrays of red, green, and blue. The arrays must be the same length.
Parameters:
red - Array of the red component 0.0 - 1.0.
green - Array of the green component 0.0 - 1.0.
blue - Array of the blue component 0.0 - 1.0.
See Also:
Color

CLIndexedColorMap

public CLIndexedColorMap(java.awt.Color[] colors)
Initialize the color map with an array of Color objects.
Parameters:
colors - Array of the Color objects.
See Also:
Color
Method Detail

copy

public ColorMap copy()
Create a copy of the ColorMap object.
Overrides:
copy in class ColorMap

getColor

public java.awt.Color getColor(int indx)
Get a Color.
Specified by:
getColor in interface IndexedColor
Returns:
color

getColor

public java.awt.Color getColor(double val)
Get a Color.
Overrides:
getColor in class ColorMap
Parameters:
val - Value
Returns:
Color

getRange

public Range2D getRange()
Get the current user range for the ContourLevels object.
Overrides:
getRange in class ColorMap
Returns:
user range

setColor

public void setColor(int indx,
                     java.awt.Color colr)
Change the Color.
Specified by:
setColor in interface IndexedColor
Parameters:
colr - new Color
indx - index of color

setColor

public void setColor(int indx,
                     int red,
                     int green,
                     int blue)
Change the Color.
Property Change: color.
Specified by:
setColor in interface IndexedColor
Parameters:
red - red component
green - green component
blue - blue component
indx - index of color

getMaximumIndex

public int getMaximumIndex()
Get the maximum color index.
Specified by:
getMaximumIndex in interface IndexedColor
Returns:
maximum legal color index

setContourLevels

public void setContourLevels(ContourLevels cl)
Set ContourLevels.
Property Change: color.
Specified by:
setContourLevels in interface ContourLevelsAccess
Parameters:
cl - ContourLevels

getContourLevels

public ContourLevels getContourLevels()
Get ContourLevels.
Specified by:
getContourLevels in interface ContourLevelsAccess
Returns:
ContourLevels

equals

public boolean equals(ColorMap cm)
Test for equality.
Overrides:
equals in class ColorMap


Send comments about the Scientific Graphics toolkit to dwd@pmel.noaa.gov. For more information about Java Development in the EPIC Group see the EPIC Software Page
Generated on December 13 2001