|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.approximatrix.charting.render.colorscale.AbstractColorScale
com.approximatrix.charting.render.colorscale.IndexedColorScale
public class IndexedColorScale
Provides a color scale object that looks up colors based on an index passed. The index/Color pairs must be assigned prior to calling a conversion method. Returns FAILED_LOOKUP when the index does not exist in the Map.
| Field Summary | |
|---|---|
protected static java.awt.Color |
FAILED_LOOKUP
The color to return if the index does not exist |
protected java.util.Map<java.lang.Integer,java.awt.Color> |
map
Maps integers to Colors |
| Constructor Summary | |
|---|---|
IndexedColorScale()
Constructs the IndexedColorScale object and initializes an empty color map. |
|
IndexedColorScale(java.util.Map<java.lang.Integer,java.awt.Color> map)
Constructs the IndexedColorScale object based on the passed map of index/Color pairs. |
|
| Method Summary | |
|---|---|
java.awt.Color |
getColor(double value)
Retrieves the color by converting the value by rounding to an integer before requesting the Color of the rounded index. |
java.awt.Color |
getColor(int value)
Returns a color based on an integer data value |
void |
setColor(int i,
java.awt.Color val)
Assigns the specified Color to the specified index in the map. |
| Methods inherited from class com.approximatrix.charting.render.colorscale.AbstractColorScale |
|---|
getColors, getColors |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.awt.Color FAILED_LOOKUP
protected java.util.Map<java.lang.Integer,java.awt.Color> map
| Constructor Detail |
|---|
public IndexedColorScale()
public IndexedColorScale(java.util.Map<java.lang.Integer,java.awt.Color> map)
map - a Map with Integer keys and Color values| Method Detail |
|---|
public void setColor(int i,
java.awt.Color val)
i - index of the added colorval - the Color valuepublic java.awt.Color getColor(double value)
value - the data space value
public java.awt.Color getColor(int value)
ColorScale
value - the data space value
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||