- java.lang.Object
-
- org.jfree.chart.plot.dial.AbstractDialLayer
-
- All Implemented Interfaces:
DialLayer
- Direct Known Subclasses:
ArcDialFrame,DialBackground,DialCap,DialPointer,DialTextAnnotation,DialValueIndicator,StandardDialFrame,StandardDialRange,StandardDialScale
public abstract class AbstractDialLayer extends Object implements DialLayer
A base class that can be used to implement aDialLayer. It includes an event notification mechanism.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDialLayer()Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChangeListener(DialLayerChangeListener listener)Registers an object for notification of changes to the dial layer.Objectclone()Returns a clone of this instance.booleanequals(Object obj)Tests this instance for equality with an arbitrary object.inthashCode()Returns a hash code for this instance.booleanhasListener(EventListener listener)Returnstrueif the specified object is registered with the dataset as a listener.booleanisVisible()Returnstrueif this layer is visible (should be displayed), andfalseotherwise.protected voidnotifyListeners(DialLayerChangeEvent event)Notifies all registered listeners that the dial layer has changed.voidremoveChangeListener(DialLayerChangeListener listener)Deregisters an object for notification of changes to the dial layer.voidsetVisible(boolean visible)Sets the flag that determines whether or not this layer is drawn by the plot, and sends aDialLayerChangeEventto all registered listeners.-
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
draw, isClippedToWindow
-
-
-
-
Constructor Detail
-
AbstractDialLayer
protected AbstractDialLayer()
Creates a new instance.
-
-
Method Detail
-
isVisible
public boolean isVisible()
Returnstrueif this layer is visible (should be displayed), andfalseotherwise.- Specified by:
isVisiblein interfaceDialLayer- Returns:
- A boolean.
- See Also:
setVisible(boolean)
-
setVisible
public void setVisible(boolean visible)
Sets the flag that determines whether or not this layer is drawn by the plot, and sends aDialLayerChangeEventto all registered listeners.- Parameters:
visible- the flag.- See Also:
isVisible()
-
equals
public boolean equals(Object obj)
Tests this instance for equality with an arbitrary object.
-
hashCode
public int hashCode()
Returns a hash code for this instance.
-
clone
public Object clone() throws CloneNotSupportedException
Returns a clone of this instance.- Overrides:
clonein classObject- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if there is a problem cloning this instance.
-
addChangeListener
public void addChangeListener(DialLayerChangeListener listener)
Registers an object for notification of changes to the dial layer.- Specified by:
addChangeListenerin interfaceDialLayer- Parameters:
listener- the object that is being registered.- See Also:
removeChangeListener(DialLayerChangeListener)
-
removeChangeListener
public void removeChangeListener(DialLayerChangeListener listener)
Deregisters an object for notification of changes to the dial layer.- Specified by:
removeChangeListenerin interfaceDialLayer- Parameters:
listener- the object to deregister.- See Also:
addChangeListener(DialLayerChangeListener)
-
hasListener
public boolean hasListener(EventListener listener)
Returnstrueif the specified object is registered with the dataset as a listener. Most applications won't need to call this method, it exists mainly for use by unit testing code.- Specified by:
hasListenerin interfaceDialLayer- Parameters:
listener- the listener.- Returns:
- A boolean.
-
notifyListeners
protected void notifyListeners(DialLayerChangeEvent event)
Notifies all registered listeners that the dial layer has changed. TheDialLayerChangeEventprovides information about the change.- Parameters:
event- information about the change to the axis.
-
-