Package org.jfree.chart.needle
Class MeterNeedle
- java.lang.Object
-
- org.jfree.chart.needle.MeterNeedle
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ArrowNeedle,LineNeedle,LongNeedle,MiddlePinNeedle,PinNeedle,PlumNeedle,PointerNeedle,ShipNeedle
public abstract class MeterNeedle extends java.lang.Object implements java.io.SerializableThe base class used to represent the needle on aCompassPlot.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.PaintfillPaintThe fill paint.private java.awt.PainthighlightPaintThe highlight paint.private java.awt.PaintoutlinePaintThe outline paint.private java.awt.StrokeoutlineStrokeThe outline stroke.private doublerotateXScalar to apply to locate the rotation x point.private doublerotateYScalar to apply to locate the rotation y point.private static longserialVersionUIDFor serialization.private intsizeThe size.protected static java.awt.geom.AffineTransformtransformA transform.
-
Constructor Summary
Constructors Constructor Description MeterNeedle()Creates a new needle.MeterNeedle(java.awt.Paint outline, java.awt.Paint fill, java.awt.Paint highlight)Creates a new needle.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voiddefaultDisplay(java.awt.Graphics2D g2, java.awt.Shape shape)Displays a shape.voiddraw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea)Draws the needle.voiddraw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, double angle)Draws the needle.voiddraw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, java.awt.geom.Point2D rotate, double angle)Draws the needle.protected abstract voiddrawNeedle(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, java.awt.geom.Point2D rotate, double angle)Draws the needle.booleanequals(java.lang.Object obj)Tests another object for equality with this object.java.awt.PaintgetFillPaint()Returns the fill paint.java.awt.PaintgetHighlightPaint()Returns the highlight paint.java.awt.PaintgetOutlinePaint()Returns the outline paint.java.awt.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.java.awt.geom.AffineTransformgetTransform()Returns the transform.inthashCode()Returns a hash code for this instance.private voidreadObject(java.io.ObjectInputStream stream)Provides serialization support.voidsetFillPaint(java.awt.Paint p)Sets the fill paint.voidsetHighlightPaint(java.awt.Paint p)Sets the highlight paint.voidsetOutlinePaint(java.awt.Paint p)Sets the outline paint.voidsetOutlineStroke(java.awt.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.private voidwriteObject(java.io.ObjectOutputStream stream)Provides serialization support.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
outlinePaint
private transient java.awt.Paint outlinePaint
The outline paint.
-
outlineStroke
private transient java.awt.Stroke outlineStroke
The outline stroke.
-
fillPaint
private transient java.awt.Paint fillPaint
The fill paint.
-
highlightPaint
private transient java.awt.Paint highlightPaint
The highlight paint.
-
size
private int size
The size.
-
rotateX
private double rotateX
Scalar to apply to locate the rotation x point.
-
rotateY
private double rotateY
Scalar to apply to locate the rotation y point.
-
transform
protected static java.awt.geom.AffineTransform transform
A transform.
-
-
Constructor Detail
-
MeterNeedle
public MeterNeedle()
Creates a new needle.
-
MeterNeedle
public MeterNeedle(java.awt.Paint outline, java.awt.Paint fill, java.awt.Paint highlight)Creates a new needle.- Parameters:
outline- the outline paint (nullpermitted).fill- the fill paint (nullpermitted).highlight- the highlight paint (nullpermitted).
-
-
Method Detail
-
getOutlinePaint
public java.awt.Paint getOutlinePaint()
Returns the outline paint.- Returns:
- The outline paint.
-
setOutlinePaint
public void setOutlinePaint(java.awt.Paint p)
Sets the outline paint.- Parameters:
p- the new paint.
-
getOutlineStroke
public java.awt.Stroke getOutlineStroke()
Returns the outline stroke.- Returns:
- The outline stroke.
-
setOutlineStroke
public void setOutlineStroke(java.awt.Stroke s)
Sets the outline stroke.- Parameters:
s- the new stroke.
-
getFillPaint
public java.awt.Paint getFillPaint()
Returns the fill paint.- Returns:
- The fill paint.
-
setFillPaint
public void setFillPaint(java.awt.Paint p)
Sets the fill paint.- Parameters:
p- the fill paint.
-
getHighlightPaint
public java.awt.Paint getHighlightPaint()
Returns the highlight paint.- Returns:
- The highlight paint.
-
setHighlightPaint
public void setHighlightPaint(java.awt.Paint p)
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
public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea)Draws the needle.- Parameters:
g2- the graphics device.plotArea- the plot area.
-
draw
public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, double angle)Draws the needle.- Parameters:
g2- the graphics device.plotArea- the plot area.angle- the angle.
-
draw
public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, java.awt.geom.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(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, java.awt.geom.Point2D rotate, double angle)Draws the needle.- Parameters:
g2- the graphics device.plotArea- the plot area.rotate- the rotation point.angle- the angle.
-
defaultDisplay
protected void defaultDisplay(java.awt.Graphics2D g2, java.awt.Shape shape)Displays a shape.- Parameters:
g2- the graphics device.shape- the shape.
-
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
public java.awt.geom.AffineTransform getTransform()
Returns the transform.- Returns:
- The transform.
-
equals
public boolean equals(java.lang.Object obj)
Tests another object for equality with this object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object to test (nullpermitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
Returns a hash code for this instance.- Overrides:
hashCodein classjava.lang.Object- Returns:
- A hash code.
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOExceptionProvides serialization support.- Parameters:
stream- the output stream.- Throws:
java.io.IOException- if there is an I/O error.
-
readObject
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundExceptionProvides serialization support.- Parameters:
stream- the input stream.- Throws:
java.io.IOException- if there is an I/O error.java.lang.ClassNotFoundException- if there is a classpath problem.
-
-