org.geotools.swing.event
Class MapMouseEvent

Object
  extended by EventObject
      extended by AWTEvent
          extended by ComponentEvent
              extended by InputEvent
                  extended by MouseEvent
                      extended by MapMouseEvent
All Implemented Interfaces:
Serializable

public final class MapMouseEvent
extends MouseEvent

A MouseEvent which contains methods to obtain coordinates in real world CoordinateSystem as well as Screen Coordinates.

Since:
2.6
Author:
Michael Bedward (adapted from code by Cameron Shorter)
See Also:
Serialized Form
Module:

Field Summary
 
Fields inherited from class 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 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 ComponentEvent
COMPONENT_FIRST, COMPONENT_HIDDEN, COMPONENT_LAST, COMPONENT_MOVED, COMPONENT_RESIZED, COMPONENT_SHOWN
 
Fields inherited from class 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 EventObject
source
 
Constructor Summary
MapMouseEvent(JMapPane pane, MouseEvent event)
          Constructor.
MapMouseEvent(JMapPane pane, MouseWheelEvent event)
          Constructor for mouse wheel events.
 
Method Summary
 DirectPosition2D getMapPosition()
          Get the position, in map (world) coordinates of this mouse event
 int getWheelAmount()
          When isWheelEvent is true this indicate the amount of travel.
 boolean isWheelEvent()
          Indicates a mouse wheel event.
 
Methods inherited from class MouseEvent
getButton, getClickCount, getMouseModifiersText, getPoint, getX, getY, isPopupTrigger, paramString, translatePoint
 
Methods inherited from class InputEvent
consume, getModifiers, getModifiersEx, getModifiersExText, getWhen, isAltDown, isAltGraphDown, isConsumed, isControlDown, isMetaDown, isShiftDown
 
Methods inherited from class ComponentEvent
getComponent
 
Methods inherited from class AWTEvent
getID, setSource, toString
 
Methods inherited from class EventObject
getSource
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapMouseEvent

public MapMouseEvent(JMapPane pane,
                     MouseEvent event)
Constructor. Calculates the map position of the mouse event.

Parameters:
pane - the map pane sending this event
event - the mouse event

MapMouseEvent

public MapMouseEvent(JMapPane pane,
                     MouseWheelEvent event)
Constructor for mouse wheel events.

Parameters:
pane - the map pane
event - the mouse wheel event
Method Detail

isWheelEvent

public boolean isWheelEvent()
Indicates a mouse wheel event.

Returns:
true if this a mouse wheel event

getWheelAmount

public int getWheelAmount()
When isWheelEvent is true this indicate the amount of travel.

Returns:
Amount of travel when isWheelEvent is true

getMapPosition

public DirectPosition2D getMapPosition()
Get the position, in map (world) coordinates of this mouse event

Returns:
a new DirectPosition2D object for the world coordinates


Copyright © 1996-2010 Geotools. All Rights Reserved.