com.ijchart.xychart.render.paint
Class LookupPaintScale

java.lang.Object
  extended by com.ijchart.xychart.render.paint.LookupPaintScale
All Implemented Interfaces:
IPaintScale, java.io.Serializable, java.lang.Cloneable

public class LookupPaintScale
extends java.lang.Object
implements IPaintScale, java.io.Serializable, java.lang.Cloneable

Title: IJChart

Description: a chart library for the Java(tm) platform.

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

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Field Summary
static java.awt.Paint DEFAULT_PAINT
           The default static paint object.
 
Fields inherited from interface com.ijchart.xychart.render.paint.IPaintScale
DEFAULT_LOWER_BOUND, DEFAULT_UPPER_BOUND
 
Constructor Summary
LookupPaintScale()
           The default constructor.
LookupPaintScale(double lowerBound, double upperBound)
           The constructor.
LookupPaintScale(double lowerBound, double upperBound, java.awt.Paint defaultPaint)
           The constructor.
LookupPaintScale(double lowerBound, double upperBound, java.awt.Paint defaultPaint, java.lang.String[] legendSymbols)
           The constructor.
 
Method Summary
 void add(double value, java.awt.Paint paint)
           Adds an value and a paint object to lookup table.
 java.lang.Object clone()
           Creates and returns a copy of this object.
 boolean equals(java.lang.Object obj)
           Tests this instance for equality with an arbitrary object.
 java.awt.Paint getDefaultPaint()
           Returns the default paint.
 java.lang.String[] getLegendSymbols()
           Returns the symbols for drawing legend shape.
 double getLowerBound()
           The lower bound.
 java.awt.Paint getPaint(double value)
           Returns a Paint instance for the specified value.
 double getUpperBound()
           The upper bound.
 int hashCode()
           Returns a hash code value for the object.
 java.lang.String toString()
           Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_PAINT

public static final transient java.awt.Paint DEFAULT_PAINT
The default static paint object.

Constructor Detail

LookupPaintScale

public LookupPaintScale()
The default constructor.


LookupPaintScale

public LookupPaintScale(double lowerBound,
                        double upperBound)
The constructor.

Parameters:
lowerBound - The lower bound.
upperBound - The upper bound.

LookupPaintScale

public LookupPaintScale(double lowerBound,
                        double upperBound,
                        java.awt.Paint defaultPaint)
The constructor.

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

LookupPaintScale

public LookupPaintScale(double lowerBound,
                        double upperBound,
                        java.awt.Paint defaultPaint,
                        java.lang.String[] legendSymbols)
The constructor.

Parameters:
lowerBound - The lower bound.
upperBound - The upper bound.
defaultPaint - The default paint object (null not permitted). The symbols for drawing legend shape.
legendSymbols - The legend symbols.
Method Detail

getLowerBound

public double getLowerBound()
The lower bound.

Specified by:
getLowerBound in interface IPaintScale
Returns:
double The lower bound.

getUpperBound

public double getUpperBound()
The upper bound.

Specified by:
getUpperBound in interface IPaintScale
Returns:
double The upper bound.

getDefaultPaint

public java.awt.Paint getDefaultPaint()
Returns the default paint.

Returns:
Paint The paint (never null).

getLegendSymbols

public java.lang.String[] getLegendSymbols()
Returns the symbols for drawing legend shape.

Returns:
String[] The string array.

add

public void add(double value,
                java.awt.Paint paint)
Adds an value and a paint object to lookup table.

Parameters:
value - double The value.
paint - Paint The paint object.

getPaint

public java.awt.Paint getPaint(double value)
Returns a Paint instance for the specified value.

Specified by:
getPaint in interface IPaintScale
Parameters:
value - double The value.
Returns:
Paint The paint object (never null).

equals

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

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object (null permitted).
Returns:
A boolean.

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
int A hash code value for this object.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.

Overrides:
clone in class java.lang.Object
Returns:
object a clone of this instance.
Throws:
java.lang.CloneNotSupportedException - if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.