com.ijchart.xychart.annotation
Class AbstractAnnotation

java.lang.Object
  extended by com.ijchart.xychart.annotation.AbstractAnnotation
All Implemented Interfaces:
IAnnotation, IAnnotationChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
AbstractTextAnnotation, CategoryLineAnnotation, XYImageAnnotation, XYLineAnnotation, XYShapeAnnotation

public abstract class AbstractAnnotation
extends java.lang.Object
implements IAnnotation, java.lang.Cloneable, java.io.Serializable, IAnnotationChangeListener

Title: IJChart

A base class for handling the drawing of IAnnotation

Description: a chart library for the Java(tm) platform.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Constructor Summary
AbstractAnnotation()
           No argument constructor.
 
Method Summary
 void addChangeListener(IAnnotationChangeListener listener)
           Registers an object for notification of changes to the IAnnotation
 void annotationChanged(AnnotationChangeEvent event)
           Receives notification of an IAnnotation change event.
 java.lang.Object clone()
           Creates and returns a copy of this object.
 boolean equals(java.lang.Object obj)
           Indicates if some other object is "equal to" this one.
protected  void fireAnnotationChanged()
           Notifies all registered listeners that the annotation has changed.
 java.lang.String getTooltipText()
           Returns the tooltip text for annotation.
 int hashCode()
           Returns a hash code value for the object.
 boolean hasListener(IAnnotationChangeListener listener)
           Returns true if the specified object is registered with the IAnnotation as a listener.
protected  void notifyListeners(AnnotationChangeEvent event)
           Notifies all registered listeners that the annotation has changed.
 void removeAllChangeListener()
           Deregisters all object for notification of changes to the IAnnotation.
 void removeChangeListener(IAnnotationChangeListener listener)
           Deregisters an object for notification of changes to the IAnnotation.
 void setTooltipText(java.lang.String tooltipText)
           Sets the tooltip text for annotation and sends an AnnotationChangeEvent to all registered listeners.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAnnotation

public AbstractAnnotation()
No argument constructor.

Method Detail

getTooltipText

public java.lang.String getTooltipText()
Returns the tooltip text for annotation.

Returns:
String The tooltip text (maybe null).

setTooltipText

public void setTooltipText(java.lang.String tooltipText)
Sets the tooltip text for annotation and sends an AnnotationChangeEvent to all registered listeners.

Parameters:
tooltipText - String The tooltip text (null permitted)..

annotationChanged

public void annotationChanged(AnnotationChangeEvent event)
Receives notification of an IAnnotation change event.

Specified by:
annotationChanged in interface IAnnotationChangeListener
Parameters:
event - Information about the event.

addChangeListener

public void addChangeListener(IAnnotationChangeListener listener)
Registers an object for notification of changes to the IAnnotation

Parameters:
listener - the object to register.

removeChangeListener

public void removeChangeListener(IAnnotationChangeListener listener)
Deregisters an object for notification of changes to the IAnnotation.

Parameters:
listener - the object to deregister.

removeAllChangeListener

public void removeAllChangeListener()
Deregisters all object for notification of changes to the IAnnotation.


hasListener

public boolean hasListener(IAnnotationChangeListener listener)
Returns true if the specified object is registered with the IAnnotation as a listener. Most applications won't need to call this method, it exists mainly for use by unit testing code.

Parameters:
listener - the listener.
Returns:
A boolean.

fireAnnotationChanged

protected void fireAnnotationChanged()
Notifies all registered listeners that the annotation has changed.


notifyListeners

protected void notifyListeners(AnnotationChangeEvent event)
Notifies all registered listeners that the annotation has changed.

Parameters:
event - contains information about the event that triggered the notification.

equals

public boolean equals(java.lang.Object obj)
Indicates if some other object is "equal to" this one.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
int A hash code value for this object.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.

Overrides:
clone in class java.lang.Object
Returns:
object a clone of this instance.
Throws:
java.lang.CloneNotSupportedException - if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.