Package org.jfree.chart.renderer
Class LookupPaintScale
java.lang.Object
org.jfree.chart.renderer.LookupPaintScale
- All Implemented Interfaces:
Serializable
,Cloneable
,PaintScale
,PublicCloneable
A paint scale that uses a lookup table to associate paint instances
with data value ranges.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
Stores the paint for a value. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new paint scale.LookupPaintScale
(double lowerBound, double upperBound, Paint defaultPaint) Creates a new paint scale with the specified default paint. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an entry to the lookup table.clone()
Returns a clone of the instance.boolean
Tests this instance for equality with an arbitrary object.Returns the default paint (nevernull
).double
Returns the lower bound.getPaint
(double value) Returns the paint associated with the specified value.double
Returns the upper bound.private void
readObject
(ObjectInputStream stream) Provides serialization support.private void
writeObject
(ObjectOutputStream stream) Provides serialization support.
-
Field Details
-
serialVersionUID
static final long serialVersionUIDFor serialization.- See Also:
-
lowerBound
private double lowerBoundThe lower bound. -
upperBound
private double upperBoundThe upper bound. -
defaultPaint
The default paint. -
lookupTable
The lookup table.
-
-
Constructor Details
-
LookupPaintScale
public LookupPaintScale()Creates a new paint scale. -
LookupPaintScale
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 Details
-
getDefaultPaint
Returns the default paint (nevernull
).- Returns:
- The default paint.
-
getLowerBound
public double getLowerBound()Returns the lower bound.- Specified by:
getLowerBound
in interfacePaintScale
- Returns:
- The lower bound.
- See Also:
-
getUpperBound
public double getUpperBound()Returns the upper bound.- Specified by:
getUpperBound
in interfacePaintScale
- Returns:
- The upper bound.
- See Also:
-
add
Adds an entry to the lookup table. Any values fromn
up to but not including the next value in the table take on the specifiedPaint
.- Parameters:
value
- the data value.paint
- the paint.
-
getPaint
Returns the paint associated with the specified value.- Specified by:
getPaint
in interfacePaintScale
- Parameters:
value
- the value.- Returns:
- The paint.
- See Also:
-
equals
Tests this instance for equality with an arbitrary object. -
clone
Returns a clone of the instance.- Specified by:
clone
in interfacePublicCloneable
- Overrides:
clone
in classObject
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- if there is a problem cloning the instance.
-
writeObject
Provides serialization support.- Parameters:
stream
- the output stream.- Throws:
IOException
- if there is an I/O error.
-
readObject
Provides serialization support.- Parameters:
stream
- the input stream.- Throws:
IOException
- if there is an I/O error.ClassNotFoundException
- if there is a classpath problem.
-