public class TextAnnotation extends AbstractAnnotation implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
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.
|
private java.awt.Font |
font
The font.
|
private java.awt.Paint |
paint
The paint.
|
private org.jfree.ui.TextAnchor |
rotationAnchor
The rotation anchor.
|
private double |
rotationAngle
The rotation angle.
|
private static long |
serialVersionUID
For serialization.
|
private java.lang.String |
text
The text.
|
private org.jfree.ui.TextAnchor |
textAnchor
The text anchor.
|
| Modifier | Constructor and Description |
|---|---|
protected |
TextAnnotation(java.lang.String text)
Creates a text annotation with default settings.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
private void |
readObject(java.io.ObjectInputStream stream)
Provides serialization support.
|
void |
setFont(java.awt.Font font)
Sets the font for the annotation and sends an
AnnotationChangeEvent to all registered listeners. |
void |
setPaint(java.awt.Paint paint)
Sets the paint for the annotation and sends an
AnnotationChangeEvent to all registered listeners. |
void |
setRotationAnchor(org.jfree.ui.TextAnchor anchor)
Sets the rotation anchor point and sends an
AnnotationChangeEvent to all registered listeners. |
void |
setRotationAngle(double angle)
Sets the rotation angle and sends an
AnnotationChangeEvent to
all registered listeners. |
void |
setText(java.lang.String text)
Sets the text for the annotation and sends an
AnnotationChangeEvent to all registered listeners. |
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) and sends an
AnnotationChangeEvent to all registered listeners. |
private void |
writeObject(java.io.ObjectOutputStream stream)
Provides serialization support.
|
addChangeListener, clone, fireAnnotationChanged, getNotify, hasListener, notifyListeners, removeChangeListener, setNotifyprivate static final long serialVersionUID
public static final java.awt.Font DEFAULT_FONT
public static final java.awt.Paint DEFAULT_PAINT
public static final org.jfree.ui.TextAnchor DEFAULT_TEXT_ANCHOR
public static final org.jfree.ui.TextAnchor DEFAULT_ROTATION_ANCHOR
public static final double DEFAULT_ROTATION_ANGLE
private java.lang.String text
private java.awt.Font font
private transient java.awt.Paint paint
private org.jfree.ui.TextAnchor textAnchor
private org.jfree.ui.TextAnchor rotationAnchor
private double rotationAngle
protected TextAnnotation(java.lang.String text)
text - the text (null not permitted).public java.lang.String getText()
null).setText(String)public void setText(java.lang.String text)
AnnotationChangeEvent to all registered listeners.text - the text (null not permitted).getText()public java.awt.Font getFont()
null).setFont(Font)public void setFont(java.awt.Font font)
AnnotationChangeEvent to all registered listeners.font - the font (null not permitted).getFont()public java.awt.Paint getPaint()
null).setPaint(Paint)public void setPaint(java.awt.Paint paint)
AnnotationChangeEvent to all registered listeners.paint - the paint (null not permitted).getPaint()public org.jfree.ui.TextAnchor getTextAnchor()
setTextAnchor(TextAnchor)public void setTextAnchor(org.jfree.ui.TextAnchor anchor)
AnnotationChangeEvent to all registered listeners.anchor - the anchor point (null not permitted).getTextAnchor()public org.jfree.ui.TextAnchor getRotationAnchor()
null).setRotationAnchor(TextAnchor)public void setRotationAnchor(org.jfree.ui.TextAnchor anchor)
AnnotationChangeEvent to all registered listeners.anchor - the anchor (null not permitted).getRotationAnchor()public double getRotationAngle()
setRotationAngle(double)public void setRotationAngle(double angle)
AnnotationChangeEvent to
all registered listeners. The angle is measured clockwise in radians.angle - the angle (in radians).getRotationAngle()public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object (null permitted).true or false.public int hashCode()
hashCode in class java.lang.Objectprivate void writeObject(java.io.ObjectOutputStream stream)
throws java.io.IOException
stream - the output stream.java.io.IOException - if there is an I/O error.private void readObject(java.io.ObjectInputStream stream)
throws java.io.IOException,
java.lang.ClassNotFoundException
stream - the input stream.java.io.IOException - if there is an I/O error.java.lang.ClassNotFoundException - if there is a classpath problem.