Package rma.util
Class BandedColorContour
java.lang.Object
rma.util.ColorContour
rma.util.BandedColorContour
- All Implemented Interfaces:
AsciiSerializable
,FieldAccessor
,Serializable
,Cloneable
This Color Contour gives "bands" instead of a gradient.
For example: Set Blue at 0.0f, Red at 25.0f, and Green at 50.0f, and then:
* A value less than zero will return the default color
* A Value greater than or equal to zero but also less than 25 will return Blue
* A value greater than or equal to zero but also less than 50 will return Red
* A value greater than or equal to 50 will return Green
- See Also:
-
Field Summary
Fields inherited from class rma.util.ColorContour
_bright, _max, _maxClip, _maxMinusMin, _min, _minClip, _sat, _scaleToClipping, _typeToClass, ASPECT_SHADING_TYPE, GRAYSCALE_TYPE, LINEAR_TYPE, mPropertyChangeSupport, PRECIPITATION_TYPE, RED_GREEN_BLUE_TYPE, TERRAIN_TYPE, WATER_DEPTH_TYPE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BandedColorContour
void
Remove all colors, leaving just the default colorgetColorAtIndex
(double index) Get the color for a value.fetches the set of double used as indexes for colorsprotected void
getRGB0
(double[] rgb, double val, double minValue, double maxValue) protected double[]
getRGB0
(double val, double minValue, double maxValue) removeColorAtIndex
(double colorIndex) Remove a color for a given indexsetColorAtIndex
(double index, Color color) Sets the color which starts at a valuevoid
setDefaultColor
(Color color) This is the default value for when there is no value below the requested one.Methods inherited from class rma.util.ColorContour
addExtras, addPropertyChangeListener, clone, copyInto, createContourFromAttributes, getAttributes, getAttributes, getBrightness, getColor, getColor, getFieldObject, getInstanceForType, getMaxClipping, getMaxValue, getMinClipping, getMinValue, getRGB, getRGB, getSaturation, getScaleToClipping, getType, getTypes, read, read0, removePropertyChangeSupport, setAttributes, setBrightness, setFieldObject, setMaxClipping, setMaxValue, setMinClipping, setMinValue, setSaturation, setScaleToClipping, write
-
Constructor Details
-
BandedColorContour
public BandedColorContour()
-
-
Method Details
-
buildSwtBandedColor
-
getIndexes
fetches the set of double used as indexes for colors- Returns:
- the set of doubles that are the current color index values
-
setColorAtIndex
Sets the color which starts at a value- Parameters:
index
- The value at which the color should startcolor
- The color which is being set- Returns:
- The previous color (if any) that was at the value
-
getColorAtIndex
Get the color for a value. If Red is set at 0, all values above zero will return Red, and any below will return the default value.- Parameters:
index
- The index that the color should start at- Returns:
- The color to be set
-
removeColorAtIndex
Remove a color for a given index- Parameters:
colorIndex
- The index- Returns:
- An Entry containing the removed color and the minimum value for the color
-
clearColors
public void clearColors()Remove all colors, leaving just the default color -
setDefaultColor
This is the default value for when there is no value below the requested one. If this is set to Blue, no other colors are set, then all requests will return Blue. If this is set to Green and Red is set at 0, all requests below zero will return Green and all requests greater than or equal to zero will return Red.- Parameters:
color
- The new default color
-
getRGB0
protected double[] getRGB0(double val, double minValue, double maxValue) - Specified by:
getRGB0
in classColorContour
-
getRGB0
protected void getRGB0(double[] rgb, double val, double minValue, double maxValue) - Specified by:
getRGB0
in classColorContour
-