sgtplot
Class IndexedColorMap
- java.lang.Object
-
- sgtplot.ColorMap
-
- sgtplot.IndexedColorMap
-
- All Implemented Interfaces:
- java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, IndexedColor, TransformAccess
public class IndexedColorMap extends ColorMap implements java.lang.Cloneable, java.beans.PropertyChangeListener, IndexedColor, TransformAccess
IndexedColorMapprovides a mapping from a value to aColor.- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description IndexedColorMap(java.awt.Color[] colors)Initialize the color map with an array ofColorobjects.IndexedColorMap(float[] red, float[] green, float[] blue)Initialize the color map with float arrays of red, green, and blue.IndexedColorMap(int[] red, int[] green, int[] blue)Initialize the color map with int arrays of red, green, and blue.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description ColorMapcopy()Create a copy of theColorMapbooleanequals(ColorMap cm)Test for equality of color maps.java.awt.ColorgetColor(double val)Get aColor.java.awt.ColorgetColorByIndex(int indx)Get aColor.intgetMaximumIndex()Get the maximum color index.Range2DgetRange()Get the current user range for theTransform.TransformgetTransform()Get the transform for the color mapping.voidsetColor(int index, java.awt.Color colr)Change theColor.voidsetColor(int indx, int red, int green, int blue)Change theColor.voidsetRange(Range2D range)Set the user range for theTransform.voidsetTransform(Transform trans)Set the transform for the color mapping.-
Methods inherited from class sgtplot.ColorMap
addPropertyChangeListener, isBatch, propertyChange, removePropertyChangeListener, setBatch, setBatch
-
-
-
-
Constructor Detail
-
IndexedColorMap
public IndexedColorMap(int[] red, int[] green, int[] blue)Initialize the color map with int arrays of red, green, and blue. The arrays must be the same length. Sets upColorMapforINDEXEDaccess.- 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.- See Also:
Color
-
IndexedColorMap
public IndexedColorMap(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. Sets upColorMapforINDEXEDaccess.- 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
-
IndexedColorMap
public IndexedColorMap(java.awt.Color[] colors)
Initialize the color map with an array ofColorobjects. Sets upColorMapforINDEXEDaccess.- Parameters:
colors- Array of the Color objects.- See Also:
Color
-
-
Method Detail
-
getColorByIndex
public java.awt.Color getColorByIndex(int indx)
Get aColor.- Specified by:
getColorByIndexin interfaceIndexedColor- Returns:
- color
- Since:
- 3.0
-
getColor
public java.awt.Color getColor(double val)
Get aColor.
-
setRange
public void setRange(Range2D range)
Set the user range for theTransform.- Specified by:
setRangein interfaceTransformAccess
-
getRange
public Range2D getRange()
Get the current user range for theTransform.
-
setColor
public void setColor(int index, java.awt.Color colr)Change theColor.- Specified by:
setColorin interfaceIndexedColor- Parameters:
colr- newColorindx- index of color
-
setColor
public void setColor(int indx, int red, int green, int blue)Change theColor.
Property Change:color.- Specified by:
setColorin interfaceIndexedColor- Parameters:
red- red componentgreen- green componentblue- blue componentindx- index of color
-
getMaximumIndex
public int getMaximumIndex()
Get the maximum color index.- Specified by:
getMaximumIndexin interfaceIndexedColor- Returns:
- maximum legal color index
-
setTransform
public void setTransform(Transform trans)
Set the transform for the color mapping.
Property Change:transform.- Parameters:
trans- index colorTransform
-
getTransform
public Transform getTransform()
Get the transform for the color mapping.- Returns:
- index color
Transform
-
-
DMelt 3.0 © DataMelt by jWork.ORG