public class LookupPaintScale extends java.lang.Object implements PaintScale, org.jfree.util.PublicCloneable, java.io.Serializable
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
LookupPaintScale.PaintItem
Stores the paint for a value.
|
| Modifier and Type | Field and Description |
|---|---|
private java.awt.Paint |
defaultPaint
The default paint.
|
private java.util.List |
lookupTable
The lookup table.
|
private double |
lowerBound
The lower bound.
|
(package private) static long |
serialVersionUID
For serialization.
|
private double |
upperBound
The upper bound.
|
| Constructor and Description |
|---|
LookupPaintScale()
Creates a new paint scale.
|
LookupPaintScale(double lowerBound,
double upperBound,
java.awt.Paint defaultPaint)
Creates a new paint scale with the specified default paint.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(double value,
java.awt.Paint paint)
Adds an entry to the lookup table.
|
void |
add(java.lang.Number value,
java.awt.Paint paint)
Deprecated.
Use
add(double, Paint). |
java.lang.Object |
clone()
Returns a clone of the instance.
|
boolean |
equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.
|
java.awt.Paint |
getDefaultPaint()
Returns the default paint (never
null). |
double |
getLowerBound()
Returns the lower bound.
|
java.awt.Paint |
getPaint(double value)
Returns the paint associated with the specified value.
|
double |
getUpperBound()
Returns the upper bound.
|
private void |
readObject(java.io.ObjectInputStream stream)
Provides serialization support.
|
private void |
writeObject(java.io.ObjectOutputStream stream)
Provides serialization support.
|
static final long serialVersionUID
private double lowerBound
private double upperBound
private transient java.awt.Paint defaultPaint
private java.util.List lookupTable
public LookupPaintScale()
public LookupPaintScale(double lowerBound,
double upperBound,
java.awt.Paint defaultPaint)
lowerBound - the lower bound.upperBound - the upper bound.defaultPaint - the default paint (null not
permitted).public java.awt.Paint getDefaultPaint()
null).public double getLowerBound()
getLowerBound in interface PaintScalegetUpperBound()public double getUpperBound()
getUpperBound in interface PaintScalegetLowerBound()public void add(java.lang.Number value,
java.awt.Paint paint)
add(double, Paint).n up
to but not including the next value in the table take on the specified
paint.value - the data value (null not permitted).paint - the paint.public void add(double value,
java.awt.Paint paint)
n up
to but not including the next value in the table take on the specified
paint.value - the data value.paint - the paint.public java.awt.Paint getPaint(double value)
getPaint in interface PaintScalevalue - the value.getDefaultPaint()public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object (null permitted).public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface org.jfree.util.PublicCloneableclone in class java.lang.Objectjava.lang.CloneNotSupportedException - if there is a problem cloning the
instance.private void writeObject(java.io.ObjectOutputStream stream)
throws java.io.IOException
stream - the output stream.java.io.IOException - if there is an I/O error.private void readObject(java.io.ObjectInputStream stream)
throws java.io.IOException,
java.lang.ClassNotFoundException
stream - the input stream.java.io.IOException - if there is an I/O error.java.lang.ClassNotFoundException - if there is a classpath problem.