Package org.jfree.chart.needle
Class MeterNeedle
java.lang.Object
org.jfree.chart.needle.MeterNeedle
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ArrowNeedle
,LineNeedle
,LongNeedle
,PinNeedle
,PlumNeedle
,PointerNeedle
,ShipNeedle
public abstract class MeterNeedle extends Object implements Serializable
The base class used to represent the needle on a
CompassPlot
.- Author:
- Bryan Scott
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description MeterNeedle()
Creates a new needle.MeterNeedle(Paint outline, Paint fill, Paint highlight)
Creates a new needle. -
Method Summary
Modifier and Type Method Description void
draw(Graphics2D g2, Rectangle2D plotArea)
Draws the needle.void
draw(Graphics2D g2, Rectangle2D plotArea, double angle)
Draws the needle.void
draw(Graphics2D g2, Rectangle2D plotArea, Point2D rotate, double angle)
Draws the needle.boolean
equals(Object object)
Tests another object for equality with this object.Paint
getFillPaint()
Returns the fill paint.Paint
getHighlightPaint()
Returns the highlight paint.Paint
getOutlinePaint()
Returns the outline paint.Stroke
getOutlineStroke()
Returns the outline stroke.double
getRotateX()
Returns the scalar used for determining the rotation x value.double
getRotateY()
Returns the scalar used for determining the rotation y value.int
getSize()
Returns the size.AffineTransform
getTransform()
Returns the transform.void
setFillPaint(Paint p)
Sets the fill paint.void
setHighlightPaint(Paint p)
Sets the highlight paint.void
setOutlinePaint(Paint p)
Sets the outline paint.void
setOutlineStroke(Stroke s)
Sets the outline stroke.void
setRotateX(double x)
Sets the rotateX value.void
setRotateY(double y)
Sets the rotateY value.void
setSize(int pixels)
Sets the size.
-
Constructor Details
-
MeterNeedle
public MeterNeedle()Creates a new needle. -
MeterNeedle
Creates a new needle.- Parameters:
outline
- the outline paint.fill
- the fill paint.highlight
- the highlight paint.
-
-
Method Details
-
getOutlinePaint
Returns the outline paint.- Returns:
- the outline paint.
-
setOutlinePaint
Sets the outline paint.- Parameters:
p
- the new paint.
-
getOutlineStroke
Returns the outline stroke.- Returns:
- the outline stroke.
-
setOutlineStroke
Sets the outline stroke.- Parameters:
s
- the new stroke.
-
getFillPaint
Returns the fill paint.- Returns:
- the fill paint.
-
setFillPaint
Sets the fill paint.- Parameters:
p
- the fill paint.
-
getHighlightPaint
Returns the highlight paint.- Returns:
- the highlight paint.
-
setHighlightPaint
Sets the highlight paint.- Parameters:
p
- the highlight paint.
-
getRotateX
public double getRotateX()Returns the scalar used for determining the rotation x value.- Returns:
- the x rotate scalar.
-
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.
-
getRotateY
public double getRotateY()Returns the scalar used for determining the rotation y value.- Returns:
- the y rotate scalar.
-
draw
Draws the needle.- Parameters:
g2
- the graphics device.plotArea
- the plot area.
-
draw
Draws the needle.- Parameters:
g2
- the graphics device.plotArea
- the plot area.angle
- the angle.
-
draw
Draws the needle.- Parameters:
g2
- the graphics device.plotArea
- the plot area.rotate
- the rotation point.angle
- the angle.
-
getSize
public int getSize()Returns the size.- Returns:
- the size.
-
setSize
public void setSize(int pixels)Sets the size.- Parameters:
pixels
- the new size.
-
getTransform
Returns the transform.- Returns:
- the transform.
-
equals
Tests another object for equality with this object.
-