Package org.jfree.chart.annotations
Class TextAnnotation
java.lang.Object
org.jfree.chart.annotations.TextAnnotation
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CategoryTextAnnotation,XYTextAnnotation
public class TextAnnotation extends Object implements 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
Fields Modifier and Type Field Description static FontDEFAULT_FONTThe default font.static PaintDEFAULT_PAINTThe default paint.static org.jfree.ui.TextAnchorDEFAULT_ROTATION_ANCHORThe default rotation anchor.static doubleDEFAULT_ROTATION_ANGLEThe default rotation angle.static org.jfree.ui.TextAnchorDEFAULT_TEXT_ANCHORThe default text anchor. -
Method Summary
Modifier and Type Method Description booleanequals(Object object)Tests this object for equality with another object.FontgetFont()Returns the font for the annotation.PaintgetPaint()Returns the paint for the annotation.org.jfree.ui.TextAnchorgetRotationAnchor()Returns the rotation anchor.doublegetRotationAngle()Returns the rotation angle.StringgetText()Returns the text for the annotation.org.jfree.ui.TextAnchorgetTextAnchor()Returns the text anchor.voidsetFont(Font font)Sets the font for the annotation.voidsetPaint(Paint paint)Sets the paint for the annotation.voidsetRotationAnchor(org.jfree.ui.TextAnchor anchor)Sets the rotation anchor point.voidsetRotationAngle(double angle)Sets the rotation angle.voidsetText(String text)Sets the text for the annotation.voidsetTextAnchor(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).
-
Field Details
-
DEFAULT_FONT
The default font. -
DEFAULT_PAINT
The default paint. -
DEFAULT_TEXT_ANCHOR
public static final org.jfree.ui.TextAnchor DEFAULT_TEXT_ANCHORThe default text anchor. -
DEFAULT_ROTATION_ANCHOR
public static final org.jfree.ui.TextAnchor DEFAULT_ROTATION_ANCHORThe default rotation anchor. -
DEFAULT_ROTATION_ANGLE
public static final double DEFAULT_ROTATION_ANGLEThe default rotation angle.- See Also:
- Constant Field Values
-
-
Method Details
-
getText
Returns the text for the annotation.- Returns:
- The text.
-
setText
Sets the text for the annotation.- Parameters:
text- the text.
-
getFont
Returns the font for the annotation.- Returns:
- The font.
-
setFont
Sets the font for the annotation.- Parameters:
font- the font.
-
getPaint
Returns the paint for the annotation.- Returns:
- The paint.
-
setPaint
Sets the paint for the annotation.- Parameters:
paint- the paint.
-
getTextAnchor
public org.jfree.ui.TextAnchor getTextAnchor()Returns the text anchor.- Returns:
- The text anchor.
-
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.
-
getRotationAnchor
public org.jfree.ui.TextAnchor getRotationAnchor()Returns the rotation anchor.- Returns:
- The rotation anchor point.
-
setRotationAnchor
public void setRotationAnchor(org.jfree.ui.TextAnchor anchor)Sets the rotation anchor point.- Parameters:
anchor- the anchor.
-
getRotationAngle
public double getRotationAngle()Returns the rotation angle.- Returns:
- The rotation angle.
-
setRotationAngle
public void setRotationAngle(double angle)Sets the rotation angle.The angle is measured clockwise in radians.
- Parameters:
angle- the angle (in radians).
-
equals
Tests this object for equality with another object.
-