org.jfree.chart.needle

Class MeterNeedle

public abstract class MeterNeedle extends Object implements Serializable

The base class used to represent the needle on a CompassPlot.
Field Summary
protected static AffineTransformtransform
A transform.
Constructor Summary
MeterNeedle()
Creates a new needle.
MeterNeedle(Paint outline, Paint fill, Paint highlight)
Creates a new needle.
Method Summary
protected voiddefaultDisplay(Graphics2D g2, Shape shape)
Displays a shape.
voiddraw(Graphics2D g2, Rectangle2D plotArea)
Draws the needle.
voiddraw(Graphics2D g2, Rectangle2D plotArea, double angle)
Draws the needle.
voiddraw(Graphics2D g2, Rectangle2D plotArea, Point2D rotate, double angle)
Draws the needle.
protected abstract voiddrawNeedle(Graphics2D g2, Rectangle2D plotArea, Point2D rotate, double angle)
Draws the needle.
booleanequals(Object obj)
Tests another object for equality with this object.
PaintgetFillPaint()
Returns the fill paint.
PaintgetHighlightPaint()
Returns the highlight paint.
PaintgetOutlinePaint()
Returns the outline paint.
StrokegetOutlineStroke()
Returns the outline stroke.
doublegetRotateX()
Returns the scalar used for determining the rotation x value.
doublegetRotateY()
Returns the scalar used for determining the rotation y value.
intgetSize()
Returns the size.
AffineTransformgetTransform()
Returns the transform.
voidsetFillPaint(Paint p)
Sets the fill paint.
voidsetHighlightPaint(Paint p)
Sets the highlight paint.
voidsetOutlinePaint(Paint p)
Sets the outline paint.
voidsetOutlineStroke(Stroke s)
Sets the outline stroke.
voidsetRotateX(double x)
Sets the rotateX value.
voidsetRotateY(double y)
Sets the rotateY value.
voidsetSize(int pixels)
Sets the size.

Field Detail

transform

protected static AffineTransform transform
A transform.

Constructor Detail

MeterNeedle

public MeterNeedle()
Creates a new needle.

MeterNeedle

public MeterNeedle(Paint outline, Paint fill, Paint highlight)
Creates a new needle.

Parameters: outline the outline paint (null permitted). fill the fill paint (null permitted). highlight the highlight paint (null permitted).

Method Detail

defaultDisplay

protected void defaultDisplay(Graphics2D g2, Shape shape)
Displays a shape.

Parameters: g2 the graphics device. shape the shape.

draw

public void draw(Graphics2D g2, Rectangle2D plotArea)
Draws the needle.

Parameters: g2 the graphics device. plotArea the plot area.

draw

public void draw(Graphics2D g2, Rectangle2D plotArea, double angle)
Draws the needle.

Parameters: g2 the graphics device. plotArea the plot area. angle the angle.

draw

public void draw(Graphics2D g2, Rectangle2D plotArea, Point2D rotate, double angle)
Draws the needle.

Parameters: g2 the graphics device. plotArea the plot area. rotate the rotation point. angle the angle.

drawNeedle

protected abstract void drawNeedle(Graphics2D g2, Rectangle2D plotArea, Point2D rotate, double angle)
Draws the needle.

Parameters: g2 the graphics device. plotArea the plot area. rotate the rotation point. angle the angle.

equals

public boolean equals(Object obj)
Tests another object for equality with this object.

Parameters: obj the object to test (null permitted).

Returns: A boolean.

getFillPaint

public Paint getFillPaint()
Returns the fill paint.

Returns: The fill paint.

getHighlightPaint

public Paint getHighlightPaint()
Returns the highlight paint.

Returns: The highlight paint.

getOutlinePaint

public Paint getOutlinePaint()
Returns the outline paint.

Returns: The outline paint.

getOutlineStroke

public Stroke getOutlineStroke()
Returns the outline stroke.

Returns: The outline stroke.

getRotateX

public double getRotateX()
Returns the scalar used for determining the rotation x value.

Returns: The x rotate scalar.

getRotateY

public double getRotateY()
Returns the scalar used for determining the rotation y value.

Returns: The y rotate scalar.

getSize

public int getSize()
Returns the size.

Returns: The size.

getTransform

public AffineTransform getTransform()
Returns the transform.

Returns: The transform.

setFillPaint

public void setFillPaint(Paint p)
Sets the fill paint.

Parameters: p the fill paint.

setHighlightPaint

public void setHighlightPaint(Paint p)
Sets the highlight paint.

Parameters: p the highlight paint.

setOutlinePaint

public void setOutlinePaint(Paint p)
Sets the outline paint.

Parameters: p the new paint.

setOutlineStroke

public void setOutlineStroke(Stroke s)
Sets the outline stroke.

Parameters: s the new stroke.

setRotateX

public void setRotateX(double x)
Sets the rotateX value.

Parameters: x the new value.

setRotateY

public void setRotateY(double y)
Sets the rotateY value.

Parameters: y the new value.

setSize

public void setSize(int pixels)
Sets the size.

Parameters: pixels the new size.