com.ijchart.xychart.annotation
Class XYShapeAnnotation

java.lang.Object
  extended by com.ijchart.xychart.annotation.AbstractAnnotation
      extended by com.ijchart.xychart.annotation.XYShapeAnnotation
All Implemented Interfaces:
IAnnotation, IXYAnnotation, IAnnotationChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

public class XYShapeAnnotation
extends AbstractAnnotation
implements IXYAnnotation, java.lang.Cloneable, java.io.Serializable

Title: IJChart

用于XYPlot的图形注解对象.

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 java.awt.Paint DEFAULT_BORDER_PAINT
          缺省的绘制图形边框的paint对象.
static java.awt.Stroke DEFAULT_BORDER_STROKE
          缺省的绘制图形边框的stroke对象.
 
Constructor Summary
XYShapeAnnotation(java.awt.Shape shape)
          根据图形的坐标确定注解的位置.
XYShapeAnnotation(java.awt.Shape shape, java.awt.Paint borderPaint, java.awt.Stroke borderStroke)
          根据图形的坐标确定注解的位置.
XYShapeAnnotation(java.awt.Shape shape, java.awt.Paint borderPaint, java.awt.Stroke borderStroke, java.awt.Paint fillPaint)
          根据图形的坐标确定注解的位置.
 
Method Summary
 java.lang.Object clone()
          返回克隆的对象.
 void drawAnnotation(AbstractValueAxis xAxis, RectangleEdge xAxisEdge, AbstractValueAxis yAxis, RectangleEdge yAxisEdge, java.awt.geom.Rectangle2D dataArea, ChartOrientation orientation, AnnotationShapeCollection annotationShapes)
          绘制注解(annotation)图形.
 boolean equals(java.lang.Object obj)
          测试两个对象是否相等.
 java.awt.Paint getBorderPaint()
          返回绘制图形边框的paint对象.
 java.awt.Stroke getBorderStroke()
          返回绘制图形边框的stroke对象.
 java.awt.Paint getFillPaint()
          返回填充图形用的paint对象.
 java.awt.Shape getShape()
          返回图形对象.
 int hashCode()
          计算对象的hashcode值.
 void setBorderPaint(java.awt.Paint paint)
          设置绘制图形边框的paint对象,并向所有监听器发送 AnnotationChangeEvent事件.
 void setBorderStroke(java.awt.Stroke stroke)
          设置绘制图形边框的stroke对象,并向所有监听器发送 AnnotationChangeEvent事件.
 void setFillPaint(java.awt.Paint paint)
          填充图形用的paint对象,并向所有监听器发送 AnnotationChangeEvent事件.
 void setShape(java.awt.Shape shape)
          设置图形对象,并向所有监听器发送 AnnotationChangeEvent事件.
 java.lang.String toString()
          覆盖toString方法.
 
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_BORDER_PAINT

public static final java.awt.Paint DEFAULT_BORDER_PAINT
缺省的绘制图形边框的paint对象.


DEFAULT_BORDER_STROKE

public static final java.awt.Stroke DEFAULT_BORDER_STROKE
缺省的绘制图形边框的stroke对象.

Constructor Detail

XYShapeAnnotation

public XYShapeAnnotation(java.awt.Shape shape)
根据图形的坐标确定注解的位置.

Parameters:
shape - Shape 图形 (不可为null).

XYShapeAnnotation

public XYShapeAnnotation(java.awt.Shape shape,
                         java.awt.Paint borderPaint,
                         java.awt.Stroke borderStroke)
根据图形的坐标确定注解的位置.

Parameters:
shape - Shape 图形 (不可为null).
borderPaint - Paint 绘制图形边框的paint对象 (可为null).
borderStroke - Stroke 绘制图形边框的stroke对象 (可为null).

XYShapeAnnotation

public XYShapeAnnotation(java.awt.Shape shape,
                         java.awt.Paint borderPaint,
                         java.awt.Stroke borderStroke,
                         java.awt.Paint fillPaint)
根据图形的坐标确定注解的位置.

Parameters:
shape - Shape 图形 (不可为null).
borderPaint - Paint 绘制图形边框的paint对象 (可为null).
borderStroke - Stroke 绘制图形边框的stroke对象 (可为null).
fillPaint - Paint 填充图形用的paint对象 (可为null).
Method Detail

getShape

public java.awt.Shape getShape()
返回图形对象.

Returns:
Shape 图形 (不为null).

setShape

public void setShape(java.awt.Shape shape)
设置图形对象,并向所有监听器发送 AnnotationChangeEvent事件.

Parameters:
shape - Shape 图形 (不可为null).

getBorderPaint

public java.awt.Paint getBorderPaint()
返回绘制图形边框的paint对象.

Returns:
Paint paint对象 (可能为null).

setBorderPaint

public void setBorderPaint(java.awt.Paint paint)
设置绘制图形边框的paint对象,并向所有监听器发送 AnnotationChangeEvent事件.

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

getBorderStroke

public java.awt.Stroke getBorderStroke()
返回绘制图形边框的stroke对象.

Returns:
Stroke stroke对象 (可能为null).

setBorderStroke

public void setBorderStroke(java.awt.Stroke stroke)
设置绘制图形边框的stroke对象,并向所有监听器发送 AnnotationChangeEvent事件.

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

getFillPaint

public java.awt.Paint getFillPaint()
返回填充图形用的paint对象.

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

setFillPaint

public void setFillPaint(java.awt.Paint paint)
填充图形用的paint对象,并向所有监听器发送 AnnotationChangeEvent事件.

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

drawAnnotation

public void drawAnnotation(AbstractValueAxis xAxis,
                           RectangleEdge xAxisEdge,
                           AbstractValueAxis yAxis,
                           RectangleEdge yAxisEdge,
                           java.awt.geom.Rectangle2D dataArea,
                           ChartOrientation orientation,
                           AnnotationShapeCollection annotationShapes)
绘制注解(annotation)图形.

Specified by:
drawAnnotation in interface IXYAnnotation
Parameters:
xAxis - AbstractValueAxis x坐标轴 (不可为null).
xAxisEdge - RectangleEdge x坐标轴位置 (不可为null).
yAxis - AbstractValueAxis y坐标轴 (不可为null).
yAxisEdge - RectangleEdge y坐标轴位置 (不可为null).
dataArea - Rectangle2D 数据区域 (不可为null).
orientation - ChartOrientation 图表的方向 (不可为null).
annotationShapes - AnnotationShapeCollection 注解(annotation)图形集合 (不可为null).

equals

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

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

hashCode

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

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

clone

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

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