Package org.jfree.chart.renderer
Class LookupPaintScale
- java.lang.Object
-
- org.jfree.chart.renderer.LookupPaintScale
-
- All Implemented Interfaces:
Serializable
,Cloneable
,PaintScale
,org.jfree.util.PublicCloneable
public class LookupPaintScale extends Object implements PaintScale, org.jfree.util.PublicCloneable, Serializable
A paint scale that uses a lookup table to associate paint instances with data value ranges.- Since:
- 1.0.4
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(double value, Paint paint)
Adds an entry to the lookup table.void
add(Number value, Paint paint)
Deprecated.Useadd(double, Paint)
.Object
clone()
Returns a clone of the instance.boolean
equals(Object obj)
Tests this instance for equality with an arbitrary object.Paint
getDefaultPaint()
Returns the default paint (nevernull
).double
getLowerBound()
Returns the lower bound.Paint
getPaint(double value)
Returns the paint associated with the specified value.double
getUpperBound()
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
-
getDefaultPaint
public Paint 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()
-
getUpperBound
public double getUpperBound()
Returns the upper bound.- Specified by:
getUpperBound
in interfacePaintScale
- Returns:
- The upper bound.
- See Also:
getLowerBound()
-
add
public void add(Number value, Paint paint)
Deprecated.Useadd(double, Paint)
.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 (null
not permitted).paint
- the paint.
-
add
public void add(double value, Paint paint)
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.- Since:
- 1.0.6
-
getPaint
public Paint getPaint(double value)
Returns the paint associated with the specified value.- Specified by:
getPaint
in interfacePaintScale
- Parameters:
value
- the value.- Returns:
- The paint.
- See Also:
getDefaultPaint()
-
equals
public boolean equals(Object obj)
Tests this instance for equality with an arbitrary object.
-
clone
public Object clone() throws CloneNotSupportedException
Returns a clone of the instance.- Specified by:
clone
in interfaceorg.jfree.util.PublicCloneable
- Overrides:
clone
in classObject
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- if there is a problem cloning the instance.
-
-