public class

CategoryTextAnnotation

extends TextAnnotation
implements Serializable Cloneable CategoryAnnotation
java.lang.Object
   ↳ org.jfree.chart.annotations.TextAnnotation
     ↳ org.jfree.chart.annotations.CategoryTextAnnotation
Known Direct Subclasses

Class Overview

A text annotation that can be placed on a CategoryPlot.

Summary

[Expand]
Inherited Constants
From class org.jfree.chart.annotations.TextAnnotation
[Expand]
Inherited Fields
From class org.jfree.chart.annotations.TextAnnotation
Public Constructors
CategoryTextAnnotation(String text, Comparable category, double value)
Creates a new annotation to be displayed at the given location.
Public Methods
Object clone()
Returns a clone of the annotation.
void draw(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea, CategoryAxis domainAxis, ValueAxis rangeAxis)
Draws the annotation.
boolean equals(Object obj)
Tests this object for equality with another.
Comparable getCategory()
Returns the category.
CategoryAnchor getCategoryAnchor()
Returns the category anchor point.
double getValue()
Returns the value that the annotation attaches to.
int hashCode()
Returns a hash code for this instance.
void setCategory(Comparable category)
Sets the category that the annotation attaches to.
void setCategoryAnchor(CategoryAnchor anchor)
Sets the category anchor point.
void setValue(double value)
Sets the value.
[Expand]
Inherited Methods
From class org.jfree.chart.annotations.TextAnnotation
From class java.lang.Object
From interface org.jfree.chart.annotations.CategoryAnnotation

Public Constructors

public CategoryTextAnnotation (String text, Comparable category, double value)

Creates a new annotation to be displayed at the given location.

Parameters
text the text (null not permitted).
category the category (null not permitted).
value the value.

Public Methods

public Object clone ()

Returns a clone of the annotation.

Returns
  • A clone.
Throws
CloneNotSupportedException this class will not throw this exception, but subclasses (if any) might.

public void draw (Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea, CategoryAxis domainAxis, ValueAxis rangeAxis)

Draws the annotation.

Parameters
g2 the graphics device.
plot the plot.
dataArea the data area.
domainAxis the domain axis.
rangeAxis the range axis.

public boolean equals (Object obj)

Tests this object for equality with another.

Parameters
obj the object (null permitted).
Returns
  • true or false.

public Comparable getCategory ()

Returns the category.

Returns
  • The category (never null).

public CategoryAnchor getCategoryAnchor ()

Returns the category anchor point.

Returns
  • The category anchor point.

public double getValue ()

Returns the value that the annotation attaches to.

Returns
  • The value.
See Also

public int hashCode ()

Returns a hash code for this instance.

Returns
  • A hash code.

public void setCategory (Comparable category)

Sets the category that the annotation attaches to.

Parameters
category the category (null not permitted).
See Also

public void setCategoryAnchor (CategoryAnchor anchor)

Sets the category anchor point.

Parameters
anchor the anchor point (null not permitted).

public void setValue (double value)

Sets the value.

Parameters
value the value.
See Also