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
ConstructorsConstructorDescriptionColorPaintScale(Color lowerBoundColor, double lowerBound, Color upperBoundColor, double upperBound) Creates a new paint scale for values in the specified range. -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a clone of thisColorPaintScaleinstance.booleanTests thisColorPaintScaleinstance for equality with an arbitrary object.doubleReturns the lower bound.getPaint(double value) Returns a paint for the specified value.doubleReturns the upper bound.inthashCode()
-
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 boundlowerBound- the lower boundupperBoundColor- color of the upper boundupperBound- the upper bound- Throws:
IllegalArgumentException- iflowerBoundis not less thanupperBound.
-
-
Method Details
-
getLowerBound
public double getLowerBound()Returns the lower bound.- Specified by:
getLowerBoundin interfaceorg.jfree.chart.renderer.PaintScale- Returns:
- The lower bound.
- See Also:
-
getUpperBound
public double getUpperBound()Returns the upper bound.- Specified by:
getUpperBoundin interfaceorg.jfree.chart.renderer.PaintScale- Returns:
- The upper bound.
- See Also:
-
getPaint
Returns a paint for the specified value.- Specified by:
getPaintin interfaceorg.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
Tests thisColorPaintScaleinstance for equality with an arbitrary object. This method returnstrueif and only if:objis notnull;objis an instance ofColorPaintScale;- both have the same bounds and equal colors.
-
hashCode
public int hashCode()- Overrides:
hashCodein classObject- Returns:
- a hash code consistent with
equals(Object)
-
clone
Returns a clone of thisColorPaintScaleinstance.- Specified by:
clonein interfaceorg.jfree.util.PublicCloneable- Overrides:
clonein classObject- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if there is a problem cloning this instance.
-