Class ColorPaintScale

java.lang.Object
net.simplace.ui.jfreechart.style.ColorPaintScale
All Implemented Interfaces:
Serializable, Cloneable, org.jfree.chart.renderer.PaintScale, org.jfree.util.PublicCloneable

public class ColorPaintScale extends Object implements org.jfree.chart.renderer.PaintScale, org.jfree.util.PublicCloneable, Serializable
A paint scale that interpolates linearly between the colors of the lower and the upper bound (adapted from the JFreeChart class GrayPaintScale).
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    ColorPaintScale(Color lowerBoundColor, double lowerBound, Color upperBoundColor, double upperBound)
    Creates a new paint scale for values in the specified range.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a clone of this ColorPaintScale instance.
    boolean
    Tests this ColorPaintScale instance for equality with an arbitrary object.
    double
    Returns the lower bound.
    getPaint(double value)
    Returns a paint for the specified value.
    double
    Returns the upper bound.
    int
     

    Methods inherited from class Object

    finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ColorPaintScale

      public ColorPaintScale(Color lowerBoundColor, double lowerBound, Color upperBoundColor, double upperBound)
      Creates a new paint scale for values in the specified range.
      Parameters:
      lowerBoundColor - color of the lower bound
      lowerBound - the lower bound
      upperBoundColor - color of the upper bound
      upperBound - the upper bound
      Throws:
      IllegalArgumentException - if lowerBound is not less than upperBound.
  • Method Details

    • getLowerBound

      public double getLowerBound()
      Returns the lower bound.
      Specified by:
      getLowerBound in interface org.jfree.chart.renderer.PaintScale
      Returns:
      The lower bound.
      See Also:
    • getUpperBound

      public double getUpperBound()
      Returns the upper bound.
      Specified by:
      getUpperBound in interface org.jfree.chart.renderer.PaintScale
      Returns:
      The upper bound.
      See Also:
    • getPaint

      public Paint getPaint(double value)
      Returns a paint for the specified value.
      Specified by:
      getPaint in interface org.jfree.chart.renderer.PaintScale
      Parameters:
      value - the value (values outside the range are clipped to the bounds).
      Returns:
      A paint for the specified value.
    • equals

      public boolean equals(Object obj)
      Tests this ColorPaintScale instance for equality with an arbitrary object. This method returns true if and only if:
      • obj is not null;
      • obj is an instance of ColorPaintScale;
      • both have the same bounds and equal colors.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object (null permitted).
      Returns:
      A boolean.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Returns:
      a hash code consistent with equals(Object)
    • clone

      public Object clone() throws CloneNotSupportedException
      Returns a clone of this ColorPaintScale instance.
      Specified by:
      clone in interface org.jfree.util.PublicCloneable
      Overrides:
      clone in class Object
      Returns:
      A clone.
      Throws:
      CloneNotSupportedException - if there is a problem cloning this instance.