Package org.jfree.chart.renderer
Class GrayPaintScale
- java.lang.Object
-
- org.jfree.chart.renderer.GrayPaintScale
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,PaintScale,PublicCloneable
public class GrayPaintScale extends java.lang.Object implements PaintScale, PublicCloneable, java.io.Serializable
A paint scale that returns shades of gray.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private intalphaThe alpha transparency (0-255).private doublelowerBoundThe lower bound.private doubleupperBoundThe upper bound.
-
Constructor Summary
Constructors Constructor Description GrayPaintScale()Creates a newGrayPaintScaleinstance 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 java.lang.Objectclone()Returns a clone of thisGrayPaintScaleinstance.booleanequals(java.lang.Object obj)Tests thisGrayPaintScaleinstance for equality with an arbitrary object.intgetAlpha()Returns the alpha transparency that was specified in the constructor.doublegetLowerBound()Returns the lower bound.java.awt.PaintgetPaint(double value)Returns a paint for the specified value.doublegetUpperBound()Returns the upper bound.inthashCode()Returns a hash code for this instance.
-
-
-
Constructor Detail
-
GrayPaintScale
public GrayPaintScale()
Creates a newGrayPaintScaleinstance 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:
java.lang.IllegalArgumentException- iflowerBoundis 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:
java.lang.IllegalArgumentException- iflowerBoundis not less thanupperBound, oralphais not in the range 0 to 255.
-
-
Method Detail
-
getLowerBound
public double getLowerBound()
Returns the lower bound.- Specified by:
getLowerBoundin interfacePaintScale- Returns:
- The lower bound.
- See Also:
getUpperBound()
-
getUpperBound
public double getUpperBound()
Returns the upper bound.- Specified by:
getUpperBoundin 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).
-
getPaint
public java.awt.Paint getPaint(double value)
Returns a paint for the specified value.- Specified by:
getPaintin 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(java.lang.Object obj)
Tests thisGrayPaintScaleinstance for equality with an arbitrary object. This method returnstrueif and only if:objis notnull;objis an instance ofGrayPaintScale;
- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
Returns a hash code for this instance.- Overrides:
hashCodein classjava.lang.Object- Returns:
- A hash code.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of thisGrayPaintScaleinstance.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classjava.lang.Object- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException- if there is a problem cloning this instance.
-
-