public class CategoryTextAnnotation extends TextAnnotation implements CategoryAnnotation, java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable
CategoryPlot.DEFAULT_FONT, DEFAULT_PAINT, DEFAULT_ROTATION_ANCHOR, DEFAULT_ROTATION_ANGLE, DEFAULT_TEXT_ANCHOR| Constructor and Description |
|---|
CategoryTextAnnotation(java.lang.String text,
java.lang.Comparable category,
double value)
Creates a new annotation to be displayed at the given location.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Returns a clone of the annotation.
|
void |
draw(java.awt.Graphics2D g2,
CategoryPlot plot,
java.awt.geom.Rectangle2D dataArea,
CategoryAxis domainAxis,
ValueAxis rangeAxis)
Draws the annotation.
|
boolean |
equals(java.lang.Object obj)
Tests this object for equality with another.
|
java.lang.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(java.lang.Comparable category)
Sets the category that the annotation attaches to and sends an
AnnotationChangeEvent to all registered listeners. |
void |
setCategoryAnchor(CategoryAnchor anchor)
Sets the category anchor point and sends an
AnnotationChangeEvent to all registered listeners. |
void |
setValue(double value)
Sets the value and sends an
AnnotationChangeEvent to all registered listeners. |
getFont, getPaint, getRotationAnchor, getRotationAngle, getText, getTextAnchor, setFont, setPaint, setRotationAnchor, setRotationAngle, setText, setTextAnchoraddChangeListener, fireAnnotationChanged, getNotify, hasListener, notifyListeners, removeChangeListener, setNotifyfinalize, getClass, notify, notifyAll, toString, wait, wait, waitaddChangeListener, removeChangeListenerpublic CategoryTextAnnotation(java.lang.String text, java.lang.Comparable category, double value)
text - the text (null not permitted).category - the category (null not permitted).value - the value.public java.lang.Comparable getCategory()
null).setCategory(Comparable)public void setCategory(java.lang.Comparable category)
AnnotationChangeEvent to all registered listeners.category - the category (null not permitted).getCategory()public CategoryAnchor getCategoryAnchor()
setCategoryAnchor(CategoryAnchor)public void setCategoryAnchor(CategoryAnchor anchor)
AnnotationChangeEvent to all registered listeners.anchor - the anchor point (null not permitted).getCategoryAnchor()public double getValue()
setValue(double)public void setValue(double value)
AnnotationChangeEvent to all registered listeners.value - the value.getValue()public void draw(java.awt.Graphics2D g2, CategoryPlot plot, java.awt.geom.Rectangle2D dataArea, CategoryAxis domainAxis, ValueAxis rangeAxis)
draw in interface CategoryAnnotationg2 - the graphics device.plot - the plot.dataArea - the data area.domainAxis - the domain axis.rangeAxis - the range axis.public boolean equals(java.lang.Object obj)
equals in class TextAnnotationobj - the object (null permitted).true or false.public int hashCode()
hashCode in class TextAnnotationpublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone in interface org.jfree.util.PublicCloneableclone in class AbstractAnnotationjava.lang.CloneNotSupportedException - this class will not throw this
exception, but subclasses (if any) might.