public class

TextAnnotation

extends Object
implements Serializable
java.lang.Object
   ↳ org.jfree.chart.annotations.TextAnnotation
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

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

Summary

Constants
double DEFAULT_ROTATION_ANGLE The default rotation angle.
Fields
public static final Font DEFAULT_FONT The default font.
public static final Paint DEFAULT_PAINT The default paint.
public static final TextAnchor DEFAULT_ROTATION_ANCHOR The default rotation anchor.
public static final TextAnchor DEFAULT_TEXT_ANCHOR The default text anchor.
Protected Constructors
TextAnnotation(String text)
Creates a text annotation with default settings.
Public Methods
boolean equals(Object obj)
Tests this object for equality with an arbitrary object.
Font getFont()
Returns the font for the annotation.
Paint getPaint()
Returns the paint for the annotation.
TextAnchor getRotationAnchor()
Returns the rotation anchor.
double getRotationAngle()
Returns the rotation angle in radians.
String getText()
Returns the text for the annotation.
TextAnchor getTextAnchor()
Returns the text anchor.
int hashCode()
Returns a hash code for this instance.
void setFont(Font font)
Sets the font for the annotation.
void setPaint(Paint paint)
Sets the paint for the annotation.
void setRotationAnchor(TextAnchor anchor)
Sets the rotation anchor point.
void setRotationAngle(double angle)
Sets the rotation angle.
void setText(String text)
Sets the text for the annotation.
void setTextAnchor(TextAnchor anchor)
Sets the text anchor (the point on the text bounding rectangle that is aligned to the (x, y) coordinate of the annotation).
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final double DEFAULT_ROTATION_ANGLE

The default rotation angle.

Constant Value: 0.0

Fields

public static final Font DEFAULT_FONT

The default font.

public static final Paint DEFAULT_PAINT

The default paint.

public static final TextAnchor DEFAULT_ROTATION_ANCHOR

The default rotation anchor.

public static final TextAnchor DEFAULT_TEXT_ANCHOR

The default text anchor.

Protected Constructors

protected TextAnnotation (String text)

Creates a text annotation with default settings.

Parameters
text the text (null not permitted).

Public Methods

public boolean equals (Object obj)

Tests this object for equality with an arbitrary object.

Parameters
obj the object (null permitted).
Returns
  • true or false.

public Font getFont ()

Returns the font for the annotation.

Returns
  • The font (never null).
See Also

public Paint getPaint ()

Returns the paint for the annotation.

Returns
  • The paint (never null).
See Also

public TextAnchor getRotationAnchor ()

Returns the rotation anchor.

Returns
  • The rotation anchor point (never null).

public double getRotationAngle ()

Returns the rotation angle in radians.

Returns
  • The rotation angle.

public String getText ()

Returns the text for the annotation.

Returns
  • The text (never null).
See Also

public TextAnchor getTextAnchor ()

Returns the text anchor.

Returns
  • The text anchor.

public int hashCode ()

Returns a hash code for this instance.

Returns
  • A hash code.

public void setFont (Font font)

Sets the font for the annotation.

Parameters
font the font (null not permitted).
See Also

public void setPaint (Paint paint)

Sets the paint for the annotation.

Parameters
paint the paint (null not permitted).
See Also

public void setRotationAnchor (TextAnchor anchor)

Sets the rotation anchor point.

Parameters
anchor the anchor (null not permitted).

public void setRotationAngle (double angle)

Sets the rotation angle. The angle is measured clockwise in radians.

Parameters
angle the angle (in radians).

public void setText (String text)

Sets the text for the annotation.

Parameters
text the text (null not permitted).
See Also

public void setTextAnchor (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