Class ContinuousColorMapperTransform
- java.lang.Object
-
- org.biojava.nbio.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
-
-
Field Summary
Fields Modifier and Type Field Description protected ContinuousColorMappermapper
-
Constructor Summary
Constructors Constructor Description ContinuousColorMapperTransform(ContinuousColorMapper submapper)Creates a transform.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ColorgetColor(double value)Return the color corresponding to submapper.getColor(transform(value)).abstract doubletransform(double value)An arbitrary transform over reals
-
-
-
Field Detail
-
mapper
protected ContinuousColorMapper mapper
-
-
Constructor Detail
-
ContinuousColorMapperTransform
public ContinuousColorMapperTransform(ContinuousColorMapper submapper)
Creates a transform.- Parameters:
submapper- A color mapper which acts on the transformed input value.
-
-
Method Detail
-
getColor
public Color getColor(double value)
Return the color corresponding to submapper.getColor(transform(value)).- Specified by:
getColorin interfaceContinuousColorMapper- 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
-
-