Package idare.imagenode.ColorManagement
Class ColorMap
- java.lang.Object
-
- idare.imagenode.ColorManagement.ColorMap
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ContinousColorMap
,DiscreteColorMap
public abstract class ColorMap extends Object implements Serializable
AColorMap
provides an interface to aDataSet
to obtain colors for specific values present in theDataSet
.- Author:
- Thomas Pfau
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ColorScale
cs
-
Constructor Summary
Constructors Constructor Description ColorMap(ColorScale cs)
Generate a newColorMap
using the providedColorScale
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Color
getColor(Comparable Value)
Get theColor
that is associated with theComparable
object provided.abstract JComponent
getColorMapComponent(JScrollPane Legend)
Get a Component that represents thisColorMap
ColorScalePane
getColorScalePane()
Get a visual representation of theColorScale
used in this map.Color
getDefaultColor()
static HashMap<Double,String>
getDisplayStrings(Double[] values)
Provides appropriate (not too long) representations of the values provided.abstract void
setColorScale(ColorScale scale)
Set a specificColorScale
to be used by thisColorMap
.
-
-
-
Field Detail
-
cs
protected ColorScale cs
-
-
Constructor Detail
-
ColorMap
public ColorMap(ColorScale cs)
Generate a newColorMap
using the providedColorScale
- Parameters:
cs
- TheColorScale
to use
-
-
Method Detail
-
getDisplayStrings
public static HashMap<Double,String> getDisplayStrings(Double[] values)
Provides appropriate (not too long) representations of the values provided. The input values have to be ordered from smallest to largest and it is assumed, that values[0] is the minimum and values[last] is the largest value.- Parameters:
values
- The double values for which to generate Display strings.- Returns:
- A map matching Strings to the provided Double values.
-
getDefaultColor
public Color getDefaultColor()
-
getColorScalePane
public ColorScalePane getColorScalePane()
Get a visual representation of theColorScale
used in this map. This is in fact, theColorScalePane
produced by the enclosedColorScale
- Returns:
- a
ColorScalePane
that can be displayed.
-
setColorScale
public abstract void setColorScale(ColorScale scale)
Set a specificColorScale
to be used by thisColorMap
. The Colormap will be reset to use the provided ColorScale.- Parameters:
scale
- theColorScale
to be used.
-
getColorMapComponent
public abstract JComponent getColorMapComponent(JScrollPane Legend)
Get a Component that represents thisColorMap
- Parameters:
Legend
- The legend this component is part of (to obtain resize events).- Returns:
- A
JComponent
that plots information about thisColorMap
-
getColor
public abstract Color getColor(Comparable Value)
Get theColor
that is associated with theComparable
object provided.- Parameters:
Value
- AComparable
value.- Returns:
- a
Color
-
-