Package org.jfree.chart.annotations
Class AbstractXYAnnotation
java.lang.Object
org.jfree.chart.annotations.AbstractAnnotation
org.jfree.chart.annotations.AbstractXYAnnotation
- All Implemented Interfaces:
Serializable,Cloneable,Annotation,XYAnnotation
- Direct Known Subclasses:
XYBoxAnnotation,XYDataImageAnnotation,XYDataRangeAnnotation,XYDrawableAnnotation,XYImageAnnotation,XYLineAnnotation,XYPolygonAnnotation,XYShapeAnnotation,XYTextAnnotation,XYTitleAnnotation
The interface that must be supported by annotations that are to be added to
an
XYPlot.- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new instance that has no tool tip or URL specified. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddEntity(PlotRenderingInfo info, Shape hotspot, int rendererIndex, String toolTipText, String urlText) A utility method for adding anXYAnnotationEntityto aPlotRenderingInfoinstance.booleanEnsures symmetry between super/subclass implementations of equals.abstract voiddraw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, int rendererIndex, PlotRenderingInfo info) Draws the annotation.booleanTests this annotation for equality with an arbitrary object.Returns the tool tip text for the annotation.getURL()Returns the URL for the annotation.inthashCode()Returns a hash code for this instance.voidsetToolTipText(String text) Sets the tool tip text for the annotation.voidSets the URL for the annotation.Methods inherited from class org.jfree.chart.annotations.AbstractAnnotation
addChangeListener, clone, fireAnnotationChanged, getNotify, hasListener, notifyListeners, removeChangeListener, setNotifyMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.chart.annotations.Annotation
addChangeListener, removeChangeListener
-
Constructor Details
-
AbstractXYAnnotation
protected AbstractXYAnnotation()Creates a new instance that has no tool tip or URL specified.
-
-
Method Details
-
getToolTipText
Returns the tool tip text for the annotation. This will be displayed in aChartPanelwhen the mouse pointer hovers over the annotation.- Returns:
- The tool tip text (possibly
null). - See Also:
-
setToolTipText
Sets the tool tip text for the annotation.- Parameters:
text- the tool tip text (nullpermitted).- See Also:
-
getURL
Returns the URL for the annotation. This URL will be used to provide hyperlinks when an HTML image map is created for the chart.- Returns:
- The URL (possibly
null). - See Also:
-
setURL
Sets the URL for the annotation.- Parameters:
url- the URL (nullpermitted).- See Also:
-
draw
public abstract void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, int rendererIndex, PlotRenderingInfo info) Draws the annotation.- Specified by:
drawin interfaceXYAnnotation- Parameters:
g2- the graphics device.plot- the plot.dataArea- the data area.domainAxis- the domain axis.rangeAxis- the range axis.rendererIndex- the renderer index.info- if supplied, this info object will be populated with entity information.
-
addEntity
protected void addEntity(PlotRenderingInfo info, Shape hotspot, int rendererIndex, String toolTipText, String urlText) A utility method for adding anXYAnnotationEntityto aPlotRenderingInfoinstance.- Parameters:
info- the plot rendering info (nullpermitted).hotspot- the hotspot area.rendererIndex- the renderer index.toolTipText- the tool tip text.urlText- the URL text.
-
equals
Tests this annotation for equality with an arbitrary object.- Overrides:
equalsin classAbstractAnnotation- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
canEqual
Ensures symmetry between super/subclass implementations of equals. For more detail, see http://jqno.nl/equalsverifier/manual/inheritance.- Overrides:
canEqualin classAbstractAnnotation- Parameters:
other- Object- Returns:
- true ONLY if the parameter is THIS class type
-
hashCode
Returns a hash code for this instance.- Overrides:
hashCodein classAbstractAnnotation- Returns:
- A hash code.
-