Package org.geotools.swing.event
Class DefaultMapMouseEventDispatcher
- Object
-
- DefaultMapMouseEventDispatcher
-
- All Implemented Interfaces:
MouseListener
,MouseMotionListener
,MouseWheelListener
,EventListener
,MapMouseEventDispatcher
public class DefaultMapMouseEventDispatcher extends Object implements MapMouseEventDispatcher
Receives mouse events from a MapPane instance, converts them to MapPaneMouseEvents, and sends these to the active map pane tools.- Since:
- 8.0
- Author:
- Michael Bedward
-
-
Constructor Summary
Constructors Constructor Description DefaultMapMouseEventDispatcher(MapPane mapPane)
Creates a new manager instance to work with the specified map pane.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addMouseListener(MapMouseListener listener)
Adds a listener for map pane mouse events.MapMouseEvent
convertEvent(MouseEvent ev)
Converts an incoming Java AWT mouse event to a MapMouseEvent.MapMouseEvent
convertEvent(MouseWheelEvent ev)
Converts an incoming Java AWT mouse wheel event to a MapMouseEvent.void
mouseClicked(MouseEvent ev)
Receives a mouse clicked event and sends a derived MapMouseEvent to listeners.void
mouseDragged(MouseEvent ev)
Receives a mouse dragged event and sends a derived MapMouseEvent to listeners.void
mouseEntered(MouseEvent ev)
Receives a mouse entered event and sends a derived MapMouseEvent to listeners.void
mouseExited(MouseEvent ev)
Receives a mouse exited event and sends a derived MapMouseEvent to listeners.void
mouseMoved(MouseEvent ev)
Receives a mouse moved event and sends a derived MapMouseEvent to listeners.void
mousePressed(MouseEvent ev)
Receives a mouse pressed event and sends a derived MapMouseEvent to listeners.void
mouseReleased(MouseEvent ev)
Receives a mouse released event and sends a derived MapMouseEvent to listeners.void
mouseWheelMoved(MouseWheelEvent ev)
Receives a mouse wheel event and sends a derived MapMouseEvent to listeners.void
removeAllListeners()
Removes all listeners.boolean
removeMouseListener(MapMouseListener listener)
Removes the given listener.
-
-
-
Constructor Detail
-
DefaultMapMouseEventDispatcher
public DefaultMapMouseEventDispatcher(MapPane mapPane)
Creates a new manager instance to work with the specified map pane.- Parameters:
mapPane
- the map pane
-
-
Method Detail
-
addMouseListener
public boolean addMouseListener(MapMouseListener listener)
Adds a listener for map pane mouse events.- Specified by:
addMouseListener
in interfaceMapMouseEventDispatcher
- Parameters:
listener
- the new listener- Returns:
- true if successful; false otherwise
-
removeMouseListener
public boolean removeMouseListener(MapMouseListener listener)
Removes the given listener.- Specified by:
removeMouseListener
in interfaceMapMouseEventDispatcher
- Parameters:
listener
- the listener to remove- Returns:
- true if successful; false otherwise
-
removeAllListeners
public void removeAllListeners()
Removes all listeners.- Specified by:
removeAllListeners
in interfaceMapMouseEventDispatcher
-
mouseClicked
public void mouseClicked(MouseEvent ev)
Receives a mouse clicked event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseClicked
in interfaceMouseListener
- Parameters:
ev
- the input event
-
mousePressed
public void mousePressed(MouseEvent ev)
Receives a mouse pressed event and sends a derived MapMouseEvent to listeners.- Specified by:
mousePressed
in interfaceMouseListener
- Parameters:
ev
- the input event
-
mouseReleased
public void mouseReleased(MouseEvent ev)
Receives a mouse released event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseReleased
in interfaceMouseListener
- Parameters:
ev
- the input event
-
mouseEntered
public void mouseEntered(MouseEvent ev)
Receives a mouse entered event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseEntered
in interfaceMouseListener
- Parameters:
ev
- the input event
-
mouseExited
public void mouseExited(MouseEvent ev)
Receives a mouse exited event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseExited
in interfaceMouseListener
- Parameters:
ev
- the input event
-
mouseDragged
public void mouseDragged(MouseEvent ev)
Receives a mouse dragged event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseDragged
in interfaceMouseMotionListener
- Parameters:
ev
- the input event
-
mouseMoved
public void mouseMoved(MouseEvent ev)
Receives a mouse moved event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseMoved
in interfaceMouseMotionListener
- Parameters:
ev
- the input event
-
mouseWheelMoved
public void mouseWheelMoved(MouseWheelEvent ev)
Receives a mouse wheel event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseWheelMoved
in interfaceMouseWheelListener
- Parameters:
ev
- the input event
-
convertEvent
public MapMouseEvent convertEvent(MouseEvent ev)
Converts an incoming Java AWT mouse event to a MapMouseEvent.- Specified by:
convertEvent
in interfaceMapMouseEventDispatcher
- Parameters:
ev
- the input event
-
convertEvent
public MapMouseEvent convertEvent(MouseWheelEvent ev)
Converts an incoming Java AWT mouse wheel event to a MapMouseEvent.- Specified by:
convertEvent
in interfaceMapMouseEventDispatcher
- Parameters:
ev
- the input event
-
-