org.biojava.bio.structure.gui.util.color
Class ContinuousColorMapperTransform
java.lang.Object
org.biojava.bio.structure.gui.util.color.ContinuousColorMapperTransform
- All Implemented Interfaces:
- ContinuousColorMapper
- Direct Known Subclasses:
- LogColorMapper, SqrtColorMapper
public abstract class ContinuousColorMapperTransform
- extends Object
- implements ContinuousColorMapper
Maps colors by performing a transform of the input data and then passing
the transformed value to a ContinuousColorMapper for rendering.
For instance, to map [10^0, 10^10] to a rainbow gradient, use
new LogColorMapper(GradientMapper.getGradientMapper(GradientMapper.RAINBOW_GRADIENT, 0, 10))
- Author:
- Spencer Bliven
Method Summary |
Color |
getColor(double value)
Return the color corresponding to submapper.getColor(transform(value)). |
abstract double |
transform(double value)
An arbitrary transform over reals |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mapper
protected ContinuousColorMapper mapper
ContinuousColorMapperTransform
public ContinuousColorMapperTransform(ContinuousColorMapper submapper)
- Creates a transform.
- Parameters:
submapper
- A color mapper which acts on the transformed input value.
getColor
public Color getColor(double value)
- Return the color corresponding to submapper.getColor(transform(value)).
- Specified by:
getColor
in interface ContinuousColorMapper
- Parameters:
value
- Value to be mapped
- Returns:
- color corresponding to transform(value)
- See Also:
ContinuousColorMapper.getColor(double)
transform
public abstract double transform(double value)
- An arbitrary transform over reals
- Parameters:
the
- input value
- Returns:
- the transformed value