org.geotools.swt.event
Class MapMouseEvent

Object
  extended by MapMouseEvent

public final class MapMouseEvent
extends Object

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), Andrea Antonello (www.hydrologis.com)

Constructor Summary
MapMouseEvent(SwtMapPane pane, MouseEvent event, boolean isWheel)
          Constructor.
 
Method Summary
 DirectPosition2D getMapPosition()
          Get the position, in map (world) coordinates of this mouse event
 int getMouseButton()
          The button that was pressed or released; 1 for the first button, 2 for the second button, and 3 for the third button, etc.
 Point getPoint()
          Getter for the mouse location?
 int getStateMask()
          Returns the state mask of the 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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapMouseEvent

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

Parameters:
pane - the map pane sending this event.
event - the mouse event.
isWheel - if true then the event comes from the mouse wheel.
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

getPoint

public Point getPoint()
Getter for the mouse location?

Returns:
the mouse location.

getMouseButton

public int getMouseButton()
The button that was pressed or released; 1 for the first button, 2 for the second button, and 3 for the third button, etc. On mouse dragging this function may return 0.

Returns:
the button that was pressed or released
See Also:
MouseEvent.button

getStateMask

public int getStateMask()
Returns the state mask of the mouse event.

Returns:
the state mask
See Also:
MouseEvent.stateMask

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-2014 Geotools. All Rights Reserved.