schmitzm.jfree.chart
Class ChartMouseSelectionTracker

java.lang.Object
  extended by MouseSelectionTracker
      extended by org.geotools.gui.swing.MouseSelectionTracker_Public
          extended by schmitzm.geotools.gui.MouseSelectionTracker
              extended by schmitzm.jfree.chart.ChartMouseSelectionTracker

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

Nested Class Summary
 
Nested classes/interfaces inherited from class schmitzm.geotools.gui.MouseSelectionTracker
MouseSelectionTracker.SelectionMode
 
Field Summary
protected  ChartPanel chartPanel
          Holds the panel connected to this listener.
 
Fields inherited from class schmitzm.geotools.gui.MouseSelectionTracker
enabled, selectionMode
 
Constructor Summary
ChartMouseSelectionTracker(ChartPanel panel)
          Creates a new listener which reacts on single clicks as well as on window selection events.
ChartMouseSelectionTracker(ChartPanel panel, MouseSelectionTracker.SelectionMode mode)
          Creates a new listener.
 
Method Summary
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.
protected abstract  void selectionPerformed(Rectangle2D rect, Set<ChartEntity> selectedEntities)
          Called after selectionPerformed(int, int, int, int) to inform the listeners about the selected items.
 
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
 

Field Detail

chartPanel

protected ChartPanel chartPanel
Holds the panel connected to this listener.

Constructor Detail

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)
Method Detail

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.


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 range
selectedEntities - the selected XYItemEntities