public class DialValueIndicator extends AbstractDialLayer implements DialLayer, java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable
DialPlot.| Modifier and Type | Field and Description |
|---|---|
private double |
angle
The angle that defines the anchor point.
|
private java.awt.Paint |
backgroundPaint
The background paint.
|
private int |
datasetIndex
The dataset index.
|
private java.awt.Font |
font
The font.
|
private java.text.NumberFormat |
formatter
The formatter.
|
private org.jfree.ui.RectangleAnchor |
frameAnchor
The frame anchor.
|
private org.jfree.ui.RectangleInsets |
insets
The insets.
|
private java.lang.Number |
maxTemplateValue
A data value that will be formatted to determine the maximum size of
the indicator bounds.
|
private java.awt.Paint |
outlinePaint
The outline paint.
|
private java.awt.Stroke |
outlineStroke
The outline stroke.
|
private java.awt.Paint |
paint
The paint.
|
private double |
radius
The radius that defines the anchor point.
|
(package private) static long |
serialVersionUID
For serialization.
|
private java.lang.Number |
templateValue
The template value.
|
private org.jfree.ui.TextAnchor |
textAnchor
The text anchor for displaying the value.
|
private org.jfree.ui.RectangleAnchor |
valueAnchor
The value anchor.
|
| Constructor and Description |
|---|
DialValueIndicator()
Creates a new instance of
DialValueIndicator. |
DialValueIndicator(int datasetIndex)
Creates a new instance of
DialValueIndicator. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Returns a clone of this instance.
|
void |
draw(java.awt.Graphics2D g2,
DialPlot plot,
java.awt.geom.Rectangle2D frame,
java.awt.geom.Rectangle2D view)
Draws the background to the specified graphics device.
|
boolean |
equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.
|
private double |
fixToRange(double x,
double minX,
double maxX)
A utility method that adjusts a value, if necessary, to be within a
specified range.
|
double |
getAngle()
Returns the angle for the anchor point.
|
java.awt.Paint |
getBackgroundPaint()
Returns the background paint.
|
int |
getDatasetIndex()
Returns the index of the dataset from which this indicator fetches its
current value.
|
java.awt.Font |
getFont()
Returns the font.
|
org.jfree.ui.RectangleAnchor |
getFrameAnchor()
Returns the frame anchor.
|
org.jfree.ui.RectangleInsets |
getInsets()
Returns the insets.
|
java.lang.Number |
getMaxTemplateValue()
Returns the template value for the maximum size of the indicator
bounds.
|
java.text.NumberFormat |
getNumberFormat()
Returns the formatter used to format the value.
|
java.awt.Paint |
getOutlinePaint()
Returns the outline paint.
|
java.awt.Stroke |
getOutlineStroke()
Returns the outline stroke.
|
java.awt.Paint |
getPaint()
Returns the paint.
|
double |
getRadius()
Returns the radius.
|
java.lang.Number |
getTemplateValue()
Returns the template value.
|
org.jfree.ui.TextAnchor |
getTextAnchor()
Returns the text anchor.
|
org.jfree.ui.RectangleAnchor |
getValueAnchor()
Returns the value anchor.
|
int |
hashCode()
Returns a hash code for this instance.
|
boolean |
isClippedToWindow()
Returns
true to indicate that this layer should be
clipped within the dial window. |
private void |
readObject(java.io.ObjectInputStream stream)
Provides serialization support.
|
void |
setAngle(double angle)
Sets the angle for the anchor point and sends a
DialLayerChangeEvent to all registered listeners. |
void |
setBackgroundPaint(java.awt.Paint paint)
Sets the background paint and sends a
DialLayerChangeEvent to
all registered listeners. |
void |
setDatasetIndex(int index)
Sets the dataset index and sends a
DialLayerChangeEvent to all
registered listeners. |
void |
setFont(java.awt.Font font)
Sets the font and sends a
DialLayerChangeEvent to all registered
listeners. |
void |
setFrameAnchor(org.jfree.ui.RectangleAnchor anchor)
Sets the frame anchor and sends a
DialLayerChangeEvent to all
registered listeners. |
void |
setInsets(org.jfree.ui.RectangleInsets insets)
Sets the insets and sends a
DialLayerChangeEvent to all
registered listeners. |
void |
setMaxTemplateValue(java.lang.Number value)
Sets the template value for the maximum size of the indicator bounds
and sends a
DialLayerChangeEvent to all registered listeners. |
void |
setNumberFormat(java.text.NumberFormat formatter)
Sets the formatter used to format the value and sends a
DialLayerChangeEvent to all registered listeners. |
void |
setOutlinePaint(java.awt.Paint paint)
Sets the outline paint and sends a
DialLayerChangeEvent to all
registered listeners. |
void |
setOutlineStroke(java.awt.Stroke stroke)
Sets the outline stroke and sends a
DialLayerChangeEvent to
all registered listeners. |
void |
setPaint(java.awt.Paint paint)
Sets the paint and sends a
DialLayerChangeEvent to all
registered listeners. |
void |
setRadius(double radius)
Sets the radius and sends a
DialLayerChangeEvent to all
registered listeners. |
void |
setTemplateValue(java.lang.Number value)
Sets the template value and sends a
DialLayerChangeEvent to
all registered listeners. |
void |
setTextAnchor(org.jfree.ui.TextAnchor anchor)
Sets the text anchor and sends a
DialLayerChangeEvent to all
registered listeners. |
void |
setValueAnchor(org.jfree.ui.RectangleAnchor anchor)
Sets the value anchor and sends a
DialLayerChangeEvent to all
registered listeners. |
private void |
writeObject(java.io.ObjectOutputStream stream)
Provides serialization support.
|
addChangeListener, hasListener, isVisible, notifyListeners, removeChangeListener, setVisiblefinalize, getClass, notify, notifyAll, toString, wait, wait, waitaddChangeListener, hasListener, isVisible, removeChangeListenerstatic final long serialVersionUID
private int datasetIndex
private double angle
private double radius
private org.jfree.ui.RectangleAnchor frameAnchor
private java.lang.Number templateValue
private java.lang.Number maxTemplateValue
private java.text.NumberFormat formatter
private java.awt.Font font
private transient java.awt.Paint paint
private transient java.awt.Paint backgroundPaint
private transient java.awt.Stroke outlineStroke
private transient java.awt.Paint outlinePaint
private org.jfree.ui.RectangleInsets insets
private org.jfree.ui.RectangleAnchor valueAnchor
private org.jfree.ui.TextAnchor textAnchor
public DialValueIndicator()
DialValueIndicator.public DialValueIndicator(int datasetIndex)
DialValueIndicator.datasetIndex - the dataset index.public int getDatasetIndex()
setDatasetIndex(int)public void setDatasetIndex(int index)
DialLayerChangeEvent to all
registered listeners.index - the index.getDatasetIndex()public double getAngle()
Arc2D class.setAngle(double)public void setAngle(double angle)
DialLayerChangeEvent to all registered listeners.angle - the angle (in degrees).getAngle()public double getRadius()
setRadius(double)public void setRadius(double radius)
DialLayerChangeEvent to all
registered listeners.radius - the radius.getRadius()public org.jfree.ui.RectangleAnchor getFrameAnchor()
setFrameAnchor(RectangleAnchor)public void setFrameAnchor(org.jfree.ui.RectangleAnchor anchor)
DialLayerChangeEvent to all
registered listeners.anchor - the anchor (null not permitted).getFrameAnchor()public java.lang.Number getTemplateValue()
null).setTemplateValue(Number)public void setTemplateValue(java.lang.Number value)
DialLayerChangeEvent to
all registered listeners.value - the value (null not permitted).setTemplateValue(Number)public java.lang.Number getMaxTemplateValue()
null).setMaxTemplateValue(java.lang.Number)public void setMaxTemplateValue(java.lang.Number value)
DialLayerChangeEvent to all registered listeners.value - the value (null permitted).getMaxTemplateValue()public java.text.NumberFormat getNumberFormat()
null).setNumberFormat(NumberFormat)public void setNumberFormat(java.text.NumberFormat formatter)
DialLayerChangeEvent to all registered listeners.formatter - the formatter (null not permitted).getNumberFormat()public java.awt.Font getFont()
null).getFont()public void setFont(java.awt.Font font)
DialLayerChangeEvent to all registered
listeners.font - the font (null not permitted).public java.awt.Paint getPaint()
null).setPaint(Paint)public void setPaint(java.awt.Paint paint)
DialLayerChangeEvent to all
registered listeners.paint - the paint (null not permitted).getPaint()public java.awt.Paint getBackgroundPaint()
setBackgroundPaint(Paint)public void setBackgroundPaint(java.awt.Paint paint)
DialLayerChangeEvent to
all registered listeners.paint - the paint (null not permitted).getBackgroundPaint()public java.awt.Stroke getOutlineStroke()
null).setOutlineStroke(Stroke)public void setOutlineStroke(java.awt.Stroke stroke)
DialLayerChangeEvent to
all registered listeners.stroke - the stroke (null not permitted).getOutlineStroke()public java.awt.Paint getOutlinePaint()
null).setOutlinePaint(Paint)public void setOutlinePaint(java.awt.Paint paint)
DialLayerChangeEvent to all
registered listeners.paint - the paint (null not permitted).getOutlinePaint()public org.jfree.ui.RectangleInsets getInsets()
null).setInsets(RectangleInsets)public void setInsets(org.jfree.ui.RectangleInsets insets)
DialLayerChangeEvent to all
registered listeners.insets - the insets (null not permitted).getInsets()public org.jfree.ui.RectangleAnchor getValueAnchor()
null).setValueAnchor(RectangleAnchor)public void setValueAnchor(org.jfree.ui.RectangleAnchor anchor)
DialLayerChangeEvent to all
registered listeners.anchor - the anchor (null not permitted).getValueAnchor()public org.jfree.ui.TextAnchor getTextAnchor()
null).setTextAnchor(TextAnchor)public void setTextAnchor(org.jfree.ui.TextAnchor anchor)
DialLayerChangeEvent to all
registered listeners.anchor - the anchor (null not permitted).getTextAnchor()public boolean isClippedToWindow()
true to indicate that this layer should be
clipped within the dial window.isClippedToWindow in interface DialLayertrue.public void draw(java.awt.Graphics2D g2,
DialPlot plot,
java.awt.geom.Rectangle2D frame,
java.awt.geom.Rectangle2D view)
private double fixToRange(double x,
double minX,
double maxX)
x - the value.minX - the minimum value in the range.maxX - the maximum value in the range.public boolean equals(java.lang.Object obj)
equals in class AbstractDialLayerobj - the object (null permitted).public int hashCode()
hashCode in class AbstractDialLayerpublic java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface org.jfree.util.PublicCloneableclone in class AbstractDialLayerjava.lang.CloneNotSupportedException - if some attribute of this instance
cannot be cloned.private void writeObject(java.io.ObjectOutputStream stream)
throws java.io.IOException
stream - the output stream.java.io.IOException - if there is an I/O error.private void readObject(java.io.ObjectInputStream stream)
throws java.io.IOException,
java.lang.ClassNotFoundException
stream - the input stream.java.io.IOException - if there is an I/O error.java.lang.ClassNotFoundException - if there is a classpath problem.