org.jfree.chart.annotations

Class AbstractXYAnnotation

public abstract class AbstractXYAnnotation extends Object implements XYAnnotation

The interface that must be supported by annotations that are to be added to an XYPlot.
Constructor Summary
protected AbstractXYAnnotation()
Creates a new instance that has no tool tip or URL specified.
Method Summary
protected voidaddEntity(PlotRenderingInfo info, Shape hotspot, int rendererIndex, String toolTipText, String urlText)
A utility method for adding an XYAnnotationEntity to a PlotRenderingInfo instance.
abstract voiddraw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, int rendererIndex, PlotRenderingInfo info)
Draws the annotation.
booleanequals(Object obj)
Tests this annotation for equality with an arbitrary object.
StringgetToolTipText()
Returns the tool tip text for the annotation.
StringgetURL()
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.
voidsetURL(String url)
Sets the URL for the annotation.

Constructor Detail

AbstractXYAnnotation

protected AbstractXYAnnotation()
Creates a new instance that has no tool tip or URL specified.

Method Detail

addEntity

protected void addEntity(PlotRenderingInfo info, Shape hotspot, int rendererIndex, String toolTipText, String urlText)
A utility method for adding an XYAnnotationEntity to a PlotRenderingInfo 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.

draw

public abstract void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, int rendererIndex, PlotRenderingInfo info)
Draws the annotation.

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.

equals

public boolean equals(Object obj)
Tests this annotation for equality with an arbitrary object.

Parameters: obj the object (null permitted).

Returns: A boolean.

getToolTipText

public String getToolTipText()
Returns the tool tip text for the annotation. This will be displayed in a ChartPanel when the mouse pointer hovers over the annotation.

Returns: The tool tip text (possibly null).

See Also: setToolTipText

getURL

public 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

hashCode

public int hashCode()
Returns a hash code for this instance.

Returns: A hash code.

setToolTipText

public void setToolTipText(String text)
Sets the tool tip text for the annotation.

Parameters: text the tool tip text (null permitted).

See Also: getToolTipText

setURL

public void setURL(String url)
Sets the URL for the annotation.

Parameters: url the URL (null permitted).

See Also: getURL

Copyright © 2000-2009 by Object Refinery Limited. All Rights Reserved.