org.jfree.chart.renderer

Class LookupPaintScale

public class LookupPaintScale extends Object implements PaintScale, PublicCloneable, Serializable

A paint scale that uses a lookup table to associate paint instances with data value ranges.

Since: 1.0.4

Constructor Summary
LookupPaintScale()
Creates a new paint scale.
LookupPaintScale(double lowerBound, double upperBound, Paint defaultPaint)
Creates a new paint scale with the specified default paint.
Method Summary
voidadd(Number value, Paint paint)
Adds an entry to the lookup table.
voidadd(double value, Paint paint)
Adds an entry to the lookup table.
Objectclone()
Returns a clone of the instance.
booleanequals(Object obj)
Tests this instance for equality with an arbitrary object.
PaintgetDefaultPaint()
Returns the default paint (never null).
doublegetLowerBound()
Returns the lower bound.
PaintgetPaint(double value)
Returns the paint associated with the specified value.
doublegetUpperBound()
Returns the upper bound.

Constructor Detail

LookupPaintScale

public LookupPaintScale()
Creates a new paint scale.

LookupPaintScale

public LookupPaintScale(double lowerBound, double upperBound, Paint defaultPaint)
Creates a new paint scale with the specified default paint.

Parameters: lowerBound the lower bound. upperBound the upper bound. defaultPaint the default paint (null not permitted).

Method Detail

add

public void add(Number value, Paint paint)

Deprecated: Use LookupPaintScale.

Adds an entry to the lookup table. Any values from n up to but not including the next value in the table take on the specified paint.

Parameters: value the data value (null not permitted). paint the paint.

add

public void add(double value, Paint paint)
Adds an entry to the lookup table. Any values from n up to but not including the next value in the table take on the specified paint.

Parameters: value the data value. paint the paint.

Since: 1.0.6

clone

public Object clone()
Returns a clone of the instance.

Returns: A clone.

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

equals

public boolean equals(Object obj)
Tests this instance for equality with an arbitrary object.

Parameters: obj the object (null permitted).

Returns: A boolean.

getDefaultPaint

public Paint getDefaultPaint()
Returns the default paint (never null).

Returns: The default paint.

getLowerBound

public double getLowerBound()
Returns the lower bound.

Returns: The lower bound.

See Also: getUpperBound

getPaint

public Paint getPaint(double value)
Returns the paint associated with the specified value.

Parameters: value the value.

Returns: The paint.

See Also: getDefaultPaint

getUpperBound

public double getUpperBound()
Returns the upper bound.

Returns: The upper bound.

See Also: getLowerBound

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