Package org.jfree.chart.plot.dial
Class DialPointer
- java.lang.Object
-
- org.jfree.chart.plot.dial.AbstractDialLayer
-
- org.jfree.chart.plot.dial.DialPointer
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,DialLayer,PublicCloneable
- Direct Known Subclasses:
DialPointer.Pin,DialPointer.Pointer
public abstract class DialPointer extends AbstractDialLayer implements DialLayer, java.lang.Cloneable, PublicCloneable, java.io.Serializable
A base class for the pointer in aDialPlot.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDialPointer.PinA dial pointer that draws a thin line (like a pin).static classDialPointer.PointerA dial pointer.
-
Field Summary
Fields Modifier and Type Field Description (package private) intdatasetIndexThe dataset index for the needle.(package private) doubleradiusThe needle radius.
-
Constructor Summary
Constructors Modifier Constructor Description protectedDialPointer()Creates a newDialPointerinstance.protectedDialPointer(int datasetIndex)Creates a new pointer for the specified dataset.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns a clone of the pointer.booleanequals(java.lang.Object obj)Checks this instance for equality with an arbitrary object.intgetDatasetIndex()Returns the dataset index that the pointer maps to.doublegetRadius()Returns the radius of the pointer, as a percentage of the dial's framing rectangle.inthashCode()Returns a hash code.booleanisClippedToWindow()Returnstrueto indicate that this layer should be clipped within the dial window.voidsetDatasetIndex(int index)Sets the dataset index for the pointer and sends aDialLayerChangeEventto all registered listeners.voidsetRadius(double radius)Sets the radius of the pointer 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, draw, hasListener, isVisible, removeChangeListener
-
-
-
-
Method Detail
-
getDatasetIndex
public int getDatasetIndex()
Returns the dataset index that the pointer maps to.- Returns:
- The dataset index.
- See Also:
getDatasetIndex()
-
setDatasetIndex
public void setDatasetIndex(int index)
Sets the dataset index for the pointer and sends aDialLayerChangeEventto all registered listeners.- Parameters:
index- the index.- See Also:
getDatasetIndex()
-
getRadius
public double getRadius()
Returns the radius of the pointer, as a percentage of the dial's framing rectangle.- Returns:
- The radius.
- See Also:
setRadius(double)
-
setRadius
public void setRadius(double radius)
Sets the radius of the pointer and sends aDialLayerChangeEventto all registered listeners.- Parameters:
radius- the radius.- See Also:
getRadius()
-
isClippedToWindow
public boolean isClippedToWindow()
Returnstrueto indicate that this layer should be clipped within the dial window.- Specified by:
isClippedToWindowin interfaceDialLayer- Returns:
true.
-
equals
public boolean equals(java.lang.Object obj)
Checks this instance for equality with an arbitrary object.- Overrides:
equalsin classAbstractDialLayer- Parameters:
obj- the object (nullnot permitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
Returns a hash code.- Overrides:
hashCodein classAbstractDialLayer- Returns:
- A hash code.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of the pointer.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDialLayer- Returns:
- a clone.
- Throws:
java.lang.CloneNotSupportedException- if one of the attributes cannot be cloned.
-
-