com.jrefinery.chart.annotations
Class XYTextAnnotation

java.lang.Object
  |
  +--com.jrefinery.chart.annotations.TextAnnotation
        |
        +--com.jrefinery.chart.annotations.XYTextAnnotation
All Implemented Interfaces:
Annotation, XYAnnotation

public class XYTextAnnotation
extends TextAnnotation
implements XYAnnotation

A text annotation that can be placed on any XYPlot.


Field Summary
protected  double x
          The x-coordinate.
protected  double y
          The y-coordinate.
 
Fields inherited from class com.jrefinery.chart.annotations.TextAnnotation
DEFAULT_FONT, DEFAULT_PAINT, font, paint, text
 
Constructor Summary
XYTextAnnotation(java.lang.String text, double x, double y)
          Constructor.
XYTextAnnotation(java.lang.String text, java.awt.Font font, double x, double y)
          Constructor.
XYTextAnnotation(java.lang.String text, java.awt.Font font, java.awt.Paint paint, double x, double y)
          Constructor.
 
Method Summary
 void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis)
          Draws the annotation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

protected double x
The x-coordinate.

y

protected double y
The y-coordinate.
Constructor Detail

XYTextAnnotation

public XYTextAnnotation(java.lang.String text,
                        double x,
                        double y)
Constructor.
Parameters:
text - The text.
x - The x-coordinate.
y - The y-coordinate.

XYTextAnnotation

public XYTextAnnotation(java.lang.String text,
                        java.awt.Font font,
                        double x,
                        double y)
Constructor.
Parameters:
text - The text.
font - The font.
x - The x-coordinate.
y - The y-coordinate.

XYTextAnnotation

public XYTextAnnotation(java.lang.String text,
                        java.awt.Font font,
                        java.awt.Paint paint,
                        double x,
                        double y)
Constructor.
Parameters:
text - The text.
font - The font.
paint - The paint.
x - The x-coordinate.
y - The y-coordinate.
Method Detail

draw

public void draw(java.awt.Graphics2D g2,
                 java.awt.geom.Rectangle2D dataArea,
                 ValueAxis domainAxis,
                 ValueAxis rangeAxis)
Draws the annotation.
Specified by:
draw in interface XYAnnotation
Parameters:
g2 - The graphics device.
dataArea - The data area.
domainAxis - The domain axis.
rangeAxis - The range axis.