public class XYTextAnnotation extends AbstractXYAnnotation implements java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable
XYPlot.| Modifier and Type | Field and Description |
|---|---|
private java.awt.Paint |
backgroundPaint
The background paint (possibly null).
|
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 |
outlinePaint
The outline paint (never null).
|
private java.awt.Stroke |
outlineStroke
The outline stroke (never null).
|
private boolean |
outlineVisible
The flag that controls the visibility of the outline.
|
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 (to be aligned with (x, y)).
|
private double |
x
The x-coordinate.
|
private double |
y
The y-coordinate.
|
| Constructor and Description |
|---|
XYTextAnnotation(java.lang.String text,
double x,
double y)
Creates a new annotation to be displayed at the given coordinates.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Returns a clone of the annotation.
|
void |
draw(java.awt.Graphics2D g2,
XYPlot plot,
java.awt.geom.Rectangle2D dataArea,
ValueAxis domainAxis,
ValueAxis rangeAxis,
int rendererIndex,
PlotRenderingInfo info)
Draws the annotation.
|
boolean |
equals(java.lang.Object obj)
Tests this annotation for equality with an arbitrary object.
|
java.awt.Paint |
getBackgroundPaint()
Returns the background paint for the annotation.
|
java.awt.Font |
getFont()
Returns the font for the annotation.
|
java.awt.Paint |
getOutlinePaint()
Returns the outline paint for the annotation.
|
java.awt.Stroke |
getOutlineStroke()
Returns the outline stroke 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.
|
java.lang.String |
getText()
Returns the text for the annotation.
|
org.jfree.ui.TextAnchor |
getTextAnchor()
Returns the text anchor.
|
double |
getX()
Returns the x coordinate for the text anchor point (measured against the
domain axis).
|
double |
getY()
Returns the y coordinate for the text anchor point (measured against the
range axis).
|
int |
hashCode()
Returns a hash code for the object.
|
boolean |
isOutlineVisible()
Returns the flag that controls whether or not the outline is drawn.
|
private void |
readObject(java.io.ObjectInputStream stream)
Provides serialization support.
|
void |
setBackgroundPaint(java.awt.Paint paint)
Sets the background paint for the annotation and sends an
AnnotationChangeEvent to all registered listeners. |
void |
setFont(java.awt.Font font)
Sets the font for the annotation and sends an
AnnotationChangeEvent to all registered listeners. |
void |
setOutlinePaint(java.awt.Paint paint)
Sets the outline paint for the annotation and sends an
AnnotationChangeEvent to all registered listeners. |
void |
setOutlineStroke(java.awt.Stroke stroke)
Sets the outline stroke for the annotation and sends an
AnnotationChangeEvent to all registered listeners. |
void |
setOutlineVisible(boolean visible)
Sets the flag that controls whether or not the outline is drawn 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.
|
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. |
void |
setX(double x)
Sets the x coordinate for the text anchor point (measured against the
domain axis) and sends an
AnnotationChangeEvent to all
registered listeners. |
void |
setY(double y)
Sets the y coordinate for the text anchor point (measured against the
range axis) and sends an
AnnotationChangeEvent to all registered
listeners. |
private void |
writeObject(java.io.ObjectOutputStream stream)
Provides serialization support.
|
addEntity, getToolTipText, getURL, setToolTipText, setURLaddChangeListener, fireAnnotationChanged, getNotify, hasListener, notifyListeners, removeChangeListener, setNotifyfinalize, getClass, notify, notifyAll, toString, wait, wait, waitaddChangeListener, removeChangeListenerprivate 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 double x
private double y
private org.jfree.ui.TextAnchor textAnchor
private org.jfree.ui.TextAnchor rotationAnchor
private double rotationAngle
private transient java.awt.Paint backgroundPaint
private boolean outlineVisible
private transient java.awt.Paint outlinePaint
private transient java.awt.Stroke outlineStroke
public XYTextAnnotation(java.lang.String text,
double x,
double y)
text - the text (null not permitted).x - the x-coordinate (in data space).y - the y-coordinate (in data space).public java.lang.String getText()
null).setText(String)public void setText(java.lang.String text)
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()
null).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 double getX()
setX(double)public void setX(double x)
AnnotationChangeEvent to all
registered listeners.x - the x coordinate (in data space).getX()public double getY()
setY(double)public void setY(double y)
AnnotationChangeEvent to all registered
listeners.y - the y coordinate.getY()public java.awt.Paint getBackgroundPaint()
null).setBackgroundPaint(Paint)public void setBackgroundPaint(java.awt.Paint paint)
AnnotationChangeEvent to all registered listeners.paint - the paint (null permitted).getBackgroundPaint()public java.awt.Paint getOutlinePaint()
null).setOutlinePaint(Paint)public void setOutlinePaint(java.awt.Paint paint)
AnnotationChangeEvent to all registered listeners.paint - the paint (null not permitted).getOutlinePaint()public java.awt.Stroke getOutlineStroke()
null).setOutlineStroke(Stroke)public void setOutlineStroke(java.awt.Stroke stroke)
AnnotationChangeEvent to all registered listeners.stroke - the stroke (null not permitted).getOutlineStroke()public boolean isOutlineVisible()
public void setOutlineVisible(boolean visible)
AnnotationChangeEvent to all registered listeners.visible - the new flag value.public void draw(java.awt.Graphics2D g2,
XYPlot plot,
java.awt.geom.Rectangle2D dataArea,
ValueAxis domainAxis,
ValueAxis rangeAxis,
int rendererIndex,
PlotRenderingInfo info)
draw in interface XYAnnotationdraw in class AbstractXYAnnotationg2 - the graphics device.plot - the plot.dataArea - the data area.domainAxis - the domain axis.rangeAxis - the range axis.rendererIndex - the renderer index.info - an optional info object that will be populated with
entity information.public boolean equals(java.lang.Object obj)
equals in class AbstractXYAnnotationobj - the object (null permitted).public int hashCode()
hashCode in class AbstractXYAnnotationpublic java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface org.jfree.util.PublicCloneableclone in class AbstractAnnotationjava.lang.CloneNotSupportedException - if the annotation can't be cloned.private 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.