com.ijchart.xychart.annotation
Class XYImageAnnotation

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

public class XYImageAnnotation
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

Constructor Summary
XYImageAnnotation(double x, double y, java.awt.Image image)
          根据x坐标和y坐标确定图片的位置.
XYImageAnnotation(double x, double y, java.awt.Image image, int imageWidth, int imageHeight)
          根据x坐标和y坐标确定图片的位置.
 
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.Image getImage()
          返回图形对象.
 int getImageHeight()
          返回图片的高度.
 int getImageWidth()
          返回图片的宽度.
 double getX()
          返回图片的x坐标.
 double getY()
          返回图片的y坐标.
 int hashCode()
          计算对象的hashcode值.
 void setImage(java.awt.Image image)
          设置图形对象,并向所有监听器发送 AnnotationChangeEvent事件.
 void setImageHeight(int height)
          设置图片的高度,并向所有监听器发送 AnnotationChangeEvent事件.
 void setImageWidth(int width)
          设置图片的宽度,并向所有监听器发送 AnnotationChangeEvent事件.
 void setX(double x)
          设置图片的x坐标,并向所有监听器发送 AnnotationChangeEvent事件.
 void setY(double y)
          设置图片的y坐标,并向所有监听器发送 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
 

Constructor Detail

XYImageAnnotation

public XYImageAnnotation(double x,
                         double y,
                         java.awt.Image image)
根据x坐标和y坐标确定图片的位置.

Parameters:
x - double x坐标.
y - double y坐标.
image - Image 图片.

XYImageAnnotation

public XYImageAnnotation(double x,
                         double y,
                         java.awt.Image image,
                         int imageWidth,
                         int imageHeight)
根据x坐标和y坐标确定图片的位置.

Parameters:
x - double x坐标.
y - double y坐标.
image - Image 图片.
imageWidth - int 图片的宽度.
imageHeight - int 图片的高度.
Method Detail

getX

public double getX()
返回图片的x坐标.

Returns:
double x坐标.

setX

public void setX(double x)
设置图片的x坐标,并向所有监听器发送 AnnotationChangeEvent事件.

Parameters:
x - double x坐标.

getY

public double getY()
返回图片的y坐标.

Returns:
double y坐标.

setY

public void setY(double y)
设置图片的y坐标,并向所有监听器发送 AnnotationChangeEvent事件.

Parameters:
y - double y坐标.

getImage

public java.awt.Image getImage()
返回图形对象.

Returns:
Shape 图形 (不为null).

setImage

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

Parameters:
image - Image 图片 (不可为null).

getImageWidth

public int getImageWidth()
返回图片的宽度.

Returns:
int 宽度.

setImageWidth

public void setImageWidth(int width)
设置图片的宽度,并向所有监听器发送 AnnotationChangeEvent事件.

Parameters:
width - int 宽度.

getImageHeight

public int getImageHeight()
返回图片的高度.

Returns:
int 高度.

setImageHeight

public void setImageHeight(int height)
设置图片的高度,并向所有监听器发送 AnnotationChangeEvent事件.

Parameters:
height - int 高度.

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.