schmitzm.jfree.chart
Class ChartMouseSelectionTracker
java.lang.Object
java.awt.event.MouseAdapter
javax.swing.event.MouseInputAdapter
skrueger.geotools.MouseSelectionTracker
schmitzm.geotools.gui.MouseSelectionTracker
schmitzm.jfree.chart.ChartMouseSelectionTracker
- All Implemented Interfaces:
- MouseListener, MouseMotionListener, MouseWheelListener, EventListener, MouseInputListener
public abstract class ChartMouseSelectionTracker
- extends MouseSelectionTracker
This tracker listens to mouse window selections and single mouse
clicks on a ChartPanel
. It determines all selected
XYItemEntities
and
CategoryItemEntities
.
- Author:
- Martin Schmitz
Field Summary |
protected ChartPanel |
chartPanel
Holds the panel connected to this listener. |
Methods inherited from class schmitzm.geotools.gui.MouseSelectionTracker |
getSelectionMode, isEnabled, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, setEnabled, setSelectionMode |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
chartPanel
protected ChartPanel chartPanel
- Holds the panel connected to this listener.
ChartMouseSelectionTracker
public ChartMouseSelectionTracker(ChartPanel panel,
MouseSelectionTracker.SelectionMode mode)
- Creates a new listener.
- Parameters:
panel
- the chart panel connected to the listener (used to
determine the EntityCollection
)mode
- specifies the selection events the tracker reacts on
ChartMouseSelectionTracker
public ChartMouseSelectionTracker(ChartPanel panel)
- Creates a new listener which reacts on single clicks as well
as on window selection events.
- Parameters:
panel
- the chart panel connected to the listener (used to
determine the EntityCollection
)
selectionPerformed
protected void selectionPerformed(int ox,
int oy,
int px,
int py)
- Reacts on the window selection by determining all
XYItemEntities
intersected by the selection window.
- Specified by:
selectionPerformed
in class MouseSelectionTracker
- Parameters:
ox
- x coordinate of the mouse when the user pressed the mouse button.oy
- y coordinate of the mouse when the user pressed the mouse button.px
- x coordinate of the mouse when the user released the mouse button.py
- y coordinate of the mouse when the user released the mouse button.
selectionPerformed
protected abstract void selectionPerformed(Rectangle2D rect,
Set<ChartEntity> selectedEntities)
- Called after
selectionPerformed(int, int, int, int)
to inform
the listeners about the selected items.
- Parameters:
rect
- the selection rangeselectedEntities
- the selected XYItemEntities