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
AColorMapprovides an interface to aDataSetto obtain colors for specific values present in theDataSet.- Author:
- Thomas Pfau
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ColorScalecs
-
Constructor Summary
Constructors Constructor Description ColorMap(ColorScale cs)Generate a newColorMapusing the providedColorScale
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ColorgetColor(Comparable Value)Get theColorthat is associated with theComparableobject provided.abstract JComponentgetColorMapComponent(JScrollPane Legend)Get a Component that represents thisColorMapColorScalePanegetColorScalePane()Get a visual representation of theColorScaleused in this map.ColorgetDefaultColor()static HashMap<Double,String>getDisplayStrings(Double[] values)Provides appropriate (not too long) representations of the values provided.abstract voidsetColorScale(ColorScale scale)Set a specificColorScaleto be used by thisColorMap.
-
-
-
Field Detail
-
cs
protected ColorScale cs
-
-
Constructor Detail
-
ColorMap
public ColorMap(ColorScale cs)
Generate a newColorMapusing the providedColorScale- Parameters:
cs- TheColorScaleto 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 theColorScaleused in this map. This is in fact, theColorScalePaneproduced by the enclosedColorScale- Returns:
- a
ColorScalePanethat can be displayed.
-
setColorScale
public abstract void setColorScale(ColorScale scale)
Set a specificColorScaleto be used by thisColorMap. The Colormap will be reset to use the provided ColorScale.- Parameters:
scale- theColorScaleto 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
JComponentthat plots information about thisColorMap
-
getColor
public abstract Color getColor(Comparable Value)
Get theColorthat is associated with theComparableobject provided.- Parameters:
Value- AComparablevalue.- Returns:
- a
Color
-
-