org.geotools.gui.swing.event
Class GeoMouseEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byjava.awt.AWTEvent
          extended byjava.awt.event.ComponentEvent
              extended byjava.awt.event.InputEvent
                  extended byjava.awt.event.MouseEvent
                      extended byorg.geotools.gui.swing.event.GeoMouseEvent
All Implemented Interfaces:
java.io.Serializable

public final class GeoMouseEvent
extends java.awt.event.MouseEvent

A MouseEvent which contains methods to obtain coordinates in real world CoordinateSystem as well as Screen Coordinates. All MouseListeners that have registered for MapPaneImpl mouseEvents will receive events of this class. Listeners implementations can implements their code as below:

  public void mouseClicked(MouseEvent e) {
      GeoMouseEvent event = (GeoMouseEvent) e;
      // Process event here...
  }
 

Version:
$Id: GeoMouseEvent.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Cameron Shorter
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.event.MouseEvent
BUTTON1, BUTTON2, BUTTON3, MOUSE_CLICKED, MOUSE_DRAGGED, MOUSE_ENTERED, MOUSE_EXITED, MOUSE_FIRST, MOUSE_LAST, MOUSE_MOVED, MOUSE_PRESSED, MOUSE_RELEASED, MOUSE_WHEEL, NOBUTTON
 
Fields inherited from class java.awt.event.InputEvent
ALT_DOWN_MASK, ALT_GRAPH_DOWN_MASK, ALT_GRAPH_MASK, ALT_MASK, BUTTON1_DOWN_MASK, BUTTON1_MASK, BUTTON2_DOWN_MASK, BUTTON2_MASK, BUTTON3_DOWN_MASK, BUTTON3_MASK, CTRL_DOWN_MASK, CTRL_MASK, META_DOWN_MASK, META_MASK, SHIFT_DOWN_MASK, SHIFT_MASK
 
Fields inherited from class java.awt.event.ComponentEvent
COMPONENT_FIRST, COMPONENT_HIDDEN, COMPONENT_LAST, COMPONENT_MOVED, COMPONENT_RESIZED, COMPONENT_SHOWN
 
Fields inherited from class java.awt.AWTEvent
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASK
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
GeoMouseEvent(java.awt.event.MouseEvent event, MathTransform transform)
          A mouseClick event which also contains methods to transform from pixels to the Coordinate System of the Renderer.
 
Method Summary
 CoordinatePoint getMapCoordinate(CoordinatePoint dest)
          Returns the "real world" mouse's position.
 
Methods inherited from class java.awt.event.MouseEvent
getButton, getClickCount, getMouseModifiersText, getPoint, getX, getY, isPopupTrigger, paramString, translatePoint
 
Methods inherited from class java.awt.event.InputEvent
consume, getModifiers, getModifiersEx, getModifiersExText, getWhen, isAltDown, isAltGraphDown, isConsumed, isControlDown, isMetaDown, isShiftDown
 
Methods inherited from class java.awt.event.ComponentEvent
getComponent
 
Methods inherited from class java.awt.AWTEvent
getID, setSource, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GeoMouseEvent

public GeoMouseEvent(java.awt.event.MouseEvent event,
                     MathTransform transform)
A mouseClick event which also contains methods to transform from pixels to the Coordinate System of the Renderer.

Parameters:
event - The original mouse event.
transform - The transform which will convert screenCoordinates to CoordinateSystem coordinates.
Method Detail

getMapCoordinate

public CoordinatePoint getMapCoordinate(CoordinatePoint dest)
                                 throws org.opengis.referencing.operation.TransformException
Returns the "real world" mouse's position. The coordinates are expressed in Context's CoordinateSystem.

Parameters:
dest - A pre-allocated variable to store the mouse's location in CoordinateSystems, can be set to null.
Returns:
The mouse's location in CoordinateSystem coordinates.
Throws:
org.opengis.referencing.operation.TransformException - when transform is invalid.


Copyright © GeoTools. All Rights Reserved.