org.geotools.swt.tool
Class MapToolManager

Object
  extended by MapToolManager
All Implemented Interfaces:
EventListener, MouseListener, MouseMoveListener, MouseTrackListener, MouseWheelListener, SWTEventListener

public class MapToolManager
extends Object
implements MouseListener, MouseMoveListener, MouseWheelListener, MouseTrackListener

Receives mouse events from a SwtMapPane instance, converts them to MapMouseEvents, and sends these to the registered listeners.

Author:
Andrea Antonello (www.hydrologis.com), Michael Bedward

Constructor Summary
MapToolManager(SwtMapPane pane)
          Constructor
 
Method Summary
 boolean addMouseListener(MapMouseListener listener)
          Add a listener for JMapPaneMouseEvents
 CursorTool getCursorTool()
          Get the active cursor tool
 void mouseDoubleClick(MouseEvent arg0)
           
 void mouseDown(MouseEvent e)
           
 void mouseEnter(MouseEvent e)
           
 void mouseExit(MouseEvent e)
           
 void mouseHover(MouseEvent arg0)
           
 void mouseMove(MouseEvent e)
           
 void mouseScrolled(MouseEvent e)
           
 void mouseUp(MouseEvent e)
           
 boolean removeMouseListener(MapMouseListener listener)
          Remove a MapMouseListener from the active listeners
 boolean setCursorTool(CursorTool tool)
          Set the active cursor tool
 void setNoCursorTool()
          Unset the current cursor tool
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapToolManager

public MapToolManager(SwtMapPane pane)
Constructor

Parameters:
pane - the map pane that owns this listener
Method Detail

setNoCursorTool

public void setNoCursorTool()
Unset the current cursor tool


setCursorTool

public boolean setCursorTool(CursorTool tool)
Set the active cursor tool

Parameters:
tool - the tool to set
Returns:
true if successful; false otherwise
Throws:
IllegalArgumentException - if the tool argument is null

getCursorTool

public CursorTool getCursorTool()
Get the active cursor tool

Returns:
live reference to the active cursor tool or null if no tool is active

addMouseListener

public boolean addMouseListener(MapMouseListener listener)
Add a listener for JMapPaneMouseEvents

Parameters:
listener - the listener to add
Returns:
true if successful; false otherwise
Throws:
IllegalArgumentException - if the tool argument is null

removeMouseListener

public boolean removeMouseListener(MapMouseListener listener)
Remove a MapMouseListener from the active listeners

Parameters:
listener - the listener to remove
Returns:
true if successful; false otherwise
Throws:
IllegalArgumentException - if the tool argument is null

mouseScrolled

public void mouseScrolled(MouseEvent e)
Specified by:
mouseScrolled in interface MouseWheelListener

mouseMove

public void mouseMove(MouseEvent e)
Specified by:
mouseMove in interface MouseMoveListener

mouseDoubleClick

public void mouseDoubleClick(MouseEvent arg0)
Specified by:
mouseDoubleClick in interface MouseListener

mouseDown

public void mouseDown(MouseEvent e)
Specified by:
mouseDown in interface MouseListener

mouseUp

public void mouseUp(MouseEvent e)
Specified by:
mouseUp in interface MouseListener

mouseEnter

public void mouseEnter(MouseEvent e)
Specified by:
mouseEnter in interface MouseTrackListener

mouseExit

public void mouseExit(MouseEvent e)
Specified by:
mouseExit in interface MouseTrackListener

mouseHover

public void mouseHover(MouseEvent arg0)
Specified by:
mouseHover in interface MouseTrackListener


Copyright © 1996-2014 Geotools. All Rights Reserved.