- java.lang.Object
-
- org.jfree.chart.plot.dial.AbstractDialLayer
-
- org.jfree.chart.plot.dial.DialValueIndicator
-
- All Implemented Interfaces:
Serializable,Cloneable,PublicCloneable,DialLayer
public class DialValueIndicator extends AbstractDialLayer implements DialLayer, Cloneable, PublicCloneable, Serializable
A value indicator for aDialPlot.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DialValueIndicator()Creates a new instance ofDialValueIndicator.DialValueIndicator(int datasetIndex)Creates a new instance ofDialValueIndicator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()Returns a clone of this instance.voiddraw(Graphics2D g2, DialPlot plot, Rectangle2D frame, Rectangle2D view)Draws the background to the specified graphics device.booleanequals(Object obj)Tests this instance for equality with an arbitrary object.doublegetAngle()Returns the angle for the anchor point.PaintgetBackgroundPaint()Returns the background paint.intgetDatasetIndex()Returns the index of the dataset from which this indicator fetches its current value.FontgetFont()Returns the font.RectangleAnchorgetFrameAnchor()Returns the frame anchor.RectangleInsetsgetInsets()Returns the insets.NumbergetMaxTemplateValue()Returns the template value for the maximum size of the indicator bounds.NumberFormatgetNumberFormat()Returns the formatter used to format the value.PaintgetOutlinePaint()Returns the outline paint.StrokegetOutlineStroke()Returns the outline stroke.PaintgetPaint()Returns the paint.doublegetRadius()Returns the radius.NumbergetTemplateValue()Returns the template value.TextAnchorgetTextAnchor()Returns the text anchor.RectangleAnchorgetValueAnchor()Returns the value anchor.inthashCode()Returns a hash code for this instance.booleanisClippedToWindow()Returnstrueto indicate that this layer should be clipped within the dial window.voidsetAngle(double angle)Sets the angle for the anchor point and sends aDialLayerChangeEventto all registered listeners.voidsetBackgroundPaint(Paint paint)Sets the background paint and sends aDialLayerChangeEventto all registered listeners.voidsetDatasetIndex(int index)Sets the dataset index and sends aDialLayerChangeEventto all registered listeners.voidsetFont(Font font)Sets the font and sends aDialLayerChangeEventto all registered listeners.voidsetFrameAnchor(RectangleAnchor anchor)Sets the frame anchor and sends aDialLayerChangeEventto all registered listeners.voidsetInsets(RectangleInsets insets)Sets the insets and sends aDialLayerChangeEventto all registered listeners.voidsetMaxTemplateValue(Number value)Sets the template value for the maximum size of the indicator bounds and sends aDialLayerChangeEventto all registered listeners.voidsetNumberFormat(NumberFormat formatter)Sets the formatter used to format the value and sends aDialLayerChangeEventto all registered listeners.voidsetOutlinePaint(Paint paint)Sets the outline paint and sends aDialLayerChangeEventto all registered listeners.voidsetOutlineStroke(Stroke stroke)Sets the outline stroke and sends aDialLayerChangeEventto all registered listeners.voidsetPaint(Paint paint)Sets the paint and sends aDialLayerChangeEventto all registered listeners.voidsetRadius(double radius)Sets the radius and sends aDialLayerChangeEventto all registered listeners.voidsetTemplateValue(Number value)Sets the template value and sends aDialLayerChangeEventto all registered listeners.voidsetTextAnchor(TextAnchor anchor)Sets the text anchor and sends aDialLayerChangeEventto all registered listeners.voidsetValueAnchor(RectangleAnchor anchor)Sets the value anchor and sends aDialLayerChangeEventto all registered listeners.-
Methods inherited from class org.jfree.chart.plot.dial.AbstractDialLayer
addChangeListener, hasListener, isVisible, notifyListeners, removeChangeListener, setVisible
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jfree.chart.plot.dial.DialLayer
addChangeListener, hasListener, isVisible, removeChangeListener
-
-
-
-
Constructor Detail
-
DialValueIndicator
public DialValueIndicator()
Creates a new instance ofDialValueIndicator.
-
DialValueIndicator
public DialValueIndicator(int datasetIndex)
Creates a new instance ofDialValueIndicator.- Parameters:
datasetIndex- the dataset index.
-
-
Method Detail
-
getDatasetIndex
public int getDatasetIndex()
Returns the index of the dataset from which this indicator fetches its current value.- Returns:
- The dataset index.
- See Also:
setDatasetIndex(int)
-
setDatasetIndex
public void setDatasetIndex(int index)
Sets the dataset index and sends aDialLayerChangeEventto all registered listeners.- Parameters:
index- the index.- See Also:
getDatasetIndex()
-
getAngle
public double getAngle()
Returns the angle for the anchor point. The angle is specified in degrees using the same orientation as Java'sArc2Dclass.- Returns:
- The angle (in degrees).
- See Also:
setAngle(double)
-
setAngle
public void setAngle(double angle)
Sets the angle for the anchor point and sends aDialLayerChangeEventto all registered listeners.- Parameters:
angle- the angle (in degrees).- See Also:
getAngle()
-
getRadius
public double getRadius()
Returns the radius.- Returns:
- The radius.
- See Also:
setRadius(double)
-
setRadius
public void setRadius(double radius)
Sets the radius and sends aDialLayerChangeEventto all registered listeners.- Parameters:
radius- the radius.- See Also:
getRadius()
-
getFrameAnchor
public RectangleAnchor getFrameAnchor()
Returns the frame anchor.- Returns:
- The frame anchor.
- See Also:
setFrameAnchor(RectangleAnchor)
-
setFrameAnchor
public void setFrameAnchor(RectangleAnchor anchor)
Sets the frame anchor and sends aDialLayerChangeEventto all registered listeners.- Parameters:
anchor- the anchor (nullnot permitted).- See Also:
getFrameAnchor()
-
getTemplateValue
public Number getTemplateValue()
Returns the template value.- Returns:
- The template value (never
null). - See Also:
setTemplateValue(Number)
-
setTemplateValue
public void setTemplateValue(Number value)
Sets the template value and sends aDialLayerChangeEventto all registered listeners.- Parameters:
value- the value (nullnot permitted).- See Also:
setTemplateValue(Number)
-
getMaxTemplateValue
public Number getMaxTemplateValue()
Returns the template value for the maximum size of the indicator bounds.- Returns:
- The template value (possibly
null). - See Also:
setMaxTemplateValue(java.lang.Number)
-
setMaxTemplateValue
public void setMaxTemplateValue(Number value)
Sets the template value for the maximum size of the indicator bounds and sends aDialLayerChangeEventto all registered listeners.- Parameters:
value- the value (nullpermitted).- See Also:
getMaxTemplateValue()
-
getNumberFormat
public NumberFormat getNumberFormat()
Returns the formatter used to format the value.- Returns:
- The formatter (never
null). - See Also:
setNumberFormat(NumberFormat)
-
setNumberFormat
public void setNumberFormat(NumberFormat formatter)
Sets the formatter used to format the value and sends aDialLayerChangeEventto all registered listeners.- Parameters:
formatter- the formatter (nullnot permitted).- See Also:
getNumberFormat()
-
setFont
public void setFont(Font font)
Sets the font and sends aDialLayerChangeEventto all registered listeners.- Parameters:
font- the font (nullnot permitted).
-
getPaint
public Paint getPaint()
Returns the paint.- Returns:
- The paint (never
null). - See Also:
setPaint(Paint)
-
setPaint
public void setPaint(Paint paint)
Sets the paint and sends aDialLayerChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
getPaint()
-
getBackgroundPaint
public Paint getBackgroundPaint()
Returns the background paint.- Returns:
- The background paint.
- See Also:
setBackgroundPaint(Paint)
-
setBackgroundPaint
public void setBackgroundPaint(Paint paint)
Sets the background paint and sends aDialLayerChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
getBackgroundPaint()
-
getOutlineStroke
public Stroke getOutlineStroke()
Returns the outline stroke.- Returns:
- The outline stroke (never
null). - See Also:
setOutlineStroke(Stroke)
-
setOutlineStroke
public void setOutlineStroke(Stroke stroke)
Sets the outline stroke and sends aDialLayerChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- See Also:
getOutlineStroke()
-
getOutlinePaint
public Paint getOutlinePaint()
Returns the outline paint.- Returns:
- The outline paint (never
null). - See Also:
setOutlinePaint(Paint)
-
setOutlinePaint
public void setOutlinePaint(Paint paint)
Sets the outline paint and sends aDialLayerChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
getOutlinePaint()
-
getInsets
public RectangleInsets getInsets()
Returns the insets.- Returns:
- The insets (never
null). - See Also:
setInsets(RectangleInsets)
-
setInsets
public void setInsets(RectangleInsets insets)
Sets the insets and sends aDialLayerChangeEventto all registered listeners.- Parameters:
insets- the insets (nullnot permitted).- See Also:
getInsets()
-
getValueAnchor
public RectangleAnchor getValueAnchor()
Returns the value anchor.- Returns:
- The value anchor (never
null). - See Also:
setValueAnchor(RectangleAnchor)
-
setValueAnchor
public void setValueAnchor(RectangleAnchor anchor)
Sets the value anchor and sends aDialLayerChangeEventto all registered listeners.- Parameters:
anchor- the anchor (nullnot permitted).- See Also:
getValueAnchor()
-
getTextAnchor
public TextAnchor getTextAnchor()
Returns the text anchor.- Returns:
- The text anchor (never
null). - See Also:
setTextAnchor(TextAnchor)
-
setTextAnchor
public void setTextAnchor(TextAnchor anchor)
Sets the text anchor and sends aDialLayerChangeEventto all registered listeners.- Parameters:
anchor- the anchor (nullnot permitted).- See Also:
getTextAnchor()
-
isClippedToWindow
public boolean isClippedToWindow()
Returnstrueto indicate that this layer should be clipped within the dial window.- Specified by:
isClippedToWindowin interfaceDialLayer- Returns:
true.
-
draw
public void draw(Graphics2D g2, DialPlot plot, Rectangle2D frame, Rectangle2D view)
Draws the background to the specified graphics device. If the dial frame specifies a window, the clipping region will already have been set to this window before this method is called.
-
equals
public boolean equals(Object obj)
Tests this instance for equality with an arbitrary object.- Overrides:
equalsin classAbstractDialLayer- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
Returns a hash code for this instance.- Overrides:
hashCodein classAbstractDialLayer- Returns:
- The hash code.
-
clone
public Object clone() throws CloneNotSupportedException
Returns a clone of this instance.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDialLayer- Returns:
- The clone.
- Throws:
CloneNotSupportedException- if some attribute of this instance cannot be cloned.
-
-