Class DiscreteColorMap
- java.lang.Object
-
- idare.imagenode.ColorManagement.ColorMap
-
- idare.imagenode.ColorManagement.ColorMapTypes.DiscreteColorMap
-
- All Implemented Interfaces:
Serializable
public class DiscreteColorMap extends ColorMap
A Colormap that can provide colors for a discrete number of values (i.e. a limited well defined number of items) The values can be anything comparable, as long as they are of the same type.- Author:
- Thomas Pfau
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DiscreteColorMap(Collection<Comparable> values, ColorScale cs)
Generate a Colormap based on a set of values and a given colorscale.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Color
getColor(Comparable Value)
Get theColor
that is associated with theComparable
object provided.JComponent
getColorMapComponent(JScrollPane Legend)
Get a Component that represents thisColorMap
void
setColorScale(ColorScale scale)
Set a specificColorScale
to be used by thisColorMap
.-
Methods inherited from class idare.imagenode.ColorManagement.ColorMap
getColorScalePane, getDefaultColor, getDisplayStrings
-
-
-
-
Constructor Detail
-
DiscreteColorMap
public DiscreteColorMap(Collection<Comparable> values, ColorScale cs)
Generate a Colormap based on a set of values and a given colorscale. The Values will be used in the order provided by the collection iterator. The map will only provide valid colors for the values provided during setup.- Parameters:
values
- the discrete values to usecs
- TheColorScale
to use
-
-
Method Detail
-
getColor
public Color getColor(Comparable Value)
Description copied from class:ColorMap
Get theColor
that is associated with theComparable
object provided.- Specified by:
getColor
in classColorMap
- Parameters:
Value
- AComparable
value.- Returns:
- a
Color
-
setColorScale
public void setColorScale(ColorScale scale)
Description copied from class:ColorMap
Set a specificColorScale
to be used by thisColorMap
. The Colormap will be reset to use the provided ColorScale.- Specified by:
setColorScale
in classColorMap
- Parameters:
scale
- theColorScale
to be used.
-
getColorMapComponent
public JComponent getColorMapComponent(JScrollPane Legend)
Description copied from class:ColorMap
Get a Component that represents thisColorMap
- Specified by:
getColorMapComponent
in classColorMap
- Parameters:
Legend
- The legend this component is part of (to obtain resize events).- Returns:
- A
JComponent
that plots information about thisColorMap
-
-