org.ascape.util.vis
Class ColorFeatureGradiatedIndex
java.lang.Object
org.ascape.util.vis.ColorFeatureConcrete
org.ascape.util.vis.ColorFeatureGradiated
org.ascape.util.vis.ColorFeatureGradiatedIndex
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, HasName, ColorFeature
public class ColorFeatureGradiatedIndex
- extends ColorFeatureGradiated
A class for displaying a gradiated color whose intensity is determined by the
supplied UnitIntervalDataPoint. This implementation keeps an array of one thousand
colors that are created dynamically and then referred to as needed, improving
performance significantly over creating new colors for each value.
Important: To obtain maximum performance, the value is not bracketed,
that is, this class uses the 'raw' value obtained from the UnitIntervalDataPoint.
If that value is not between 0.0-1.0 inclusive, a RuntimeException
exception will be thrown. If you are not sure that your value will always
be clean, use ColorFeatureGradiated. If there is demand, I'll create a version of
this class that does use the bracketed value.
- Version:
- 1.9.1
- Author:
- Miles Parker
- See Also:
- Serialized Form
Method Summary |
java.awt.Color |
getColor(java.lang.Object object)
Returns maximum color at intensity defined by the data point. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ColorFeatureGradiatedIndex
public ColorFeatureGradiatedIndex(java.lang.String name)
ColorFeatureGradiatedIndex
public ColorFeatureGradiatedIndex(java.lang.String name,
java.awt.Color maximumColor,
UnitIntervalDataPoint dataPoint)
- Constructs a ColorFeatureGradiated with the supplied name, maximum color, and unit interval.
- Parameters:
name
- the name of this color featuremaximumColor
- the color to be returned at unit maximumdataPoint
- a unit interval data point (0..1) providing the relative intensity of a color for a given object
ColorFeatureGradiatedIndex
public ColorFeatureGradiatedIndex(java.lang.String name,
java.awt.Color maximumColor,
java.awt.Color minimumColor,
UnitIntervalDataPoint dataPoint)
- Constructs a ColorFeatureGradiated with the supplied name, maximum color, and unit interval.
- Parameters:
name
- the name of this color featureminimumColor
- the color to be returned at unit minimummaximumColor
- the color to be returned at unit maximumdataPoint
- a unit interval data point (0..1) providing the relative intensity of a color for a given object
getColor
public java.awt.Color getColor(java.lang.Object object)
- Returns maximum color at intensity defined by the data point.
- Specified by:
getColor
in interface ColorFeature
- Overrides:
getColor
in class ColorFeatureGradiated
- Parameters:
object
- the object to get a color from.
Copyright © 1998-2008 The Brookings Institution, NuTech Solutions, Metascape, LLC All Rights Reserved.