org.ascape.util.vis
Class ColorFeatureGradiatedIndex

java.lang.Object
  extended by org.ascape.util.vis.ColorFeatureConcrete
      extended by org.ascape.util.vis.ColorFeatureGradiated
          extended by 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

Field Summary
 
Fields inherited from class org.ascape.util.vis.ColorFeatureGradiated
blueBase, blueMaximum, blueMinimum, dataPoint, greenBase, greenMaximum, greenMinimum, redBase, redMaximum, redMinimum
 
Fields inherited from class org.ascape.util.vis.ColorFeatureConcrete
name
 
Constructor Summary
ColorFeatureGradiatedIndex(java.lang.String name)
           
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.
ColorFeatureGradiatedIndex(java.lang.String name, java.awt.Color maximumColor, UnitIntervalDataPoint dataPoint)
          Constructs a ColorFeatureGradiated with the supplied name, maximum color, and unit interval.
 
Method Summary
 java.awt.Color getColor(java.lang.Object object)
          Returns maximum color at intensity defined by the data point.
 
Methods inherited from class org.ascape.util.vis.ColorFeatureGradiated
clone, getColor, getDataPoint, getName, setDataPoint, setMaximumColor, setMinimumColor
 
Methods inherited from class org.ascape.util.vis.ColorFeatureConcrete
setName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 feature
maximumColor - the color to be returned at unit maximum
dataPoint - 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 feature
minimumColor - the color to be returned at unit minimum
maximumColor - the color to be returned at unit maximum
dataPoint - a unit interval data point (0..1) providing the relative intensity of a color for a given object
Method Detail

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.