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

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()
          没有参数的构造器.
 
Method Summary
 void addChangeListener(IAnnotationChangeListener listener)
          注册监听注解(annotation)对象变化的监听者对象.
 void annotationChanged(AnnotationChangeEvent event)
          接收到注解(annotation)对象变化的通知.
 java.lang.Object clone()
          返回克隆的对象.
 boolean equals(java.lang.Object obj)
          测试两个对象是否相等.
protected  void fireAnnotationChanged()
          通过所有监听器注解(annotation)对象发生了变化.
 java.lang.String getTooltipText()
          返回annotation的提示字符.
 int hashCode()
          计算对象的hashcode值.
 boolean hasListener(IAnnotationChangeListener listener)
          返回指定的listener是否存在,本方法主要用于单元测试.
 void removeAllChangeListener()
          清除所有的注解(annotation)对象变化监听者对象.
 void removeChangeListener(IAnnotationChangeListener listener)
          删除注册的注解(annotation)对象变化监听者对象.
 void setTooltipText(java.lang.String tooltipText)
          设置annotation的提示字符,并向所有监听器发送 AnnotationChangeEvent事件.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAnnotation

public AbstractAnnotation()
没有参数的构造器.

Method Detail

getTooltipText

public java.lang.String getTooltipText()
返回annotation的提示字符.

Returns:
String 字符串 (可为null).

setTooltipText

public void setTooltipText(java.lang.String tooltipText)
设置annotation的提示字符,并向所有监听器发送 AnnotationChangeEvent事件.

Parameters:
tooltipText - String 字符串 (可为null).

annotationChanged

public void annotationChanged(AnnotationChangeEvent event)
接收到注解(annotation)对象变化的通知.

Specified by:
annotationChanged in interface IAnnotationChangeListener
Parameters:
event - 描述注解(annotation)对象变化的对象

addChangeListener

public void addChangeListener(IAnnotationChangeListener listener)
注册监听注解(annotation)对象变化的监听者对象.

Parameters:
listener - 注册的监听器对象.

removeChangeListener

public void removeChangeListener(IAnnotationChangeListener listener)
删除注册的注解(annotation)对象变化监听者对象.

Parameters:
listener - 要删除的监听者对象

removeAllChangeListener

public void removeAllChangeListener()
清除所有的注解(annotation)对象变化监听者对象.


hasListener

public boolean hasListener(IAnnotationChangeListener listener)
返回指定的listener是否存在,本方法主要用于单元测试.

Parameters:
listener - 要测试的监听器.
Returns:
A boolean.

fireAnnotationChanged

protected void fireAnnotationChanged()
通过所有监听器注解(annotation)对象发生了变化.


notifyListeners

protected void notifyListeners(AnnotationChangeEvent event)
通知所有注册的监听器注解(annotation)对象发生了变化.

Parameters:
event - 触发监听器的事件.

equals

public boolean equals(java.lang.Object obj)
测试两个对象是否相等.

Overrides:
equals in class java.lang.Object
Parameters:
obj - 要比较的对象
Returns:
相等返回true,否则返回false.

hashCode

public int hashCode()
计算对象的hashcode值.

Overrides:
hashCode in class java.lang.Object
Returns:
int 对象的hashcode值.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
返回克隆的对象.

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.