## org.ascape.util.vis
Class ColorFeatureGradiated

    java.lang.Object
      org.ascape.util.vis.ColorFeatureConcrete
          org.ascape.util.vis.ColorFeatureGradiated

All Implemented Interfaces:
  java.lang.Cloneable, HasName, ColorFeature

Direct Known Subclasses:
  ColorFeatureGradiatedIndex

    public class ColorFeatureGradiated

extends ColorFeatureConcrete

A class for displaying a gradiated color whose intensity is determined by the supplied UnitIntervalDataPoint. The data point is bracketed, so values outside of the range 0.0 - 1.0 will be treeated as minimum and maximum respectivly.

Since:
  1.0
Version:
  1.2
Author:
  Miles Parker

Field Summary
`protected float` `blueBase` The base value of the blue component of this color.
`protected float` `blueMaximum` The maximum value of the blue component of this color.
`protected float` `blueMinimum` The minimum value of the blue component of this color.
`protected UnitIntervalDataPoint` `dataPoint` The unit interval data point used to calculate the gradiated color.
`protected float` `greenBase` The base value of the green component of this color.
`protected float` `greenMaximum` The maximum value of the green component of this color.
`protected float` `greenMinimum` The minimum value of the green component of this color.
`protected float` `redBase` The base value of the red component of this color.
`protected float` `redMaximum` The maximum value of the red component of this color.
`protected float` `redMinimum` The minimum value of the red component of this color.

Fields inherited from class org.ascape.util.vis.ColorFeatureConcrete
`colorCache, name`

Fields inherited from interface org.ascape.util.vis.ColorFeature
`BLACK, BLUE, CYAN, DARK_BLUE, DARK_GRAY, DARK_GREEN, DARK_MAGENTA, DARK_RED, DARK_YELLOW, DEFAULT_BG, GRAY, GREEN, HIGHLIGHT_AGENT_COLOR, LIGHT_GRAY, MAGENTA, ORANGE, RED, WHITE, YELLOW`

Constructor Summary
`ColorFeatureGradiated()` Constructs a ColorFeatureGradiated.
`ColorFeatureGradiated(org.eclipse.swt.graphics.Color maximumColor, UnitIntervalDataPoint dataPoint)` Constructs a ColorFeatureGradiated with the supplied unit interval and maximum color.
`ColorFeatureGradiated(java.lang.String name)` Constructs the gradiated color feature with the supplied name.
`ColorFeatureGradiated(java.lang.String name, org.eclipse.swt.graphics.Color maximumColor, org.eclipse.swt.graphics.Color minimumColor, UnitIntervalDataPoint dataPoint)` Constructs a ColorFeatureGradiated with the supplied name, maximum color, and unit interval.
`ColorFeatureGradiated(java.lang.String name, org.eclipse.swt.graphics.Color maximumColor, UnitIntervalDataPoint dataPoint)` Constructs a ColorFeatureGradiated with the supplied name, maximum color, and unit interval.

Method Summary
`java.lang.Object` `clone()` Clones this feature.
`org.eclipse.swt.graphics.Color` `getColor(java.lang.Object object)` Returns maximum color at intensity defined by the data point.
`org.eclipse.swt.graphics.Color` `getColor(java.lang.Object object, float alpha)` Returns maximum color at intensity defined by the data point.
`UnitIntervalDataPoint` `getDataPoint()` Returns the data point used to calculate color.
`java.lang.String` `getName()` Returns the name of the gradiated color feature.
`void` `setDataPoint(UnitIntervalDataPoint dataPoint)` Sets a unit data point that will return some number between 0.0 and 1.0
`void` `setMaximumColor(org.eclipse.swt.graphics.Color valueColor)` Sets the color at maximum intensity; that is, the color that would be returned if the unit value were 1.0.
`void` `setMinimumColor(org.eclipse.swt.graphics.Color valueColor)` Sets the color at minimum intensity; that is, the color that would be returned if the unit value were 0.0.

Methods inherited from class org.ascape.util.vis.ColorFeatureConcrete
`adjustBrightness, create, create, create, create, createHSB, createRandom, setName`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### redMinimum

    protected float redMinimum

  The minimum value of the red component of this color.

### greenMinimum

    protected float greenMinimum

  The minimum value of the green component of this color.

### blueMinimum

    protected float blueMinimum

  The minimum value of the blue component of this color.

### redMaximum

    protected float redMaximum

  The maximum value of the red component of this color.

### greenMaximum

    protected float greenMaximum

  The maximum value of the green component of this color.

### blueMaximum

    protected float blueMaximum

  The maximum value of the blue component of this color.

### redBase

    protected float redBase

  The base value of the red component of this color.

### greenBase

    protected float greenBase

  The base value of the green component of this color.

### blueBase

    protected float blueBase

  The base value of the blue component of this color.

### dataPoint

    protected UnitIntervalDataPoint dataPoint

  The unit interval data point used to calculate the gradiated color.

Constructor Detail

### ColorFeatureGradiated

    public ColorFeatureGradiated()

  Constructs a ColorFeatureGradiated.

### ColorFeatureGradiated

    public ColorFeatureGradiated(java.lang.String name)

  Constructs the gradiated color feature with the supplied name.

  Parameters:
    `name` - the name of this draw feature

### ColorFeatureGradiated

    public ColorFeatureGradiated(org.eclipse.swt.graphics.Color maximumColor,
                                 UnitIntervalDataPoint dataPoint)

  Constructs a ColorFeatureGradiated with the supplied unit interval and maximum color.

  Parameters:
    `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

### ColorFeatureGradiated

    public ColorFeatureGradiated(java.lang.String name,
                                 org.eclipse.swt.graphics.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

### ColorFeatureGradiated

    public ColorFeatureGradiated(java.lang.String name,
                                 org.eclipse.swt.graphics.Color maximumColor,
                                 org.eclipse.swt.graphics.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

### getDataPoint

    public UnitIntervalDataPoint getDataPoint()

  Returns the data point used to calculate color. (As an alternative to setting this value, you may override with a method returning a data point.)

### setDataPoint

    public void setDataPoint(UnitIntervalDataPoint dataPoint)

  Sets a unit data point that will return some number between 0.0 and 1.0

### getName

    public java.lang.String getName()

  Returns the name of the gradiated color feature. Override to provide a different name.

  Specified by:
    `getName` in interface `HasName`
  Overrides:
    `getName` in class `ColorFeatureConcrete`

### getColor

    public org.eclipse.swt.graphics.Color getColor(java.lang.Object object)

  Returns maximum color at intensity defined by the data point.

  Specified by:
    `getColor` in interface `ColorFeature`
  Specified by:
    `getColor` in class `ColorFeatureConcrete`
  Parameters:
    `object` - the object to get a color from.

### getColor

    public org.eclipse.swt.graphics.Color getColor(java.lang.Object object,
                                                   float alpha)

  Returns maximum color at intensity defined by the data point.

  Parameters:
    `object` - the object to get a color from.

### setMinimumColor

    public void setMinimumColor(org.eclipse.swt.graphics.Color valueColor)

  Sets the color at minimum intensity; that is, the color that would be returned if the unit value were 0.0.

### setMaximumColor

    public void setMaximumColor(org.eclipse.swt.graphics.Color valueColor)

  Sets the color at maximum intensity; that is, the color that would be returned if the unit value were 1.0.

### clone

    public java.lang.Object clone()

  Clones this feature.

  Overrides:
    `clone` in class `java.lang.Object`