Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.jfree.chart.annotations.AbstractXYAnnotation
org.jfree.chart.annotations.XYTextAnnotation
public class XYTextAnnotation
extends AbstractXYAnnotation
implements Cloneable, PublicCloneable, Serializable
XYPlot
.
Field Summary | |
static Font |
|
static Paint |
|
static TextAnchor |
|
static double |
|
static TextAnchor |
|
Constructor Summary | |
|
Method Summary | |
Object |
|
void |
|
boolean |
|
Font |
|
Paint |
|
TextAnchor |
|
double |
|
String |
|
TextAnchor |
|
double |
|
double |
|
int |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Methods inherited from class org.jfree.chart.annotations.AbstractXYAnnotation | |
addEntity , draw , equals , getToolTipText , getURL , hashCode , setToolTipText , setURL |
public static final TextAnchor DEFAULT_ROTATION_ANCHOR
The default rotation anchor.
public static final double DEFAULT_ROTATION_ANGLE
The default rotation angle.
- Field Value:
- 0.0
public XYTextAnnotation(String text, double x, double y)
Creates a new annotation to be displayed at the given coordinates. The coordinates are specified in data space (they will be converted to Java2D space for display).
- Parameters:
text
- the text (null
not permitted).x
- the x-coordinate (in data space).y
- the y-coordinate (in data space).
public Object clone() throws CloneNotSupportedException
Returns a clone of the annotation.
- Returns:
- A clone.
public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, int rendererIndex, PlotRenderingInfo info)
Draws the annotation.
- Specified by:
- draw in interface XYAnnotation
- Overrides:
- draw in interface AbstractXYAnnotation
- Parameters:
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(Object obj)
Tests this annotation for equality with an arbitrary object.
- Overrides:
- equals in interface AbstractXYAnnotation
- Parameters:
obj
- the object (null
permitted).
- Returns:
- A boolean.
public Font getFont()
Returns the font for the annotation.
- Returns:
- The font (never
null
).
- See Also:
setFont(Font)
public Paint getPaint()
Returns the paint for the annotation.
- Returns:
- The paint (never
null
).
- See Also:
setPaint(Paint)
public TextAnchor getRotationAnchor()
Returns the rotation anchor.
- Returns:
- The rotation anchor point (never
null
).
- See Also:
setRotationAnchor(TextAnchor)
public double getRotationAngle()
Returns the rotation angle.
- Returns:
- The rotation angle.
- See Also:
setRotationAngle(double)
public String getText()
Returns the text for the annotation.
- Returns:
- The text (never
null
).
- See Also:
setText(String)
public TextAnchor getTextAnchor()
Returns the text anchor.
- Returns:
- The text anchor (never
null
).
- See Also:
setTextAnchor(TextAnchor)
public double getX()
Returns the x coordinate for the text anchor point (measured against the domain axis).
- Returns:
- The x coordinate (in data space).
- See Also:
setX(double)
public double getY()
Returns the y coordinate for the text anchor point (measured against the range axis).
- Returns:
- The y coordinate (in data space).
- See Also:
setY(double)
public int hashCode()
Returns a hash code for the object.
- Overrides:
- hashCode in interface AbstractXYAnnotation
- Returns:
- A hash code.
public void setFont(Font font)
Sets the font for the annotation.
- Parameters:
font
- the font (null
not permitted).
- See Also:
getFont()
public void setPaint(Paint paint)
Sets the paint for the annotation.
- Parameters:
paint
- the paint (null
not permitted).
- See Also:
getPaint()
public void setRotationAnchor(TextAnchor anchor)
Sets the rotation anchor point.
- Parameters:
anchor
- the anchor (null
not permitted).
- See Also:
getRotationAnchor()
public void setRotationAngle(double angle)
Sets the rotation angle. The angle is measured clockwise in radians.
- Parameters:
angle
- the angle (in radians).
- See Also:
getRotationAngle()
public void setText(String text)
Sets the text for the annotation.
- Parameters:
text
- the text (null
not permitted).
- See Also:
getText()
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:
getTextAnchor()
public void setX(double x)
Sets the x coordinate for the text anchor point (measured against the domain axis).
- Parameters:
x
- the x coordinate (in data space).
- See Also:
getX()