public class CrosshairOverlay extends AbstractOverlay implements Overlay, PropertyChangeListener, Cloneable, Serializable
ChartPanel that draws crosshairs on a plot.| Constructor and Description |
|---|
CrosshairOverlay()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected void |
drawHorizontalCrosshair(Graphics2D g2,
Rectangle2D dataArea,
double y,
Crosshair crosshair)
Draws a crosshair horizontally across the plot.
|
protected void |
drawVerticalCrosshair(Graphics2D g2,
Rectangle2D dataArea,
double x,
Crosshair crosshair)
Draws a crosshair vertically on the plot.
|
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) |
addChangeListener, fireOverlayChanged, notifyListeners, removeChangeListenerfinalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChangeListener, removeChangeListenerpublic CrosshairOverlay()
public void addDomainCrosshair(Crosshair crosshair)
crosshair - the crosshair.public void removeDomainCrosshair(Crosshair crosshair)
public void clearDomainCrosshairs()
public List getDomainCrosshairs()
public void addRangeCrosshair(Crosshair crosshair)
crosshair - the crosshair.public void removeRangeCrosshair(Crosshair crosshair)
public void clearRangeCrosshairs()
public List getRangeCrosshairs()
public void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenere - the event.public void paintOverlay(Graphics2D g2, ChartPanel chartPanel)
paintOverlay in interface Overlayg2 - the graphics target.chartPanel - the chart panel.protected void drawHorizontalCrosshair(Graphics2D g2, Rectangle2D dataArea, double y, Crosshair crosshair)
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)
g2 - the graphics target.dataArea - the data area.x - the x-value in Java2D space.crosshair - the crosshair.public Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException - if there is some problem
with the cloning.Copyright © 2000-2009 by Object Refinery Limited. All Rights Reserved.