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
,MiddlePinNeedle
,PinNeedle
,PlumNeedle
,PointerNeedle
,ShipNeedle
The base class used to represent the needle on a
CompassPlot
.- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates a new needle.MeterNeedle
(Paint outline, Paint fill, Paint highlight) Creates a new needle. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
defaultDisplay
(Graphics2D g2, Shape shape) Displays a shape.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.protected abstract void
drawNeedle
(Graphics2D g2, Rectangle2D plotArea, Point2D rotate, double angle) Draws the needle.boolean
Tests another object for equality with this object.Returns the fill paint.Returns the highlight paint.Returns the outline paint.Returns the outline stroke.double
Returns the scalar used for determining the rotation x value.double
Returns the scalar used for determining the rotation y value.int
getSize()
Returns the size.Returns the transform.int
hashCode()
Returns a hash code for this instance.void
Sets the fill paint.void
Sets the highlight paint.void
Sets the outline paint.void
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.
-
Field Details
-
transform
A transform.
-
-
Constructor Details
-
MeterNeedle
public MeterNeedle()Creates a new needle. -
MeterNeedle
Creates a new needle.- Parameters:
outline
- the outline paint (null
permitted).fill
- the fill paint (null
permitted).highlight
- the highlight paint (null
permitted).
-
-
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
Returns the scalar used for determining the rotation x value.- Returns:
- The x rotate scalar.
-
setRotateX
Sets the rotateX value.- Parameters:
x
- the new value.
-
setRotateY
Sets the rotateY value.- Parameters:
y
- the new value.
-
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.
-
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.
-
defaultDisplay
Displays a shape.- Parameters:
g2
- the graphics device.shape
- the shape.
-
getSize
Returns the size.- Returns:
- The size.
-
setSize
Sets the size.- Parameters:
pixels
- the new size.
-
getTransform
Returns the transform.- Returns:
- The transform.
-
equals
Tests another object for equality with this object. -
hashCode
Returns a hash code for this instance.
-