|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.chart.annotations.AbstractXYAnnotation
org.jfree.chart.annotations.XYTextAnnotation
A text annotation that can be placed at a particular (x, y) location on an
XYPlot
.
Field Summary | |
static java.awt.Font |
DEFAULT_FONT
The default font. |
static java.awt.Paint |
DEFAULT_PAINT
The default paint. |
static TextAnchor |
DEFAULT_ROTATION_ANCHOR
The default rotation anchor. |
static double |
DEFAULT_ROTATION_ANGLE
The default rotation angle. |
static TextAnchor |
DEFAULT_TEXT_ANCHOR
The default text anchor. |
Constructor Summary | |
XYTextAnnotation(java.lang.String text,
double x,
double y)
Creates a new annotation to be displayed at the given coordinates. |
Method Summary | |
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.Font |
getFont()
Returns the font for the annotation. |
java.awt.Paint |
getPaint()
Returns the paint for the annotation. |
TextAnchor |
getRotationAnchor()
Returns the rotation anchor. |
double |
getRotationAngle()
Returns the rotation angle. |
java.lang.String |
getText()
Returns the text for the annotation. |
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. |
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(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(TextAnchor anchor)
Sets the text anchor (the point on the text bounding rectangle that is aligned to the (x, y) coordinate of the annotation). |
void |
setX(double x)
Sets the x coordinate for the text anchor point (measured against the domain axis). |
void |
setY(double y)
Sets the y coordinate for the text anchor point (measured against the range axis). |
Methods inherited from class org.jfree.chart.annotations.AbstractXYAnnotation |
addEntity, getToolTipText, getURL, setToolTipText, setURL |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.awt.Font DEFAULT_FONT
public static final java.awt.Paint DEFAULT_PAINT
public static final TextAnchor DEFAULT_TEXT_ANCHOR
public static final TextAnchor DEFAULT_ROTATION_ANCHOR
public static final double DEFAULT_ROTATION_ANGLE
Constructor Detail |
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).Method Detail |
public java.lang.String getText()
null
).public void setText(java.lang.String text)
text
- the text (null
not permitted).public java.awt.Font getFont()
public void setFont(java.awt.Font font)
font
- the font.public java.awt.Paint getPaint()
public void setPaint(java.awt.Paint paint)
paint
- the paint.public TextAnchor getTextAnchor()
public void setTextAnchor(TextAnchor anchor)
anchor
- the anchor point.public TextAnchor getRotationAnchor()
public void setRotationAnchor(TextAnchor anchor)
anchor
- the anchor.public double getRotationAngle()
public void setRotationAngle(double angle)
The angle is measured clockwise in radians.
angle
- the angle (in radians).public double getX()
public void setX(double x)
x
- the x coordinate (in data space).public double getY()
public void setY(double y)
y
- the y coordinate.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 XYAnnotation
draw
in class AbstractXYAnnotation
g2
- 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 AbstractXYAnnotation
obj
- the object (null
permitted).
public int hashCode()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
- if the annotation can't be cloned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |