public class GradientMapper extends Object implements ContinuousColorMapper, Map<Double,Color>
Modifier and Type | Field and Description |
---|---|
static int |
BLACK_WHITE_GRADIENT |
static int |
RAINBOW_GRADIENT |
static int |
RAINBOW_INTENSITY_GRADIENT |
static int |
RED_BLUE_GRADIENT |
static int |
WHITE_BLACK_GRADIENT |
Constructor and Description |
---|
GradientMapper() |
GradientMapper(Color negInf,
Color posInf) |
GradientMapper(Color negInf,
Color posInf,
ColorSpace cspace) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all finite endpoints
|
boolean |
containsKey(Object position) |
boolean |
containsValue(Object color) |
Set<Map.Entry<Double,Color>> |
entrySet() |
Color |
get(Object position) |
Color |
getColor(double value) |
static GradientMapper |
getGradientMapper(int gradientType,
double min,
double max)
Constructs a gradientMapper to draw one of the pre-defined gradients
For example,
GradientMapper.getGradientMapper(GradientMapper.RAINBOW_GRADIENT, 0, 10)
|
ColorInterpolator |
getInterpolator() |
boolean |
isEmpty() |
Set<Double> |
keySet() |
static void |
main(String[] args) |
Color |
put(Double position,
Color color)
Adds a gradient endpoint at the specified position.
|
void |
putAll(Map<? extends Double,? extends Color> m) |
Color |
remove(Object position) |
void |
setInterpolator(ColorInterpolator interpolator) |
int |
size() |
Collection<Color> |
values() |
public static final int BLACK_WHITE_GRADIENT
public static final int WHITE_BLACK_GRADIENT
public static final int RED_BLUE_GRADIENT
public static final int RAINBOW_GRADIENT
public static final int RAINBOW_INTENSITY_GRADIENT
public GradientMapper()
public GradientMapper(Color negInf, Color posInf, ColorSpace cspace)
public static GradientMapper getGradientMapper(int gradientType, double min, double max)
gradientType
- One of the gradient types, eg GradientMapper.BLACK_WHITE_GRADIENTmin
- Start of the gradientmax
- End of the gradientpublic Color getColor(double value)
getColor
in interface ContinuousColorMapper
value
- ContinuousColorMapper.getColor(double)
public void clear()
clear
in interface Map<Double,Color>
Map.clear()
public boolean containsKey(Object position)
containsKey
in interface Map<Double,Color>
position
- Map.containsKey(java.lang.Object)
public boolean containsValue(Object color)
containsValue
in interface Map<Double,Color>
color
- Map.containsValue(java.lang.Object)
public Set<Map.Entry<Double,Color>> entrySet()
entrySet
in interface Map<Double,Color>
Map.entrySet()
public Color get(Object position)
get
in interface Map<Double,Color>
position
- Map.get(java.lang.Object)
public boolean isEmpty()
isEmpty
in interface Map<Double,Color>
Map.isEmpty()
public Set<Double> keySet()
keySet
in interface Map<Double,Color>
Map.keySet()
public Color put(Double position, Color color)
put
in interface Map<Double,Color>
position
- The endpoint position. May be Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY for endpoints.color
- Map.put(java.lang.Object, java.lang.Object)
public void putAll(Map<? extends Double,? extends Color> m)
putAll
in interface Map<Double,Color>
m
- Map.putAll(java.util.Map)
public Color remove(Object position)
remove
in interface Map<Double,Color>
position
- Map.remove(java.lang.Object)
public int size()
size
in interface Map<Double,Color>
Map.size()
public Collection<Color> values()
values
in interface Map<Double,Color>
Map.values()
public ColorInterpolator getInterpolator()
public void setInterpolator(ColorInterpolator interpolator)
interpolator
- the interpolator to setpublic static void main(String[] args)
args
- Copyright © 2000–2016 BioJava. All rights reserved.