Package org.jxmapviewer.input
Class MapClickListener
java.lang.Object
java.awt.event.MouseAdapter
org.jxmapviewer.input.MapClickListener
- All Implemented Interfaces:
java.awt.event.MouseListener,java.awt.event.MouseMotionListener,java.awt.event.MouseWheelListener,java.util.EventListener
public abstract class MapClickListener
extends java.awt.event.MouseAdapter
Listens to single mouse clicks on the map and returns the GeoPosition
-
Constructor Summary
Constructors Constructor Description MapClickListener(JXMapViewer viewer)Creates a mouse listener for the jxmapviewer which returns the GeoPosition of the the point where the mouse was clicked. -
Method Summary
Modifier and Type Method Description abstract voidmapClicked(GeoPosition location)This method needs to be implemented in the extending class to handle the map clicked event.voidmouseClicked(java.awt.event.MouseEvent evt)Gets called on mouseClicked events, calculates the GeoPosition and fires the mapClicked method that the extending class needs to implement.
-
Constructor Details
-
MapClickListener
Creates a mouse listener for the jxmapviewer which returns the GeoPosition of the the point where the mouse was clicked.- Parameters:
viewer- the jxmapviewer
-
-
Method Details
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent evt)Gets called on mouseClicked events, calculates the GeoPosition and fires the mapClicked method that the extending class needs to implement.- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener- Overrides:
mouseClickedin classjava.awt.event.MouseAdapter- Parameters:
evt- the mouse event
-
mapClicked
This method needs to be implemented in the extending class to handle the map clicked event.- Parameters:
location- TheGeoPositionof the click event
-