Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.jfree.chart.plot.dial.AbstractDialLayer
org.jfree.chart.plot.dial.StandardDialScale
public class StandardDialScale
extends AbstractDialLayer
implements DialScale, Cloneable, PublicCloneable, Serializable
DialPlot
.
Constructor Summary | |
| |
|
Method Summary | |
double |
|
Object |
|
void | |
boolean |
|
double |
|
boolean |
|
double |
|
double |
|
Paint |
|
Stroke |
|
int |
|
double |
|
Paint |
|
double |
|
Font |
|
NumberFormat |
|
double |
|
Paint |
|
boolean |
|
double |
|
int |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
double |
|
Methods inherited from class org.jfree.chart.plot.dial.AbstractDialLayer | |
addChangeListener , clone , equals , hasListener , hashCode , isVisible , notifyListeners , removeChangeListener , setVisible |
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'sArc2D
class).extent
- the extent (in degrees, counter-clockwise).majorTickIncrement
- the interval between major tick marksminorTickCount
- the number of minor ticks between major tick marks.
public double angleToValue(double angle)
Converts the given angle to a data value, based on this scale.
- Specified by:
- angleToValue in interface DialScale
- Parameters:
angle
- the angle.
- Returns:
- The data value.
- See Also:
valueToAngle(double)
public Object clone() throws CloneNotSupportedException
Returns a clone of this instance.
- Overrides:
- clone in interface AbstractDialLayer
- Returns:
- A clone.
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).
public boolean equals(Object obj)
Tests thisStandardDialScale
for equality with an arbitrary object.
- Overrides:
- equals in interface AbstractDialLayer
- Parameters:
obj
- the object (null
permitted).
- Returns:
- A boolean.
public double getExtent()
Returns the extent.
- Returns:
- The extent.
- See Also:
setExtent(double)
public boolean getFirstTickLabelVisible()
Returns a flag that controls whether or not the first tick label is visible.
- Returns:
- A boolean.
- See Also:
setFirstTickLabelVisible(boolean)
public double getMajorTickIncrement()
Returns the increment (in data units) between major tick labels.
- Returns:
- The increment between major tick labels.
- See Also:
setMajorTickIncrement(double)
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:
setMajorTickLength(double)
public Paint getMajorTickPaint()
Returns the major tick paint.
- Returns:
- The major tick paint (never
null
).
- See Also:
setMajorTickPaint(Paint)
public Stroke getMajorTickStroke()
Returns the stroke used to draw the major tick marks.
- Returns:
- The stroke (never
null
).
- See Also:
setMajorTickStroke(Stroke)
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:
setMinorTickCount(int)
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:
setMinorTickLength(double)
public Paint getMinorTickPaint()
Returns the paint used to draw the minor tick marks.
- Returns:
- The paint (never
null
).
- See Also:
setMinorTickPaint(Paint)
public double getStartAngle()
Returns the start angle for the scale (in degrees using the same orientation as Java'sArc2D
class).
- Returns:
- The start angle.
- See Also:
setStartAngle(double)
public Font getTickLabelFont()
Returns the font used to draw the tick labels.
- Returns:
- The font (never
null
).
- See Also:
setTickLabelFont(Font)
public NumberFormat getTickLabelFormatter()
Returns the number formatter used to convert the tick label values to strings.
- Returns:
- The formatter (never
null
).
- See Also:
setTickLabelFormatter(NumberFormat)
public double getTickLabelOffset()
Returns the tick label offset.
- Returns:
- The tick label offset.
- See Also:
setTickLabelOffset(double)
public Paint getTickLabelPaint()
Returns the paint used to draw the tick labels.
- Returns:
- The paint (
null
not permitted).
- See Also:
setTickLabelPaint(Paint)
public boolean getTickLabelsVisible()
Returnstrue
if the tick labels should be displayed, andfalse
otherwise.
- Returns:
- A boolean.
- See Also:
setTickLabelsVisible(boolean)
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:
setTickRadius(double)
public int hashCode()
Returns a hash code for this instance.
- Overrides:
- hashCode in interface AbstractDialLayer
- Returns:
- A hash code.
public boolean isClippedToWindow()
Returnstrue
to indicate that this layer should be clipped within the dial window.
- Specified by:
- isClippedToWindow in interface DialLayer
- Returns:
true
.
public void setExtent(double extent)
Sets the extent and sends aDialLayerChangeEvent
to all registered listeners.
- Parameters:
extent
- the extent.
- See Also:
getExtent()
public void setFirstTickLabelVisible(boolean visible)
Sets a flag that controls whether or not the first tick label is visible, and sends aDialLayerChangeEvent
to all registered listeners.
- Parameters:
visible
- the new flag value.
- See Also:
getFirstTickLabelVisible()
public void setMajorTickIncrement(double increment)
Sets the increment (in data units) between major tick labels and sends aDialLayerChangeEvent
to all registered listeners.
- Parameters:
increment
- the increment.
- See Also:
getMajorTickIncrement()
public void setMajorTickLength(double length)
Sets the length factor for the major tick marks and sends aDialLayerChangeEvent
to all registered listeners.
- Parameters:
length
- the length.
- See Also:
getMajorTickLength()
public void setMajorTickPaint(Paint paint)
Sets the major tick paint and sends aDialLayerChangeEvent
to all registered listeners.
- Parameters:
paint
- the paint (null
not permitted).
- See Also:
getMajorTickPaint()
public void setMajorTickStroke(Stroke stroke)
Sets the stroke used to draw the major tick marks and sends aDialLayerChangeEvent
to all registered listeners.
- Parameters:
stroke
- the stroke (null
not permitted).
- See Also:
getMajorTickStroke()
public void setMinorTickCount(int count)
Sets the number of minor tick marks between major tick marks and sends aDialLayerChangeEvent
to all registered listeners.
- Parameters:
count
- the count.
- See Also:
getMinorTickCount()
public void setMinorTickLength(double length)
Sets the length factor for the minor tick marks and sends aDialLayerChangeEvent
to all registered listeners.
- Parameters:
length
- the length.
- See Also:
getMinorTickLength()
public void setMinorTickPaint(Paint paint)
Sets the paint used to draw the minor tick marks and sends aDialLayerChangeEvent
to all registered listeners.
- Parameters:
paint
- the paint (null
not permitted).
- See Also:
getMinorTickPaint()
public void setStartAngle(double angle)
Sets the start angle for the scale and sends aDialLayerChangeEvent
to all registered listeners.
- Parameters:
angle
- the angle (in degrees).
- See Also:
getStartAngle()
public void setTickLabelFont(Font font)
Sets the font used to display the tick labels and sends aDialLayerChangeEvent
to all registered listeners.
- Parameters:
font
- the font (null
not permitted).
- See Also:
getTickLabelFont()
public void setTickLabelFormatter(NumberFormat formatter)
Sets the number formatter used to convert the tick label values to strings, and sends aDialLayerChangeEvent
to all registered listeners.
- Parameters:
formatter
- the formatter (null
not permitted).
- See Also:
getTickLabelFormatter()
public void setTickLabelOffset(double offset)
Sets the tick label offset and sends aDialLayerChangeEvent
to all registered listeners.
- Parameters:
offset
- the offset.
- See Also:
getTickLabelOffset()
public void setTickLabelPaint(Paint paint)
Sets the paint used to draw the tick labels and sends aDialLayerChangeEvent
to all registered listeners.
- Parameters:
paint
- the paint (null
not permitted).
public void setTickLabelsVisible(boolean visible)
Sets the flag that controls whether or not the tick labels are displayed, and sends aDialLayerChangeEvent
to all registered listeners.
- Parameters:
visible
- the new flag value.
- See Also:
getTickLabelsVisible()
public void setTickRadius(double radius)
Sets the tick radius and sends aDialLayerChangeEvent
to all registered listeners.
- Parameters:
radius
- the radius.
- See Also:
getTickRadius()
public double valueToAngle(double value)
Converts a data value to an angle against this scale.
- Specified by:
- valueToAngle in interface DialScale
- Parameters:
value
- the data value.
- Returns:
- The angle (in degrees, using the same specification as Java's Arc2D class).
- See Also:
angleToValue(double)