org.jfree.chart.plot.dial

Class StandardDialScale

public class StandardDialScale extends AbstractDialLayer implements DialScale, Cloneable, PublicCloneable, Serializable

A scale for a DialPlot.

Since: 1.0.7

Constructor Summary
StandardDialScale()
Creates a new instance of DialScale.
StandardDialScale(double lowerBound, double upperBound, double startAngle, double extent, double majorTickIncrement, int minorTickCount)
Creates a new instance.
Method Summary
doubleangleToValue(double angle)
Converts the given angle to a data value, based on this scale.
Objectclone()
Returns a clone of this instance.
voiddraw(Graphics2D g2, DialPlot plot, Rectangle2D frame, Rectangle2D view)
Draws the scale on the dial plot.
booleanequals(Object obj)
Tests this StandardDialScale for equality with an arbitrary object.
doublegetExtent()
Returns the extent.
booleangetFirstTickLabelVisible()
Returns a flag that controls whether or not the first tick label is visible.
doublegetLowerBound()
Returns the lower bound for the scale.
doublegetMajorTickIncrement()
Returns the increment (in data units) between major tick labels.
doublegetMajorTickLength()
Returns the length factor for the major tick marks.
PaintgetMajorTickPaint()
Returns the major tick paint.
StrokegetMajorTickStroke()
Returns the stroke used to draw the major tick marks.
intgetMinorTickCount()
Returns the number of minor tick marks between major tick marks.
doublegetMinorTickLength()
Returns the length factor for the minor tick marks.
PaintgetMinorTickPaint()
Returns the paint used to draw the minor tick marks.
StrokegetMinorTickStroke()
Returns the stroke used to draw the minor tick marks.
doublegetStartAngle()
Returns the start angle for the scale (in degrees using the same orientation as Java's Arc2D class).
FontgetTickLabelFont()
Returns the font used to draw the tick labels.
NumberFormatgetTickLabelFormatter()
Returns the number formatter used to convert the tick label values to strings.
doublegetTickLabelOffset()
Returns the tick label offset.
PaintgetTickLabelPaint()
Returns the paint used to draw the tick labels.
booleangetTickLabelsVisible()
Returns true if the tick labels should be displayed, and false otherwise.
doublegetTickRadius()
Returns the radius (as a percentage of the maximum space available) of the outer limit of the tick marks.
doublegetUpperBound()
Returns the upper bound for the scale.
inthashCode()
Returns a hash code for this instance.
booleanisClippedToWindow()
Returns true to indicate that this layer should be clipped within the dial window.
voidsetExtent(double extent)
Sets the extent and sends a DialLayerChangeEvent to all registered listeners.
voidsetFirstTickLabelVisible(boolean visible)
Sets a flag that controls whether or not the first tick label is visible, and sends a DialLayerChangeEvent to all registered listeners.
voidsetLowerBound(double lower)
Sets the lower bound for the scale and sends a DialLayerChangeEvent to all registered listeners.
voidsetMajorTickIncrement(double increment)
Sets the increment (in data units) between major tick labels and sends a DialLayerChangeEvent to all registered listeners.
voidsetMajorTickLength(double length)
Sets the length factor for the major tick marks and sends a DialLayerChangeEvent to all registered listeners.
voidsetMajorTickPaint(Paint paint)
Sets the major tick paint and sends a DialLayerChangeEvent to all registered listeners.
voidsetMajorTickStroke(Stroke stroke)
Sets the stroke used to draw the major tick marks and sends a DialLayerChangeEvent to all registered listeners.
voidsetMinorTickCount(int count)
Sets the number of minor tick marks between major tick marks and sends a DialLayerChangeEvent to all registered listeners.
voidsetMinorTickLength(double length)
Sets the length factor for the minor tick marks and sends a DialLayerChangeEvent to all registered listeners.
voidsetMinorTickPaint(Paint paint)
Sets the paint used to draw the minor tick marks and sends a DialLayerChangeEvent to all registered listeners.
voidsetMinorTickStroke(Stroke stroke)
Sets the stroke used to draw the minor tick marks and sends a DialLayerChangeEvent to all registered listeners.
voidsetStartAngle(double angle)
Sets the start angle for the scale and sends a DialLayerChangeEvent to all registered listeners.
voidsetTickLabelFont(Font font)
Sets the font used to display the tick labels and sends a DialLayerChangeEvent to all registered listeners.
voidsetTickLabelFormatter(NumberFormat formatter)
Sets the number formatter used to convert the tick label values to strings, and sends a DialLayerChangeEvent to all registered listeners.
voidsetTickLabelOffset(double offset)
Sets the tick label offset and sends a DialLayerChangeEvent to all registered listeners.
voidsetTickLabelPaint(Paint paint)
Sets the paint used to draw the tick labels and sends a DialLayerChangeEvent to all registered listeners.
voidsetTickLabelsVisible(boolean visible)
Sets the flag that controls whether or not the tick labels are displayed, and sends a DialLayerChangeEvent to all registered listeners.
voidsetTickRadius(double radius)
Sets the tick radius and sends a DialLayerChangeEvent to all registered listeners.
voidsetUpperBound(double upper)
Sets the upper bound for the scale and sends a DialLayerChangeEvent to all registered listeners.
doublevalueToAngle(double value)
Converts a data value to an angle against this scale.

Constructor Detail

StandardDialScale

public StandardDialScale()
Creates a new instance of DialScale.

StandardDialScale

public StandardDialScale(double lowerBound, double upperBound, double startAngle, double extent, double majorTickIncrement, int minorTickCount)
Creates a new instance.

Parameters: lowerBound the lower bound of the scale. upperBound the upper bound of the scale. startAngle the start angle (in degrees, using the same orientation as Java's Arc2D class). extent the extent (in degrees, counter-clockwise). majorTickIncrement the interval between major tick marks minorTickCount the number of minor ticks between major tick marks.

Method Detail

angleToValue

public double angleToValue(double angle)
Converts the given angle to a data value, based on this scale.

Parameters: angle the angle.

Returns: The data value.

See Also: StandardDialScale

clone

public Object clone()
Returns a clone of this instance.

Returns: A clone.

Throws: CloneNotSupportedException if this instance is not cloneable.

draw

public void draw(Graphics2D g2, DialPlot plot, Rectangle2D frame, Rectangle2D view)
Draws the scale on the dial plot.

Parameters: g2 the graphics target (null not permitted). plot the dial plot (null not permitted). frame the reference frame that is used to construct the geometry of the plot (null not permitted). view the visible part of the plot (null not permitted).

equals

public boolean equals(Object obj)
Tests this StandardDialScale for equality with an arbitrary object.

Parameters: obj the object (null permitted).

Returns: A boolean.

getExtent

public double getExtent()
Returns the extent.

Returns: The extent.

See Also: StandardDialScale

getFirstTickLabelVisible

public boolean getFirstTickLabelVisible()
Returns a flag that controls whether or not the first tick label is visible.

Returns: A boolean.

See Also: StandardDialScale

getLowerBound

public double getLowerBound()
Returns the lower bound for the scale.

Returns: The lower bound for the scale.

Since: 1.0.8

See Also:

getMajorTickIncrement

public double getMajorTickIncrement()
Returns the increment (in data units) between major tick labels.

Returns: The increment between major tick labels.

See Also: StandardDialScale

getMajorTickLength

public double getMajorTickLength()
Returns the length factor for the major tick marks. The value is subtracted from the tick radius to determine the inner starting point for the tick marks.

Returns: The length factor.

See Also: StandardDialScale

getMajorTickPaint

public Paint getMajorTickPaint()
Returns the major tick paint.

Returns: The major tick paint (never null).

See Also: setMajorTickPaint

getMajorTickStroke

public Stroke getMajorTickStroke()
Returns the stroke used to draw the major tick marks.

Returns: The stroke (never null).

See Also: setMajorTickStroke

getMinorTickCount

public int getMinorTickCount()
Returns the number of minor tick marks between major tick marks.

Returns: The number of minor tick marks between major tick marks.

See Also: StandardDialScale

getMinorTickLength

public double getMinorTickLength()
Returns the length factor for the minor tick marks. The value is subtracted from the tick radius to determine the inner starting point for the tick marks.

Returns: The length factor.

See Also: StandardDialScale

getMinorTickPaint

public Paint getMinorTickPaint()
Returns the paint used to draw the minor tick marks.

Returns: The paint (never null).

See Also: setMinorTickPaint

getMinorTickStroke

public Stroke getMinorTickStroke()
Returns the stroke used to draw the minor tick marks.

Returns: The paint (never null).

Since: 1.0.8

See Also:

getStartAngle

public double getStartAngle()
Returns the start angle for the scale (in degrees using the same orientation as Java's Arc2D class).

Returns: The start angle.

See Also: StandardDialScale

getTickLabelFont

public Font getTickLabelFont()
Returns the font used to draw the tick labels.

Returns: The font (never null).

See Also: setTickLabelFont

getTickLabelFormatter

public NumberFormat getTickLabelFormatter()
Returns the number formatter used to convert the tick label values to strings.

Returns: The formatter (never null).

See Also: setTickLabelFormatter

getTickLabelOffset

public double getTickLabelOffset()
Returns the tick label offset.

Returns: The tick label offset.

See Also: StandardDialScale

getTickLabelPaint

public Paint getTickLabelPaint()
Returns the paint used to draw the tick labels.

Returns: The paint (null not permitted).

See Also: setTickLabelPaint

getTickLabelsVisible

public boolean getTickLabelsVisible()
Returns true if the tick labels should be displayed, and false otherwise.

Returns: A boolean.

See Also: StandardDialScale

getTickRadius

public double getTickRadius()
Returns the radius (as a percentage of the maximum space available) of the outer limit of the tick marks.

Returns: The tick radius.

See Also: StandardDialScale

getUpperBound

public double getUpperBound()
Returns the upper bound for the scale.

Returns: The upper bound for the scale.

Since: 1.0.8

See Also:

hashCode

public int hashCode()
Returns a hash code for this instance.

Returns: A hash code.

isClippedToWindow

public boolean isClippedToWindow()
Returns true to indicate that this layer should be clipped within the dial window.

Returns: true.

setExtent

public void setExtent(double extent)
Sets the extent and sends a DialLayerChangeEvent to all registered listeners.

Parameters: extent the extent.

See Also: getExtent

setFirstTickLabelVisible

public void setFirstTickLabelVisible(boolean visible)
Sets a flag that controls whether or not the first tick label is visible, and sends a DialLayerChangeEvent to all registered listeners.

Parameters: visible the new flag value.

See Also: getFirstTickLabelVisible

setLowerBound

public void setLowerBound(double lower)
Sets the lower bound for the scale and sends a DialLayerChangeEvent to all registered listeners.

Parameters: lower the lower bound.

Since: 1.0.8

See Also:

setMajorTickIncrement

public void setMajorTickIncrement(double increment)
Sets the increment (in data units) between major tick labels and sends a DialLayerChangeEvent to all registered listeners.

Parameters: increment the increment.

See Also: getMajorTickIncrement

setMajorTickLength

public void setMajorTickLength(double length)
Sets the length factor for the major tick marks and sends a DialLayerChangeEvent to all registered listeners.

Parameters: length the length.

See Also: getMajorTickLength

setMajorTickPaint

public void setMajorTickPaint(Paint paint)
Sets the major tick paint and sends a DialLayerChangeEvent to all registered listeners.

Parameters: paint the paint (null not permitted).

See Also: getMajorTickPaint

setMajorTickStroke

public void setMajorTickStroke(Stroke stroke)
Sets the stroke used to draw the major tick marks and sends a DialLayerChangeEvent to all registered listeners.

Parameters: stroke the stroke (null not permitted).

See Also: getMajorTickStroke

setMinorTickCount

public void setMinorTickCount(int count)
Sets the number of minor tick marks between major tick marks and sends a DialLayerChangeEvent to all registered listeners.

Parameters: count the count.

See Also: getMinorTickCount

setMinorTickLength

public void setMinorTickLength(double length)
Sets the length factor for the minor tick marks and sends a DialLayerChangeEvent to all registered listeners.

Parameters: length the length.

See Also: getMinorTickLength

setMinorTickPaint

public void setMinorTickPaint(Paint paint)
Sets the paint used to draw the minor tick marks and sends a DialLayerChangeEvent to all registered listeners.

Parameters: paint the paint (null not permitted).

See Also: getMinorTickPaint

setMinorTickStroke

public void setMinorTickStroke(Stroke stroke)
Sets the stroke used to draw the minor tick marks and sends a DialLayerChangeEvent to all registered listeners.

Parameters: stroke the stroke (null not permitted).

Since: 1.0.8

See Also:

setStartAngle

public void setStartAngle(double angle)
Sets the start angle for the scale and sends a DialLayerChangeEvent to all registered listeners.

Parameters: angle the angle (in degrees).

See Also: getStartAngle

setTickLabelFont

public void setTickLabelFont(Font font)
Sets the font used to display the tick labels and sends a DialLayerChangeEvent to all registered listeners.

Parameters: font the font (null not permitted).

See Also: getTickLabelFont

setTickLabelFormatter

public void setTickLabelFormatter(NumberFormat formatter)
Sets the number formatter used to convert the tick label values to strings, and sends a DialLayerChangeEvent to all registered listeners.

Parameters: formatter the formatter (null not permitted).

See Also: getTickLabelFormatter

setTickLabelOffset

public void setTickLabelOffset(double offset)
Sets the tick label offset and sends a DialLayerChangeEvent to all registered listeners.

Parameters: offset the offset.

See Also: getTickLabelOffset

setTickLabelPaint

public void setTickLabelPaint(Paint paint)
Sets the paint used to draw the tick labels and sends a DialLayerChangeEvent to all registered listeners.

Parameters: paint the paint (null not permitted).

setTickLabelsVisible

public void setTickLabelsVisible(boolean visible)
Sets the flag that controls whether or not the tick labels are displayed, and sends a DialLayerChangeEvent to all registered listeners.

Parameters: visible the new flag value.

See Also: getTickLabelsVisible

setTickRadius

public void setTickRadius(double radius)
Sets the tick radius and sends a DialLayerChangeEvent to all registered listeners.

Parameters: radius the radius.

See Also: getTickRadius

setUpperBound

public void setUpperBound(double upper)
Sets the upper bound for the scale and sends a DialLayerChangeEvent to all registered listeners.

Parameters: upper the upper bound.

Since: 1.0.8

See Also:

valueToAngle

public double valueToAngle(double value)
Converts a data value to an angle against this scale.

Parameters: value the data value.

Returns: The angle (in degrees, using the same specification as Java's Arc2D class).

See Also: StandardDialScale