Package org.geotools.swing.event
Class DefaultMapMouseEventDispatcher
Object
DefaultMapMouseEventDispatcher
- All Implemented Interfaces:
MouseListener
,MouseMotionListener
,MouseWheelListener
,EventListener
,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
ConstructorsConstructorDescriptionDefaultMapMouseEventDispatcher
(MapPane mapPane) Creates a new manager instance to work with the specified map pane. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addMouseListener
(MapMouseListener listener) Adds a listener for map pane mouse events.Converts an incoming Java AWT mouse event to a MapMouseEvent.Converts an incoming Java AWT mouse wheel event to a MapMouseEvent.void
Receives a mouse clicked event and sends a derived MapMouseEvent to listeners.void
Receives a mouse dragged event and sends a derived MapMouseEvent to listeners.void
Receives a mouse entered event and sends a derived MapMouseEvent to listeners.void
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
Receives a mouse pressed event and sends a derived MapMouseEvent to listeners.void
Receives a mouse released event and sends a derived MapMouseEvent to listeners.void
Receives a mouse wheel event and sends a derived MapMouseEvent to listeners.void
Removes all listeners.boolean
removeMouseListener
(MapMouseListener listener) Removes the given listener.
-
Constructor Details
-
DefaultMapMouseEventDispatcher
Creates a new manager instance to work with the specified map pane.- Parameters:
mapPane
- the map pane
-
-
Method Details
-
addMouseListener
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
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
Receives a mouse clicked event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseClicked
in interfaceMouseListener
- Parameters:
ev
- the input event
-
mousePressed
Receives a mouse pressed event and sends a derived MapMouseEvent to listeners.- Specified by:
mousePressed
in interfaceMouseListener
- Parameters:
ev
- the input event
-
mouseReleased
Receives a mouse released event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseReleased
in interfaceMouseListener
- Parameters:
ev
- the input event
-
mouseEntered
Receives a mouse entered event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseEntered
in interfaceMouseListener
- Parameters:
ev
- the input event
-
mouseExited
Receives a mouse exited event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseExited
in interfaceMouseListener
- Parameters:
ev
- the input event
-
mouseDragged
Receives a mouse dragged event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseDragged
in interfaceMouseMotionListener
- Parameters:
ev
- the input event
-
mouseMoved
Receives a mouse moved event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseMoved
in interfaceMouseMotionListener
- Parameters:
ev
- the input event
-
mouseWheelMoved
Receives a mouse wheel event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseWheelMoved
in interfaceMouseWheelListener
- Parameters:
ev
- the input event
-
convertEvent
Converts an incoming Java AWT mouse event to a MapMouseEvent.- Specified by:
convertEvent
in interfaceMapMouseEventDispatcher
- Parameters:
ev
- the input event
-
convertEvent
Converts an incoming Java AWT mouse wheel event to a MapMouseEvent.- Specified by:
convertEvent
in interfaceMapMouseEventDispatcher
- Parameters:
ev
- the input event
-