public class CategoryTextAnnotation extends TextAnnotation implements CategoryAnnotation, Cloneable, org.jfree.util.PublicCloneable, Serializable
CategoryPlot
.DEFAULT_FONT, DEFAULT_PAINT, DEFAULT_ROTATION_ANCHOR, DEFAULT_ROTATION_ANGLE, DEFAULT_TEXT_ANCHOR
Constructor and Description |
---|
CategoryTextAnnotation(String text,
Comparable category,
double value)
Creates a new annotation to be displayed at the given location.
|
Modifier and Type | Method and Description |
---|---|
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 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, setTextAnchor
addChangeListener, getNotify, hasListener, removeChangeListener, setNotify
getClass, notify, notifyAll, toString, wait, wait, wait
addChangeListener, removeChangeListener
public CategoryTextAnnotation(String text, Comparable category, double value)
text
- the text (null
not permitted).category
- the category (null
not permitted).value
- the value.public Comparable getCategory()
null
).setCategory(Comparable)
public void setCategory(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(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea, CategoryAxis domainAxis, ValueAxis rangeAxis)
draw
in interface CategoryAnnotation
g2
- the graphics device.plot
- the plot.dataArea
- the data area.domainAxis
- the domain axis.rangeAxis
- the range axis.public boolean equals(Object obj)
equals
in class TextAnnotation
obj
- the object (null
permitted).true
or false
.public int hashCode()
hashCode
in class TextAnnotation
public Object clone() throws CloneNotSupportedException
clone
in interface org.jfree.util.PublicCloneable
clone
in class AbstractAnnotation
CloneNotSupportedException
- this class will not throw this
exception, but subclasses (if any) might.Jas4pp 1.5 © Java Analysis Studio for Particle Physics