com.ijchart.xychart.annotation
Class CategoryTextAndPointerAnnotation

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

public class CategoryTextAndPointerAnnotation
extends CategoryTextAnnotation
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
static double DEFAULT_ARROW_ANGLE
          缺省的箭头的角度(单位是弧度).
static double DEFAULT_ARROW_LENGTH
          缺省的箭头的长度.
static java.awt.Paint DEFAULT_ARROW_PAINT
          缺省的绘制箭头的paint对象.
static java.awt.Stroke DEFAULT_ARROW_STROKE
          缺省的绘制箭头的stroke对象.
static double DEFAULT_ARROW_WIDTH
          缺省的每边箭头的宽度.
static double DEFAULT_BASE_RADIUS
          缺省的箭柄的长度.
static double DEFAULT_LABEL_OFFSET
          缺省的文本和箭柄的距离.
 
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
CategoryTextAndPointerAnnotation(java.lang.String text, java.lang.Object category, double value)
          根据分类(category)和y轴的值(value)来确定显示注解的位置.
CategoryTextAndPointerAnnotation(java.lang.String text, java.lang.Object category, double value, double arrowAngle)
          根据分类(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)
          测试两个对象是否相等.
 double getArrowAngle()
          箭头的角度(单位是弧度).
 double getArrowLength()
          返回箭头的长度.
 java.awt.Paint getArrowPaint()
          返回绘制箭头的paint对象.
 java.awt.Stroke getArrowStroke()
          返回绘制箭头的stroke对象.
 double getArrowWidth()
          返回每边箭头的宽度.
 double getBaseRadius()
          返回箭柄的长度.
 double getLabelOffset()
          返回文本和箭柄的距离.
 int hashCode()
          计算对象的hashcode值.
 void setArrowAngle(double angle)
          设置箭头的角度,并向所有监听器发送 AnnotationChangeEvent事件.
 void setArrowLength(double length)
          设置箭头的长度,并向所有监听器发送 AnnotationChangeEvent事件.
 void setArrowPaint(java.awt.Paint paint)
          设置绘制箭头的paint对象,并向所有监听器发送 AnnotationChangeEvent事件.
 void setArrowStroke(java.awt.Stroke stroke)
          设置绘制箭头的stroke对象,并向所有监听器发送 AnnotationChangeEvent事件.
 void setArrowWidth(double width)
          设置每边箭头的宽度,并向所有监听器发送 AnnotationChangeEvent事件.
 void setBaseRadius(double radius)
          设置箭柄的长度,并向所有监听器发送 AnnotationChangeEvent事件.
 void setLabelOffset(double offset)
          设置文本和箭柄的距离,并向所有监听器发送 AnnotationChangeEvent事件.
 java.lang.String toString()
          覆盖toString方法.
 
Methods inherited from class com.ijchart.xychart.annotation.CategoryTextAnnotation
getCategory, getValue, setCategory, setValue
 
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
 

Field Detail

DEFAULT_ARROW_ANGLE

public static final double DEFAULT_ARROW_ANGLE
缺省的箭头的角度(单位是弧度).

See Also:
Constant Field Values

DEFAULT_BASE_RADIUS

public static final double DEFAULT_BASE_RADIUS
缺省的箭柄的长度.

See Also:
Constant Field Values

DEFAULT_ARROW_LENGTH

public static final double DEFAULT_ARROW_LENGTH
缺省的箭头的长度.

See Also:
Constant Field Values

DEFAULT_ARROW_WIDTH

public static final double DEFAULT_ARROW_WIDTH
缺省的每边箭头的宽度.

See Also:
Constant Field Values

DEFAULT_ARROW_PAINT

public static final java.awt.Paint DEFAULT_ARROW_PAINT
缺省的绘制箭头的paint对象.


DEFAULT_ARROW_STROKE

public static final java.awt.Stroke DEFAULT_ARROW_STROKE
缺省的绘制箭头的stroke对象.


DEFAULT_LABEL_OFFSET

public static final double DEFAULT_LABEL_OFFSET
缺省的文本和箭柄的距离.

See Also:
Constant Field Values
Constructor Detail

CategoryTextAndPointerAnnotation

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

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

CategoryTextAndPointerAnnotation

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

Parameters:
text - String 注解的文字 (不可为null).
category - Object 分类(category) (不可为null).
value - double y轴的值.
arrowAngle - 箭头的角度(单位是弧度).
Method Detail

getArrowAngle

public double getArrowAngle()
箭头的角度(单位是弧度).

Returns:
double 角度.

setArrowAngle

public void setArrowAngle(double angle)
设置箭头的角度,并向所有监听器发送 AnnotationChangeEvent事件.

Parameters:
angle - double 角度 (单位是弧度).

getBaseRadius

public double getBaseRadius()
返回箭柄的长度.

Returns:
double 箭柄的长度.

setBaseRadius

public void setBaseRadius(double radius)
设置箭柄的长度,并向所有监听器发送 AnnotationChangeEvent事件.

Parameters:
radius - double 箭柄的长度.

getArrowLength

public double getArrowLength()
返回箭头的长度.

Returns:
double 箭头的长度.

setArrowLength

public void setArrowLength(double length)
设置箭头的长度,并向所有监听器发送 AnnotationChangeEvent事件.

Parameters:
length - double 箭头的长度.

getArrowWidth

public double getArrowWidth()
返回每边箭头的宽度.

Returns:
double 箭头的宽度.

setArrowWidth

public void setArrowWidth(double width)
设置每边箭头的宽度,并向所有监听器发送 AnnotationChangeEvent事件.

Parameters:
width - double 箭头的宽度.

getLabelOffset

public double getLabelOffset()
返回文本和箭柄的距离.

Returns:
double 文本和箭柄的距离.

setLabelOffset

public void setLabelOffset(double offset)
设置文本和箭柄的距离,并向所有监听器发送 AnnotationChangeEvent事件.

Parameters:
offset - double 文本和箭柄的距离.

getArrowPaint

public java.awt.Paint getArrowPaint()
返回绘制箭头的paint对象.

Returns:
Paint paint对象 (不为null).

setArrowPaint

public void setArrowPaint(java.awt.Paint paint)
设置绘制箭头的paint对象,并向所有监听器发送 AnnotationChangeEvent事件.

Parameters:
paint - Paint paint对象 (不可为null).

getArrowStroke

public java.awt.Stroke getArrowStroke()
返回绘制箭头的stroke对象.

Returns:
Stroke stroke对象 (不为null).

setArrowStroke

public void setArrowStroke(java.awt.Stroke stroke)
设置绘制箭头的stroke对象,并向所有监听器发送 AnnotationChangeEvent事件.

Parameters:
stroke - Stroke stroke对象 (不可为null).

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
Overrides:
drawAnnotation in class CategoryTextAnnotation
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 CategoryTextAnnotation
Parameters:
obj - the object (null permitted).
Returns:
A boolean.

hashCode

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

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

clone

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

Overrides:
clone in class CategoryTextAnnotation
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 CategoryTextAnnotation
Returns:
a string representation of the object.