com.jrefinery.chart.needle
Class MeterNeedle

java.lang.Object
  extended by com.jrefinery.chart.needle.MeterNeedle
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ArrowNeedle, LineNeedle, LongNeedle, PinNeedle, PlumNeedle, PointerNeedle, ShipNeedle

public abstract class MeterNeedle
extends java.lang.Object
implements java.io.Serializable

The base class used to represent the needle on a CompassPlot.

Author:
Bryan Scott
See Also:
Serialized Form

Constructor Summary
MeterNeedle()
          Creates a new needle.
MeterNeedle(java.awt.Paint outline, java.awt.Paint fill, java.awt.Paint highlight)
          Creates a new needle.
 
Method Summary
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 object)
          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.
 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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.
fill - the fill paint.
highlight - the highlight paint.
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 object)
Tests another object for equality with this object.

Overrides:
equals in class java.lang.Object
Parameters:
object - the object to test.
Returns:
A boolean.


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.