org.jfree.chart.renderer

Class GrayPaintScale

public class GrayPaintScale extends Object implements PaintScale, PublicCloneable, Serializable

A paint scale that returns shades of gray.

Since: 1.0.4

Constructor Summary
GrayPaintScale()
Creates a new GrayPaintScale 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
Objectclone()
Returns a clone of this GrayPaintScale instance.
booleanequals(Object obj)
Tests this GrayPaintScale instance for equality with an arbitrary object.
intgetAlpha()
Returns the alpha transparency that was specified in the constructor.
doublegetLowerBound()
Returns the lower bound.
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 new GrayPaintScale 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 if lowerBound is not less than upperBound.

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 if lowerBound is not less than upperBound, or alpha is not in the range 0 to 255.

Since: 1.0.13

Method Detail

clone

public Object clone()
Returns a clone of this GrayPaintScale instance.

Returns: A clone.

Throws: CloneNotSupportedException if there is a problem cloning this instance.

equals

public boolean equals(Object obj)
Tests this GrayPaintScale instance for equality with an arbitrary object. This method returns true if and only if:

Parameters: obj the object (null permitted).

Returns: A boolean.

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

getLowerBound

public double getLowerBound()
Returns the lower bound.

Returns: The lower bound.

See Also: getUpperBound

getPaint

public Paint getPaint(double value)
Returns a paint for the specified value.

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.

getUpperBound

public double getUpperBound()
Returns the upper bound.

Returns: The upper bound.

See Also: getLowerBound

hashCode

public int hashCode()
Returns a hash code for this instance.

Returns: A hash code.

Copyright © 2000-2009 by Object Refinery Limited. All Rights Reserved.