Package org.jfree.chart.renderer
Class GrayPaintScale
- java.lang.Object
-
- org.jfree.chart.renderer.GrayPaintScale
-
- All Implemented Interfaces:
Serializable
,Cloneable
,PaintScale
,org.jfree.util.PublicCloneable
public class GrayPaintScale extends Object implements PaintScale, org.jfree.util.PublicCloneable, Serializable
A paint scale that returns shades of gray.- Since:
- 1.0.4
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GrayPaintScale()
Creates a newGrayPaintScale
instance with default values.GrayPaintScale(double lowerBound, double upperBound)
Creates a new paint scale for values in the specified range.GrayPaintScale(double lowerBound, double upperBound, int alpha)
Creates a new paint scale for values in the specified range.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
Returns a clone of thisGrayPaintScale
instance.boolean
equals(Object obj)
Tests thisGrayPaintScale
instance for equality with an arbitrary object.int
getAlpha()
Returns the alpha transparency that was specified in the constructor.double
getLowerBound()
Returns the lower bound.Paint
getPaint(double value)
Returns a paint for the specified value.double
getUpperBound()
Returns the upper bound.int
hashCode()
Returns a hash code for this instance.
-
-
-
Constructor Detail
-
GrayPaintScale
public GrayPaintScale()
Creates a newGrayPaintScale
instance with default values.
-
GrayPaintScale
public GrayPaintScale(double lowerBound, double upperBound)
Creates a new paint scale for values in the specified range.- Parameters:
lowerBound
- the lower bound.upperBound
- the upper bound.- Throws:
IllegalArgumentException
- iflowerBound
is not less thanupperBound
.
-
GrayPaintScale
public GrayPaintScale(double lowerBound, double upperBound, int alpha)
Creates a new paint scale for values in the specified range.- Parameters:
lowerBound
- the lower bound.upperBound
- the upper bound.alpha
- the alpha transparency (0-255).- Throws:
IllegalArgumentException
- iflowerBound
is not less thanupperBound
, oralpha
is not in the range 0 to 255.- Since:
- 1.0.13
-
-
Method Detail
-
getLowerBound
public double getLowerBound()
Returns the lower bound.- Specified by:
getLowerBound
in interfacePaintScale
- Returns:
- The lower bound.
- See Also:
getUpperBound()
-
getUpperBound
public double getUpperBound()
Returns the upper bound.- Specified by:
getUpperBound
in interfacePaintScale
- Returns:
- The upper bound.
- See Also:
getLowerBound()
-
getAlpha
public int getAlpha()
Returns the alpha transparency that was specified in the constructor.- Returns:
- The alpha transparency (in the range 0 to 255).
- Since:
- 1.0.13
-
getPaint
public Paint getPaint(double value)
Returns a paint for the specified value.- Specified by:
getPaint
in interfacePaintScale
- Parameters:
value
- the value (must be within the range specified by the lower and upper bounds for the scale).- Returns:
- A paint for the specified value.
-
equals
public boolean equals(Object obj)
Tests thisGrayPaintScale
instance for equality with an arbitrary object. This method returnstrue
if and only if:obj
is notnull
;obj
is an instance ofGrayPaintScale
;
-
hashCode
public int hashCode()
Returns a hash code for this instance.
-
clone
public Object clone() throws CloneNotSupportedException
Returns a clone of thisGrayPaintScale
instance.- Specified by:
clone
in interfaceorg.jfree.util.PublicCloneable
- Overrides:
clone
in classObject
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- if there is a problem cloning this instance.
-
-