public class

CrosshairOverlay

extends AbstractOverlay
implements PropertyChangeListener Serializable Cloneable Overlay
java.lang.Object
   ↳ org.jfree.chart.panel.AbstractOverlay
     ↳ org.jfree.chart.panel.CrosshairOverlay

Class Overview

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

Summary

Public Constructors
CrosshairOverlay()
Default constructor.
Public Methods
void addDomainCrosshair(Crosshair crosshair)
Adds a crosshair against the domain axis.
void addRangeCrosshair(Crosshair crosshair)
Adds a crosshair against the range axis.
void clearDomainCrosshairs()
void clearRangeCrosshairs()
Object clone()
Returns a clone of this instance.
boolean equals(Object obj)
Tests this overlay for equality with an arbitrary object.
List getDomainCrosshairs()
List getRangeCrosshairs()
void paintOverlay(Graphics2D g2, ChartPanel chartPanel)
Paints the crosshairs in the layer.
void propertyChange(PropertyChangeEvent e)
Receives a property change event (typically a change in one of the crosshairs).
void removeDomainCrosshair(Crosshair crosshair)
void removeRangeCrosshair(Crosshair crosshair)
Protected Methods
void drawHorizontalCrosshair(Graphics2D g2, Rectangle2D dataArea, double y, Crosshair crosshair)
Draws a crosshair horizontally across the plot.
void drawVerticalCrosshair(Graphics2D g2, Rectangle2D dataArea, double x, Crosshair crosshair)
Draws a crosshair vertically on the plot.
[Expand]
Inherited Methods
From class org.jfree.chart.panel.AbstractOverlay
From class java.lang.Object
From interface java.beans.PropertyChangeListener
From interface org.jfree.chart.panel.Overlay

Public Constructors

public CrosshairOverlay ()

Default constructor.

Public Methods

public void addDomainCrosshair (Crosshair crosshair)

Adds a crosshair against the domain axis.

Parameters
crosshair the crosshair.

public void addRangeCrosshair (Crosshair crosshair)

Adds a crosshair against the range axis.

Parameters
crosshair the crosshair.

public void clearDomainCrosshairs ()

public void clearRangeCrosshairs ()

public Object clone ()

Returns a clone of this instance.

Returns
  • A clone of this instance.
Throws
CloneNotSupportedException if there is some problem with the cloning.

public boolean equals (Object obj)

Tests this overlay for equality with an arbitrary object.

Parameters
obj the object (null permitted).
Returns
  • A boolean.

public List getDomainCrosshairs ()

public List getRangeCrosshairs ()

public void paintOverlay (Graphics2D g2, ChartPanel chartPanel)

Paints the crosshairs in the layer.

Parameters
g2 the graphics target.
chartPanel the chart panel.

public void propertyChange (PropertyChangeEvent e)

Receives a property change event (typically a change in one of the crosshairs).

Parameters
e the event.

public void removeDomainCrosshair (Crosshair crosshair)

public void removeRangeCrosshair (Crosshair crosshair)

Protected Methods

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.

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.