JIDE 3.5.15

com.jidesoft.gauge
Class Pivot

java.lang.Object
  extended by com.jidesoft.gauge.Pivot
All Implemented Interfaces:
Drawable, ZOrder

public class Pivot
extends Object
implements Drawable, ZOrder

A pivot is similar to a DialIntervalMarker, except that it uses a fromAngle and toAngle (specified in degrees) where a DialIntervalMarker is configured by values on the primary axis. After creating a Pivot instance, you must add it to the Dial using the addDrawable() method of the dial. A pivot is usually used for just that - the pivot of a dial - but the class could be used as a decoration elsewhere on the dial.


Constructor Summary
Pivot(Dial dial, double radius, double fromAngle, double toAngle, Paint fill)
          Create a Pivot on the supplied dial instance that covers a range of angles from the supplied fromAngle to the toAngle, and using the supplied radius as a proportion of the radius of the dial.
Pivot(Dial dial, double radius, Paint fill)
          Create a circular Pivot on the supplied dial instance using the radius and filled by the supplied fill Paint.
 
Method Summary
 void draw(Graphics g)
          The draw() method of the Drawable that paints the Pivot onto the Graphics context
protected  Point2D getCenter()
           
 Paint getFill()
          Returns the Paint fill used for the Pivot
 double getFromAngle()
          The start angle for the segment of the circle covered by the Pivot
 double getInnerRadius()
          The inner radius of the segment, specified as a proportion of the radius of the dial
 double getOffsetAngle()
           
 double getOffsetRadius()
           
 double getOuterRadius()
          The outer radius of the segment, specified as a proportion of the radius of the dial
 Color getOutlineColor()
          The current outline color for the Pivot
 int getOutlineWidth()
          Returns the width of the outline, in pixels
 double getToAngle()
          The end angle for the segment of the circle covered by the Pivot
 int getZOrder()
          Returns the z-order specification for the Pivot
 boolean isVisible()
          Returns a boolean to indicate whether the Pivot is currently visible
 void setFill(Paint fill)
          Specify the Paint fill to use for the Pivot
 void setFromAngle(double fromAngle)
          Specify the start angle for the segment of the circle covered by the Pivot
 void setInnerRadius(double innerRadius)
          Specifies the inner radius of the segment as a proportion of the radius of the dial
 void setOffsetAngle(double offsetAngle)
           
 void setOffsetRadius(double offsetRadius)
           
 void setOuterRadius(double outerRadius)
          Specifies the outer radius of the segment as a proportion of the radius of the dial
 void setOutlineColor(Color outlineColor)
          Specify the outline color for the Pivot
 void setOutlineWidth(int outlineWidth)
          Specify the width of the outline, in pixels
 void setToAngle(double toAngle)
          Specify the end angle for the segment of the circle covered by the Pivot
 void setVisible(boolean visible)
          Specify whether the Pivot is to be visible
 void setZOrder(int zOrder)
          Provide advice to the dial about whether to paint this on top or underneath the needles.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pivot

public Pivot(Dial dial,
             double radius,
             Paint fill)
Create a circular Pivot on the supplied dial instance using the radius and filled by the supplied fill Paint.

Parameters:
dial - the dial to which the Pivot will be added
radius - the radius of the pivot as a proportion of the radius of the dial
fill - the Paint used to fill the dial

Pivot

public Pivot(Dial dial,
             double radius,
             double fromAngle,
             double toAngle,
             Paint fill)
Create a Pivot on the supplied dial instance that covers a range of angles from the supplied fromAngle to the toAngle, and using the supplied radius as a proportion of the radius of the dial.

Parameters:
dial - the dial instance to which the Pivot will be added
radius - the radius of the pivot as a proportion of the radius of the dial
fromAngle - the start angle of the pivot circle segment.
toAngle - the end angle of the pivot circle segment.
fill - the Paint used to fill the dial
Method Detail

getFill

public Paint getFill()
Returns the Paint fill used for the Pivot

Returns:
the Paint fill used for the Pivot

setFill

public void setFill(Paint fill)
Specify the Paint fill to use for the Pivot

Parameters:
fill - the Paint fill to use for the Pivot

getFromAngle

public double getFromAngle()
The start angle for the segment of the circle covered by the Pivot

Returns:
the start angle for the segment of the circle covered by the Pivot

setFromAngle

public void setFromAngle(double fromAngle)
Specify the start angle for the segment of the circle covered by the Pivot

Parameters:
fromAngle - the start angle (in degrees) of the circle segment covered by the Pivot

getInnerRadius

public double getInnerRadius()
The inner radius of the segment, specified as a proportion of the radius of the dial

Returns:
the inner radius of the segment

setInnerRadius

public void setInnerRadius(double innerRadius)
Specifies the inner radius of the segment as a proportion of the radius of the dial

Parameters:
innerRadius - the inner radius of the segment

getOuterRadius

public double getOuterRadius()
The outer radius of the segment, specified as a proportion of the radius of the dial

Returns:
the inner radius of the segment

setOuterRadius

public void setOuterRadius(double outerRadius)
Specifies the outer radius of the segment as a proportion of the radius of the dial

Parameters:
outerRadius - the outer radius of the segment

getToAngle

public double getToAngle()
The end angle for the segment of the circle covered by the Pivot

Returns:
the end angle for the segment of the circle covered by the Pivot

setToAngle

public void setToAngle(double toAngle)
Specify the end angle for the segment of the circle covered by the Pivot

Parameters:
toAngle - the end angle (in degrees) of the circle covered by the Pivot

getZOrder

public int getZOrder()
Returns the z-order specification for the Pivot

Specified by:
getZOrder in interface ZOrder
Returns:
the z-order specification for the Pivot
See Also:
setZOrder(int)

setZOrder

public void setZOrder(int zOrder)
Provide advice to the dial about whether to paint this on top or underneath the needles. Importantly, needles are painted at z = 100 so any value less than that will cause the pivot to be painted underneath the needles.

Specified by:
setZOrder in interface ZOrder
Parameters:
zOrder - a numeric specification for which vertical 'slice' to paint this on

getOutlineColor

public Color getOutlineColor()
The current outline color for the Pivot

Returns:
the outline color for the Pivot

setOutlineColor

public void setOutlineColor(Color outlineColor)
Specify the outline color for the Pivot

Parameters:
outlineColor - the outline color for the Pivot

getOutlineWidth

public int getOutlineWidth()
Returns the width of the outline, in pixels

Returns:
the width of the outline, in pixels

setOutlineWidth

public void setOutlineWidth(int outlineWidth)
Specify the width of the outline, in pixels

Parameters:
outlineWidth - the width of the outline, in pixels

getOffsetAngle

public double getOffsetAngle()

setOffsetAngle

public void setOffsetAngle(double offsetAngle)

getOffsetRadius

public double getOffsetRadius()

setOffsetRadius

public void setOffsetRadius(double offsetRadius)

isVisible

public boolean isVisible()
Returns a boolean to indicate whether the Pivot is currently visible

Returns:
a boolean to indicate whether the Pivot is currently visible

setVisible

public void setVisible(boolean visible)
Specify whether the Pivot is to be visible

Parameters:
visible - whether the Pivot is to be visible

getCenter

protected Point2D getCenter()

draw

public void draw(Graphics g)
The draw() method of the Drawable that paints the Pivot onto the Graphics context

Specified by:
draw in interface Drawable
Parameters:
g - the Graphics context

JIDE 3.5.15