com.ijchart.xychart.annotation
Class XYTextAnnotation

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

public class XYTextAnnotation
extends AbstractTextAnnotation
implements IXYAnnotation, java.lang.Cloneable, java.io.Serializable

Title: IJChart

A text annotation that can be placed on a 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
 
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
XYTextAnnotation(java.lang.String text, double x, double y)
           Creates a new annotation to be displayed at the given location.
 
Method Summary
 java.lang.Object clone()
           Creates and returns a copy of this object.
 void drawAnnotation(AbstractValueAxis xAxis, RectangleEdge xAxisEdge, AbstractValueAxis yAxis, RectangleEdge yAxisEdge, java.awt.geom.Rectangle2D dataArea, ChartOrientation orientation, AnnotationShapeCollection annotationShapes)
           Draws the annotation.
 boolean equals(java.lang.Object obj)
           Tests this instance for equality with an arbitrary object.
 double getX()
           Returns the x value.
 double getY()
           Returns the y value.
 int hashCode()
           Returns a hash code value for the object.
 void setX(double x)
           Sets the x value and sends an AnnotationChangeEvent to all registered listeners.
 void setY(double y)
           Sets the y value and sends an AnnotationChangeEvent to all registered listeners.
 java.lang.String toString()
           Returns a string representation of the object.
 
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

XYTextAnnotation

public XYTextAnnotation(java.lang.String text,
                        double x,
                        double y)
Creates a new annotation to be displayed at the given location.

Parameters:
text - String The text (null not permitted).
x - double The x value.
y - double The y value.
Method Detail

getX

public double getX()
Returns the x value.

Returns:
double The x value.

setX

public void setX(double x)
Sets the x value and sends an AnnotationChangeEvent to all registered listeners.

Parameters:
x - double The x value.

getY

public double getY()
Returns the y value.

Returns:
double The y value.

setY

public void setY(double y)
Sets the y value and sends an AnnotationChangeEvent to all registered listeners.

Parameters:
y - double The y value.

drawAnnotation

public void drawAnnotation(AbstractValueAxis xAxis,
                           RectangleEdge xAxisEdge,
                           AbstractValueAxis yAxis,
                           RectangleEdge yAxisEdge,
                           java.awt.geom.Rectangle2D dataArea,
                           ChartOrientation orientation,
                           AnnotationShapeCollection annotationShapes)
Draws the annotation.

Specified by:
drawAnnotation in interface IXYAnnotation
Parameters:
xAxis - AbstractValueAxis The x-axis (null not permitted).
xAxisEdge - RectangleEdge The x-axis edge (null not permitted).
yAxis - AbstractValueAxis The y-axis (null not permitted).
yAxisEdge - RectangleEdge The y-axis edge (null not permitted).
dataArea - Rectangle2D The chart data area (null not permitted).
orientation - ChartOrientation The chart orientation (null not permitted).
annotationShapes - AnnotationShapeCollection Collects information about the annotation (null not permitted).

equals

public boolean equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.

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

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class AbstractTextAnnotation
Returns:
int A hash code value for this object.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.

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()
Returns a string representation of the object.

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