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 TypeMethodDescriptionbooleanaddMouseListener(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.voidReceives a mouse clicked event and sends a derived MapMouseEvent to listeners.voidReceives a mouse dragged event and sends a derived MapMouseEvent to listeners.voidReceives a mouse entered event and sends a derived MapMouseEvent to listeners.voidReceives a mouse exited event and sends a derived MapMouseEvent to listeners.voidmouseMoved(MouseEvent ev) Receives a mouse moved event and sends a derived MapMouseEvent to listeners.voidReceives a mouse pressed event and sends a derived MapMouseEvent to listeners.voidReceives a mouse released event and sends a derived MapMouseEvent to listeners.voidReceives a mouse wheel event and sends a derived MapMouseEvent to listeners.voidRemoves all listeners.booleanremoveMouseListener(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:
addMouseListenerin interfaceMapMouseEventDispatcher- Parameters:
listener- the new listener- Returns:
- true if successful; false otherwise
-
removeMouseListener
Removes the given listener.- Specified by:
removeMouseListenerin interfaceMapMouseEventDispatcher- Parameters:
listener- the listener to remove- Returns:
- true if successful; false otherwise
-
removeAllListeners
public void removeAllListeners()Removes all listeners.- Specified by:
removeAllListenersin interfaceMapMouseEventDispatcher
-
mouseClicked
Receives a mouse clicked event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
ev- the input event
-
mousePressed
Receives a mouse pressed event and sends a derived MapMouseEvent to listeners.- Specified by:
mousePressedin interfaceMouseListener- Parameters:
ev- the input event
-
mouseReleased
Receives a mouse released event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
ev- the input event
-
mouseEntered
Receives a mouse entered event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
ev- the input event
-
mouseExited
Receives a mouse exited event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
ev- the input event
-
mouseDragged
Receives a mouse dragged event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseDraggedin interfaceMouseMotionListener- Parameters:
ev- the input event
-
mouseMoved
Receives a mouse moved event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseMovedin interfaceMouseMotionListener- Parameters:
ev- the input event
-
mouseWheelMoved
Receives a mouse wheel event and sends a derived MapMouseEvent to listeners.- Specified by:
mouseWheelMovedin interfaceMouseWheelListener- Parameters:
ev- the input event
-
convertEvent
Converts an incoming Java AWT mouse event to a MapMouseEvent.- Specified by:
convertEventin interfaceMapMouseEventDispatcher- Parameters:
ev- the input event
-
convertEvent
Converts an incoming Java AWT mouse wheel event to a MapMouseEvent.- Specified by:
convertEventin interfaceMapMouseEventDispatcher- Parameters:
ev- the input event
-