org.jfree.chart.panel

Class CrosshairOverlay

public class CrosshairOverlay extends AbstractOverlay implements Overlay, PropertyChangeListener, PublicCloneable, Cloneable, Serializable

An overlay for a ChartPanel that draws crosshairs on a plot.

Since: 1.0.13

Constructor Summary
CrosshairOverlay()
Default constructor.
Method Summary
voidaddDomainCrosshair(Crosshair crosshair)
Adds a crosshair against the domain axis.
voidaddRangeCrosshair(Crosshair crosshair)
Adds a crosshair against the range axis.
voidclearDomainCrosshairs()
voidclearRangeCrosshairs()
Objectclone()
Returns a clone of this instance.
protected voiddrawHorizontalCrosshair(Graphics2D g2, Rectangle2D dataArea, double y, Crosshair crosshair)
Draws a crosshair horizontally across the plot.
protected voiddrawVerticalCrosshair(Graphics2D g2, Rectangle2D dataArea, double x, Crosshair crosshair)
Draws a crosshair vertically on the plot.
booleanequals(Object obj)
Tests this overlay for equality with an arbitrary object.
ListgetDomainCrosshairs()
ListgetRangeCrosshairs()
voidpaintOverlay(Graphics2D g2, ChartPanel chartPanel)
Paints the crosshairs in the layer.
voidpropertyChange(PropertyChangeEvent e)
Receives a property change event (typically a change in one of the crosshairs).
voidremoveDomainCrosshair(Crosshair crosshair)
voidremoveRangeCrosshair(Crosshair crosshair)

Constructor Detail

CrosshairOverlay

public CrosshairOverlay()
Default constructor.

Method Detail

addDomainCrosshair

public void addDomainCrosshair(Crosshair crosshair)
Adds a crosshair against the domain axis.

Parameters: crosshair the crosshair.

addRangeCrosshair

public void addRangeCrosshair(Crosshair crosshair)
Adds a crosshair against the range axis.

Parameters: crosshair the crosshair.

clearDomainCrosshairs

public void clearDomainCrosshairs()

clearRangeCrosshairs

public void clearRangeCrosshairs()

clone

public Object clone()
Returns a clone of this instance.

Returns: A clone of this instance.

Throws: java.lang.CloneNotSupportedException if there is some problem with the cloning.

drawHorizontalCrosshair

protected void drawHorizontalCrosshair(Graphics2D g2, Rectangle2D dataArea, double y, Crosshair crosshair)
Draws a crosshair horizontally across the plot.

Parameters: g2 the graphics target. dataArea the data area. y the y-value in Java2D space. crosshair the crosshair.

drawVerticalCrosshair

protected void drawVerticalCrosshair(Graphics2D g2, Rectangle2D dataArea, double x, Crosshair crosshair)
Draws a crosshair vertically on the plot.

Parameters: g2 the graphics target. dataArea the data area. x the x-value in Java2D space. crosshair the crosshair.

equals

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

Parameters: obj the object (null permitted).

Returns: A boolean.

getDomainCrosshairs

public List getDomainCrosshairs()

getRangeCrosshairs

public List getRangeCrosshairs()

paintOverlay

public void paintOverlay(Graphics2D g2, ChartPanel chartPanel)
Paints the crosshairs in the layer.

Parameters: g2 the graphics target. chartPanel the chart panel.

propertyChange

public void propertyChange(PropertyChangeEvent e)
Receives a property change event (typically a change in one of the crosshairs).

Parameters: e the event.

removeDomainCrosshair

public void removeDomainCrosshair(Crosshair crosshair)

removeRangeCrosshair

public void removeRangeCrosshair(Crosshair crosshair)
Copyright © 2000-2009 by Object Refinery Limited. All Rights Reserved.