schmitzm.geotools.gui
Class MouseSelectionTracker

java.lang.Object
  extended by MouseSelectionTracker
      extended by org.geotools.gui.swing.MouseSelectionTracker_Public
          extended by schmitzm.geotools.gui.MouseSelectionTracker
Direct Known Subclasses:
ChartMouseSelectionTracker

public abstract class MouseSelectionTracker
extends MouseSelectionTracker_Public

Extends the geotools org.geotools.gui.swing.MouseSelectionTracker with an enable/disable functionality. Furthermore the tracker (optionally) also reacts on single clicks.

Author:
Martin Schmitz
See Also:
setSelectionMode(SelectionMode)

Nested Class Summary
static class MouseSelectionTracker.SelectionMode
          Selection events the tracker reacts on.
 
Field Summary
protected  boolean enabled
          Indicates whether the tracker reacts on mouse events.
protected  MouseSelectionTracker.SelectionMode selectionMode
          Specifies the selection events the tracker reacts on.
 
Constructor Summary
MouseSelectionTracker()
          Creates a new tracker, which reacts only on window selection events (default geotools behavior for org.geotools.gui.swing.MouseSelectionTracker).
MouseSelectionTracker(MouseSelectionTracker.SelectionMode mode)
          Creates a new tracker.
 
Method Summary
 MouseSelectionTracker.SelectionMode getSelectionMode()
          Returns the selection events the tracker reacts on.
 boolean isEnabled()
          Returns whether the tracker reacts on mouse events or not.
 void mouseClicked(MouseEvent e)
          Ignores the event if tracker is disabled or selection mode is MouseSelectionTracker.SelectionMode.ONLY_WINDOW_SELECTION.
 void mouseDragged(MouseEvent e)
          Ignores the event if tracker is disabled or selection mode is MouseSelectionTracker.SelectionMode.ONLY_SINGLE_CLICK, so that the dragging rectangle is not drawn.
 void mouseEntered(MouseEvent e)
          Ignores the event if tracker is disabled.
 void mouseExited(MouseEvent e)
          Ignores the event if tracker is disabled.
 void mouseMoved(MouseEvent e)
          Ignores the event if tracker is disabled.
 void mousePressed(MouseEvent e)
          Ignores the event if tracker is disabled.
 void mouseReleased(MouseEvent e)
          Ignores the event if tracker is disabled.
 void setEnabled(boolean enabled)
          Sets whether the tracker reacts on mouse events or not.
 void setSelectionMode(MouseSelectionTracker.SelectionMode mode)
          Sets the selection events the tracker reacts on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enabled

protected boolean enabled
Indicates whether the tracker reacts on mouse events.


selectionMode

protected MouseSelectionTracker.SelectionMode selectionMode
Specifies the selection events the tracker reacts on.

Constructor Detail

MouseSelectionTracker

public MouseSelectionTracker()
Creates a new tracker, which reacts only on window selection events (default geotools behavior for org.geotools.gui.swing.MouseSelectionTracker).


MouseSelectionTracker

public MouseSelectionTracker(MouseSelectionTracker.SelectionMode mode)
Creates a new tracker.

Parameters:
mode - specifies the selection events the tracker reacts on
Method Detail

isEnabled

public boolean isEnabled()
Returns whether the tracker reacts on mouse events or not.


setEnabled

public void setEnabled(boolean enabled)
Sets whether the tracker reacts on mouse events or not.


setSelectionMode

public void setSelectionMode(MouseSelectionTracker.SelectionMode mode)
Sets the selection events the tracker reacts on.

Parameters:
mode - the mode to set

getSelectionMode

public MouseSelectionTracker.SelectionMode getSelectionMode()
Returns the selection events the tracker reacts on.


mouseClicked

public void mouseClicked(MouseEvent e)
Ignores the event if tracker is disabled or selection mode is MouseSelectionTracker.SelectionMode.ONLY_WINDOW_SELECTION. Otherwise #selectionPerformed(int, int, int, int) is called for the selected point.


mouseEntered

public void mouseEntered(MouseEvent e)
Ignores the event if tracker is disabled. Otherwise the super method is called.


mouseExited

public void mouseExited(MouseEvent e)
Ignores the event if tracker is disabled. Otherwise the super method is called.


mousePressed

public void mousePressed(MouseEvent e)
Ignores the event if tracker is disabled. Otherwise the super method is called.


mouseReleased

public void mouseReleased(MouseEvent e)
Ignores the event if tracker is disabled. Otherwise the super method is called.


mouseDragged

public void mouseDragged(MouseEvent e)
Ignores the event if tracker is disabled or selection mode is MouseSelectionTracker.SelectionMode.ONLY_SINGLE_CLICK, so that the dragging rectangle is not drawn.


mouseMoved

public void mouseMoved(MouseEvent e)
Ignores the event if tracker is disabled. Otherwise the super method is called.