public abstract class MeterNeedle
extends java.lang.Object
implements java.io.Serializable
CompassPlot.| Modifier and Type | Field and Description |
|---|---|
private java.awt.Paint |
fillPaint
The fill paint.
|
private java.awt.Paint |
highlightPaint
The highlight paint.
|
private java.awt.Paint |
outlinePaint
The outline paint.
|
private java.awt.Stroke |
outlineStroke
The outline stroke.
|
private double |
rotateX
Scalar to aply to locate the rotation x point.
|
private double |
rotateY
Scalar to aply to locate the rotation y point.
|
private static long |
serialVersionUID
For serialization.
|
private int |
size
The size.
|
protected static java.awt.geom.AffineTransform |
transform
A transform.
|
| Constructor and Description |
|---|
MeterNeedle()
Creates a new needle.
|
MeterNeedle(java.awt.Paint outline,
java.awt.Paint fill,
java.awt.Paint highlight)
Creates a new needle.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
defaultDisplay(java.awt.Graphics2D g2,
java.awt.Shape shape)
Displays a shape.
|
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea)
Draws the needle.
|
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
double angle)
Draws the needle.
|
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
java.awt.geom.Point2D rotate,
double angle)
Draws the needle.
|
protected abstract void |
drawNeedle(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
java.awt.geom.Point2D rotate,
double angle)
Draws the needle.
|
boolean |
equals(java.lang.Object obj)
Tests another object for equality with this object.
|
java.awt.Paint |
getFillPaint()
Returns the fill paint.
|
java.awt.Paint |
getHighlightPaint()
Returns the highlight paint.
|
java.awt.Paint |
getOutlinePaint()
Returns the outline paint.
|
java.awt.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.
|
java.awt.geom.AffineTransform |
getTransform()
Returns the transform.
|
int |
hashCode()
Returns a hash code for this instance.
|
private void |
readObject(java.io.ObjectInputStream stream)
Provides serialization support.
|
void |
setFillPaint(java.awt.Paint p)
Sets the fill paint.
|
void |
setHighlightPaint(java.awt.Paint p)
Sets the highlight paint.
|
void |
setOutlinePaint(java.awt.Paint p)
Sets the outline paint.
|
void |
setOutlineStroke(java.awt.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.
|
private void |
writeObject(java.io.ObjectOutputStream stream)
Provides serialization support.
|
private static final long serialVersionUID
private transient java.awt.Paint outlinePaint
private transient java.awt.Stroke outlineStroke
private transient java.awt.Paint fillPaint
private transient java.awt.Paint highlightPaint
private int size
private double rotateX
private double rotateY
protected static java.awt.geom.AffineTransform transform
public MeterNeedle()
public MeterNeedle(java.awt.Paint outline,
java.awt.Paint fill,
java.awt.Paint highlight)
outline - the outline paint (null permitted).fill - the fill paint (null permitted).highlight - the highlight paint (null permitted).public java.awt.Paint getOutlinePaint()
public void setOutlinePaint(java.awt.Paint p)
p - the new paint.public java.awt.Stroke getOutlineStroke()
public void setOutlineStroke(java.awt.Stroke s)
s - the new stroke.public java.awt.Paint getFillPaint()
public void setFillPaint(java.awt.Paint p)
p - the fill paint.public java.awt.Paint getHighlightPaint()
public void setHighlightPaint(java.awt.Paint p)
p - the highlight paint.public double getRotateX()
public void setRotateX(double x)
x - the new value.public void setRotateY(double y)
y - the new value.public double getRotateY()
public void draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea)
g2 - the graphics device.plotArea - the plot area.public void draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
double angle)
g2 - the graphics device.plotArea - the plot area.angle - the angle.public void draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
java.awt.geom.Point2D rotate,
double angle)
g2 - the graphics device.plotArea - the plot area.rotate - the rotation point.angle - the angle.protected abstract void drawNeedle(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
java.awt.geom.Point2D rotate,
double angle)
g2 - the graphics device.plotArea - the plot area.rotate - the rotation point.angle - the angle.protected void defaultDisplay(java.awt.Graphics2D g2,
java.awt.Shape shape)
g2 - the graphics device.shape - the shape.public int getSize()
public void setSize(int pixels)
pixels - the new size.public java.awt.geom.AffineTransform getTransform()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object to test (null permitted).public int hashCode()
hashCode in class java.lang.Objectprivate void writeObject(java.io.ObjectOutputStream stream)
throws java.io.IOException
stream - the output stream.java.io.IOException - if there is an I/O error.private void readObject(java.io.ObjectInputStream stream)
throws java.io.IOException,
java.lang.ClassNotFoundException
stream - the input stream.java.io.IOException - if there is an I/O error.java.lang.ClassNotFoundException - if there is a classpath problem.