org.geotools.swing.tool
Class MapToolManager

java.lang.Object
  extended by org.geotools.swing.tool.MapToolManager
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener, javax.swing.event.MouseInputListener

public class MapToolManager
extends java.lang.Object
implements javax.swing.event.MouseInputListener, java.awt.event.MouseWheelListener

Receives mouse events from a JMapPane instance, converts them to JMapPaneMouseEvents, and sends these to the active map pane tools.

Since:
2.6
Version:
$Id: MapToolManager.java 34138 2009-10-13 06:35:19Z mbedward $
Author:
Michael Bedward

Constructor Summary
MapToolManager(JMapPane pane)
          Constructor
 
Method Summary
 boolean addMouseListener(MapMouseListener listener)
          Add a listener for JMapPaneMouseEvents
 CursorTool getCursorTool()
          Get the active cursor tool
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void mouseWheelMoved(java.awt.event.MouseWheelEvent 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapToolManager

public MapToolManager(JMapPane 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:
java.lang.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:
java.lang.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:
java.lang.IllegalArgumentException - if the tool argument is null

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseWheelMoved

public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Specified by:
mouseWheelMoved in interface java.awt.event.MouseWheelListener


Copyright © 1996-2010 Geotools. All Rights Reserved.