com.ijchart.xychart.annotation
Class CategoryTextAnnotation

java.lang.Object
  extended by com.ijchart.xychart.annotation.AbstractAnnotation
      extended by com.ijchart.xychart.annotation.AbstractTextAnnotation
          extended by com.ijchart.xychart.annotation.CategoryTextAnnotation
All Implemented Interfaces:
IAnnotation, ICategoryAnnotation, IAnnotationChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
CategoryTextAndPointerAnnotation

public class CategoryTextAnnotation
extends AbstractTextAnnotation
implements ICategoryAnnotation, java.lang.Cloneable, java.io.Serializable

Title: IJChart

用于CategoryPlot的文本注解(annotation)对象.

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

Field Summary
 
Fields inherited from class com.ijchart.xychart.annotation.AbstractTextAnnotation
DEFAULT_FONT, DEFAULT_PAINT, DEFAULT_ROTATION_ANGLE, DEFAULT_TEXT_DIRECTION, DEFAULT_TEXT_HORIZONTAL_ALIGNMENT, DEFAULT_TEXT_POSITION, DEFAULT_TEXT_VERTICAL_ALIGNMENT
 
Constructor Summary
CategoryTextAnnotation(java.lang.String text, java.lang.Object category, double value)
          根据分类(category)和y轴的值(value)来确定显示注解的位置.
 
Method Summary
 java.lang.Object clone()
          返回克隆的对象.
 void drawAnnotation(CategoryAxis categoryAxis, AbstractValueAxis valueAxis, RectangleEdge valueAxisEdge, java.awt.geom.Rectangle2D dataArea, ChartOrientation orientation, AnnotationShapeCollection annotationShapes)
          绘制注解(annotation)图形.
 boolean equals(java.lang.Object obj)
          测试两个对象是否相等.
 java.lang.Object getCategory()
          返回分类(category).
 double getValue()
          返回y轴的值.
 int hashCode()
          计算对象的hashcode值.
 void setCategory(java.lang.Object category)
          设置分类(category),并向所有监听器发送 AnnotationChangeEvent事件.
 void setValue(double value)
          设置y轴的值,并向所有监听器发送 AnnotationChangeEvent事件.
 java.lang.String toString()
          覆盖toString方法.
 
Methods inherited from class com.ijchart.xychart.annotation.AbstractTextAnnotation
getRotationAngle, getText, getTextDirection, getTextFont, getTextHorizontalAlign, getTextPaint, getTextPosition, getTextVerticalAlign, horizontalAlignToAnchor, setRotationAngle, setText, setTextDirection, setTextFont, setTextHorizontalAlign, setTextPaint, setTextPosition, setTextVerticalAlign
 
Methods inherited from class com.ijchart.xychart.annotation.AbstractAnnotation
addChangeListener, annotationChanged, fireAnnotationChanged, getTooltipText, hasListener, notifyListeners, removeAllChangeListener, removeChangeListener, setTooltipText
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CategoryTextAnnotation

public CategoryTextAnnotation(java.lang.String text,
                              java.lang.Object category,
                              double value)
根据分类(category)和y轴的值(value)来确定显示注解的位置.

Parameters:
text - String 注解的文字 (不可为null).
category - Object 分类(category) (不可为null).
value - double y轴的值.
Method Detail

getCategory

public java.lang.Object getCategory()
返回分类(category).

Returns:
分类(category) (不为null).

setCategory

public void setCategory(java.lang.Object category)
设置分类(category),并向所有监听器发送 AnnotationChangeEvent事件.

Parameters:
category - Object 分类(category) (不可为null).

getValue

public double getValue()
返回y轴的值.

Returns:
double y轴的值.

setValue

public void setValue(double value)
设置y轴的值,并向所有监听器发送 AnnotationChangeEvent事件.

Parameters:
value - y轴的值.

drawAnnotation

public void drawAnnotation(CategoryAxis categoryAxis,
                           AbstractValueAxis valueAxis,
                           RectangleEdge valueAxisEdge,
                           java.awt.geom.Rectangle2D dataArea,
                           ChartOrientation orientation,
                           AnnotationShapeCollection annotationShapes)
绘制注解(annotation)图形.

Specified by:
drawAnnotation in interface ICategoryAnnotation
Parameters:
categoryAxis - CategoryAxis category坐标轴 (不可为null).
valueAxis - AbstractValueAxis value坐标轴 (不可为null).
valueAxisEdge - RectangleEdge value坐标轴位置 (不可为null).
dataArea - Rectangle2D 数据区域 (不可为null).
orientation - ChartOrientation 图表的方向 (不可为null).
annotationShapes - AnnotationShapeCollection 注解(annotation)图形集合 (不可为null).

equals

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

Overrides:
equals in class AbstractTextAnnotation
Parameters:
obj - the object (null permitted).
Returns:
A boolean.

hashCode

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

Overrides:
hashCode in class AbstractTextAnnotation
Returns:
int 对象的hashcode值.

clone

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

Overrides:
clone in class AbstractTextAnnotation
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.

toString

public java.lang.String toString()
覆盖toString方法.

Overrides:
toString in class AbstractTextAnnotation
Returns:
a string representation of the object.