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 void mapClicked​(GeoPosition location)
    This method needs to be implemented in the extending class to handle the map clicked event.
    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.

    Methods inherited from class java.awt.event.MouseAdapter

    mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MapClickListener

      public MapClickListener​(JXMapViewer viewer)
      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:
      mouseClicked in interface java.awt.event.MouseListener
      Overrides:
      mouseClicked in class java.awt.event.MouseAdapter
      Parameters:
      evt - the mouse event
    • mapClicked

      public abstract void mapClicked​(GeoPosition location)
      This method needs to be implemented in the extending class to handle the map clicked event.
      Parameters:
      location - The GeoPosition of the click event