public class ColorScale extends Object implements Cloneable, Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
ColorScale.MinMaxType |
static class |
ColorScale.Panel |
| Modifier and Type | Field and Description |
|---|---|
static int |
HORIZONTAL |
static Color[] |
hueBands |
static Color[] |
redBlue |
static Color[] |
redHot |
static Color[] |
spectrum2 |
static int |
VERTICAL |
| Constructor and Description |
|---|
ColorScale() |
ColorScale(String name) |
ColorScale(String name,
Color[] c) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
add action event listener
|
Object |
clone() |
Color |
getColor(int i) |
double |
getEdge(int index)
Get the edge of the ith interval.
|
int |
getHistMax()
This is an optimization for counting the number of colors in each interval.
|
int |
getIndexFromValue(double value)
Get which color interval this value lies in.
|
int |
getIndexFromValueLog(double value) |
Color |
getMissingDataColor() |
String |
getName()
Get the colorscale name.
|
int |
getNumColors()
Get the number of colors in the colorscale.
|
void |
removePropertyChangeListener(PropertyChangeListener l)
remove action event listener
|
void |
resetHist()
reset the histogram.
|
void |
setGeoGrid(IsMissingEvaluator gg) |
void |
setMinMax(double min,
double max)
Set the data min/max interval.
|
void |
setName(String name)
Set the colorscale name.
|
void |
setNumColors(int n)
Set the number of colors in the colorscale.
|
String |
toString() |
public static final int VERTICAL
public static final int HORIZONTAL
public static final Color[] redHot
public static final Color[] redBlue
public static final Color[] hueBands
public static final Color[] spectrum2
public ColorScale(String name)
public ColorScale()
public void addPropertyChangeListener(PropertyChangeListener l)
public void removePropertyChangeListener(PropertyChangeListener l)
public String getName()
public void setName(String name)
public int getNumColors()
public void setNumColors(int n)
public Color getColor(int i)
public double getEdge(int index)
public void setGeoGrid(IsMissingEvaluator gg)
public Color getMissingDataColor()
public int getIndexFromValue(double value)
value - minimum data value.public int getIndexFromValueLog(double value)
public void setMinMax(double min,
double max)
edge data interval
0 min value <= min
1 min+incr min <= value < min + incr
2 min+2*incr min+incr <= value < min+2*incr
ith min+i*incr min+(i-1)*incr <= value < min+i*incr
n-2 max min+(n-3)*incr <= value < max
n-1 max max < value
n value = missingDataValue
min - minimum data valuemax - maximum data valuepublic int getHistMax()
public void resetHist()
Copyright © 1999–2014 UCAR/Unidata. All rights reserved.