Package org.jfree.chart.annotations
Class AbstractXYAnnotation
- java.lang.Object
-
- org.jfree.chart.annotations.AbstractAnnotation
-
- org.jfree.chart.annotations.AbstractXYAnnotation
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,Annotation
,XYAnnotation
- Direct Known Subclasses:
XYBoxAnnotation
,XYDataImageAnnotation
,XYDataRangeAnnotation
,XYDrawableAnnotation
,XYImageAnnotation
,XYLineAnnotation
,XYPolygonAnnotation
,XYShapeAnnotation
,XYTextAnnotation
,XYTitleAnnotation
public abstract class AbstractXYAnnotation extends AbstractAnnotation implements XYAnnotation
The interface that must be supported by annotations that are to be added to anXYPlot
.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
toolTipText
The tool tip text.private java.lang.String
url
The URL.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractXYAnnotation()
Creates a new instance that has no tool tip or URL specified.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addEntity(PlotRenderingInfo info, java.awt.Shape hotspot, int rendererIndex, java.lang.String toolTipText, java.lang.String urlText)
A utility method for adding anXYAnnotationEntity
to aPlotRenderingInfo
instance.boolean
canEqual(java.lang.Object other)
Ensures symmetry between super/subclass implementations of equals.abstract void
draw(java.awt.Graphics2D g2, XYPlot plot, java.awt.geom.Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, int rendererIndex, PlotRenderingInfo info)
Draws the annotation.boolean
equals(java.lang.Object obj)
Tests this annotation for equality with an arbitrary object.java.lang.String
getToolTipText()
Returns the tool tip text for the annotation.java.lang.String
getURL()
Returns the URL for the annotation.int
hashCode()
Returns a hash code for this instance.void
setToolTipText(java.lang.String text)
Sets the tool tip text for the annotation.void
setURL(java.lang.String url)
Sets the URL for the annotation.-
Methods inherited from class org.jfree.chart.annotations.AbstractAnnotation
addChangeListener, clone, fireAnnotationChanged, getNotify, hasListener, notifyListeners, removeChangeListener, setNotify
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jfree.chart.annotations.Annotation
addChangeListener, removeChangeListener
-
-
-
-
Method Detail
-
getToolTipText
public java.lang.String getToolTipText()
Returns the tool tip text for the annotation. This will be displayed in aChartPanel
when the mouse pointer hovers over the annotation.- Returns:
- The tool tip text (possibly
null
). - See Also:
setToolTipText(String)
-
setToolTipText
public void setToolTipText(java.lang.String text)
Sets the tool tip text for the annotation.- Parameters:
text
- the tool tip text (null
permitted).- See Also:
getToolTipText()
-
getURL
public java.lang.String 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(String)
-
setURL
public void setURL(java.lang.String url)
Sets the URL for the annotation.- Parameters:
url
- the URL (null
permitted).- See Also:
getURL()
-
draw
public abstract void draw(java.awt.Graphics2D g2, XYPlot plot, java.awt.geom.Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, int rendererIndex, PlotRenderingInfo info)
Draws the annotation.- Specified by:
draw
in 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, java.awt.Shape hotspot, int rendererIndex, java.lang.String toolTipText, java.lang.String urlText)
A utility method for adding anXYAnnotationEntity
to aPlotRenderingInfo
instance.- Parameters:
info
- the plot rendering info (null
permitted).hotspot
- the hotspot area.rendererIndex
- the renderer index.toolTipText
- the tool tip text.urlText
- the URL text.
-
equals
public boolean equals(java.lang.Object obj)
Tests this annotation for equality with an arbitrary object.- Overrides:
equals
in classAbstractAnnotation
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-
canEqual
public boolean canEqual(java.lang.Object other)
Ensures symmetry between super/subclass implementations of equals. For more detail, see http://jqno.nl/equalsverifier/manual/inheritance.- Overrides:
canEqual
in classAbstractAnnotation
- Parameters:
other
- Object- Returns:
- true ONLY if the parameter is THIS class type
-
hashCode
public int hashCode()
Returns a hash code for this instance.- Overrides:
hashCode
in classAbstractAnnotation
- Returns:
- A hash code.
-
-