org.jfree.chart.annotations
Class CategoryTextAnnotation

java.lang.Object
  |
  +--org.jfree.chart.annotations.TextAnnotation
        |
        +--org.jfree.chart.annotations.CategoryTextAnnotation
All Implemented Interfaces:
Annotation, CategoryAnnotation, java.io.Serializable

public class CategoryTextAnnotation
extends TextAnnotation
implements CategoryAnnotation, java.io.Serializable

A text annotation that can be placed on a CategoryPlot.

Author:
David Gilbert
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jfree.chart.annotations.TextAnnotation
DEFAULT_FONT, DEFAULT_PAINT
 
Constructor Summary
CategoryTextAnnotation(java.lang.String text, java.lang.Comparable category, double value)
          Creates a new annotation to be displayed at the given location.
CategoryTextAnnotation(java.lang.String text, java.awt.Font font, java.lang.Comparable category, double value)
          Creates a new annotation to be displayed at the given coordinates.
CategoryTextAnnotation(java.lang.String text, java.awt.Font font, java.awt.Paint paint, java.lang.Comparable category, double value)
          Creates a new annotation to be displayed at the given coordinates.
 
Method Summary
 void draw(java.awt.Graphics2D g2, CategoryPlot plot, java.awt.geom.Rectangle2D dataArea, CategoryAxis domainAxis, ValueAxis rangeAxis)
          Draws the annotation.
 
Methods inherited from class org.jfree.chart.annotations.TextAnnotation
getFont, getPaint, getText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CategoryTextAnnotation

public CategoryTextAnnotation(java.lang.String text,
                              java.lang.Comparable category,
                              double value)
Creates a new annotation to be displayed at the given location.

Parameters:
text - the text.
category - the category.
value - the value.

CategoryTextAnnotation

public CategoryTextAnnotation(java.lang.String text,
                              java.awt.Font font,
                              java.lang.Comparable category,
                              double value)
Creates a new annotation to be displayed at the given coordinates.

Parameters:
text - the text.
font - the font.
category - the category.
value - the value.

CategoryTextAnnotation

public CategoryTextAnnotation(java.lang.String text,
                              java.awt.Font font,
                              java.awt.Paint paint,
                              java.lang.Comparable category,
                              double value)
Creates a new annotation to be displayed at the given coordinates.

Parameters:
text - the text.
font - the font.
paint - the paint.
category - the category.
value - the value.
Method Detail

draw

public void draw(java.awt.Graphics2D g2,
                 CategoryPlot plot,
                 java.awt.geom.Rectangle2D dataArea,
                 CategoryAxis domainAxis,
                 ValueAxis rangeAxis)
Draws the annotation.

Specified by:
draw in interface CategoryAnnotation
Parameters:
g2 - the graphics device.
plot - the plot.
dataArea - the data area.
domainAxis - the domain axis.
rangeAxis - the range axis.