Header
And More


org.jfree.chart.annotations
Class TextAnnotation

java.lang.Object
  extended by org.jfree.chart.annotations.TextAnnotation
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CategoryTextAnnotation

public class TextAnnotation
extends java.lang.Object
implements java.io.Serializable

A base class for text annotations. This class records the content but not the location of the annotation.

See Also:
Serialized Form

Field Summary
static java.awt.Font DEFAULT_FONT
          The default font.
static java.awt.Paint DEFAULT_PAINT
          The default paint.
static org.jfree.ui.TextAnchor DEFAULT_ROTATION_ANCHOR
          The default rotation anchor.
static double DEFAULT_ROTATION_ANGLE
          The default rotation angle.
static org.jfree.ui.TextAnchor DEFAULT_TEXT_ANCHOR
          The default text anchor.
 
Constructor Summary
protected TextAnnotation(java.lang.String text)
          Creates a text annotation with default settings.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Tests this object for equality with an arbitrary object.
 java.awt.Font getFont()
          Returns the font for the annotation.
 java.awt.Paint getPaint()
          Returns the paint for the annotation.
 org.jfree.ui.TextAnchor getRotationAnchor()
          Returns the rotation anchor.
 double getRotationAngle()
          Returns the rotation angle in radians.
 java.lang.String getText()
          Returns the text for the annotation.
 org.jfree.ui.TextAnchor getTextAnchor()
          Returns the text anchor.
 int hashCode()
          Returns a hash code for this instance.
 void setFont(java.awt.Font font)
          Sets the font for the annotation.
 void setPaint(java.awt.Paint paint)
          Sets the paint for the annotation.
 void setRotationAnchor(org.jfree.ui.TextAnchor anchor)
          Sets the rotation anchor point.
 void setRotationAngle(double angle)
          Sets the rotation angle.
 void setText(java.lang.String text)
          Sets the text for the annotation.
 void setTextAnchor(org.jfree.ui.TextAnchor anchor)
          Sets the text anchor (the point on the text bounding rectangle that is aligned to the (x, y) coordinate of the annotation).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FONT

public static final java.awt.Font DEFAULT_FONT
The default font.


DEFAULT_PAINT

public static final java.awt.Paint DEFAULT_PAINT
The default paint.


DEFAULT_TEXT_ANCHOR

public static final org.jfree.ui.TextAnchor DEFAULT_TEXT_ANCHOR
The default text anchor.


DEFAULT_ROTATION_ANCHOR

public static final org.jfree.ui.TextAnchor DEFAULT_ROTATION_ANCHOR
The default rotation anchor.


DEFAULT_ROTATION_ANGLE

public static final double DEFAULT_ROTATION_ANGLE
The default rotation angle.

See Also:
Constant Field Values
Constructor Detail

TextAnnotation

protected TextAnnotation(java.lang.String text)
Creates a text annotation with default settings.

Parameters:
text - the text (null not permitted).
Method Detail

getText

public java.lang.String getText()
Returns the text for the annotation.

Returns:
The text (never null).
See Also:
setText(String)

setText

public void setText(java.lang.String text)
Sets the text for the annotation.

Parameters:
text - the text (null not permitted).
See Also:
getText()

getFont

public java.awt.Font getFont()
Returns the font for the annotation.

Returns:
The font (never null).
See Also:
setFont(Font)

setFont

public void setFont(java.awt.Font font)
Sets the font for the annotation.

Parameters:
font - the font (null not permitted).
See Also:
getFont()

getPaint

public java.awt.Paint getPaint()
Returns the paint for the annotation.

Returns:
The paint (never null).
See Also:
setPaint(Paint)

setPaint

public void setPaint(java.awt.Paint paint)
Sets the paint for the annotation.

Parameters:
paint - the paint (null not permitted).
See Also:
getPaint()

getTextAnchor

public org.jfree.ui.TextAnchor getTextAnchor()
Returns the text anchor.

Returns:
The text anchor.
See Also:
setTextAnchor(TextAnchor)

setTextAnchor

public void setTextAnchor(org.jfree.ui.TextAnchor anchor)
Sets the text anchor (the point on the text bounding rectangle that is aligned to the (x, y) coordinate of the annotation).

Parameters:
anchor - the anchor point (null not permitted).
See Also:
getTextAnchor()

getRotationAnchor

public org.jfree.ui.TextAnchor getRotationAnchor()
Returns the rotation anchor.

Returns:
The rotation anchor point (never null).
See Also:
setRotationAnchor(TextAnchor)

setRotationAnchor

public void setRotationAnchor(org.jfree.ui.TextAnchor anchor)
Sets the rotation anchor point.

Parameters:
anchor - the anchor (null not permitted).
See Also:
getRotationAnchor()

getRotationAngle

public double getRotationAngle()
Returns the rotation angle in radians.

Returns:
The rotation angle.
See Also:
setRotationAngle(double)

setRotationAngle

public void setRotationAngle(double angle)
Sets the rotation angle. The angle is measured clockwise in radians.

Parameters:
angle - the angle (in radians).
See Also:
getRotationAngle()

equals

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

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object (null permitted).
Returns:
true or false.

hashCode

public int hashCode()
Returns a hash code for this instance.

Overrides:
hashCode in class java.lang.Object
Returns:
A hash code.

Footer
And More


Copyright © 2000-2009 by Object Refinery Limited. All Rights Reserved.