net.refractions.udig.project.ui.render.displayAdapter
Class MapMouseEvent

java.lang.Object
  extended by net.refractions.udig.project.ui.render.displayAdapter.MapMouseEvent
Direct Known Subclasses:
MapMouseWheelEvent

public class MapMouseEvent
extends java.lang.Object

Encapsulates a mouse event. MapMouseListeners receive MapMouse events.

Author:
jeichar

Field Summary
static int ALT_DOWN_MASK
          Indicates that the alt key is down
 int button
          indicates the button that last changed
static int BUTTON1
          Indicates that the 1st mouse button, the left button on right handed mouses
static int BUTTON2
          Indicates that the 2nd mouse button.
static int BUTTON3
          Indicates that the 3rd mouse button.
 int buttons
          All the buttons that are currently down ORed together
static int CTRL_DOWN_MASK
          Indicates that the ctrl key is down
static int MOD1_DOWN_MASK
          Indicates that the mod1 key is down
static int MOD2_DOWN_MASK
          Indicates that the mod2 key is down
static int MOD3_DOWN_MASK
          Indicates that the mod3 key is down
static int MOD4_DOWN_MASK
          Indicates that the mod3 key is down
 int modifiers
          All the key modifiers ORed together
static int NONE
          Indicates no modifiers or no buttons.
static int SHIFT_DOWN_MASK
          Indicates that the shift key is down
 IMapDisplay source
          The Viewport pane that raised the event.
 int state
          Deprecated. user modifiers and buttons
 long timestamp
          the time the event occurred
 int x
          indicates the x position of the event
 int y
          indicates the y position of the event
 
Constructor Summary
MapMouseEvent(IMapDisplay source, int x, int y, int modifiers, int buttons, int button)
          Construct MapMouseEvent.
 
Method Summary
 boolean buttonsDown()
           
 java.awt.Point getPoint()
          Returns the location of the event.
 boolean isAltDown()
          Returns true if alt key is down.
 boolean isControlDown()
          Returns true if control key is down.
 boolean isModifierDown(int mask)
          Returns true if the modifier is down
 boolean isShiftDown()
          Returns true if shift key is down.
 boolean modifiersDown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
Indicates no modifiers or no buttons.

See Also:
Constant Field Values

ALT_DOWN_MASK

public static final int ALT_DOWN_MASK
Indicates that the alt key is down


CTRL_DOWN_MASK

public static final int CTRL_DOWN_MASK
Indicates that the ctrl key is down


SHIFT_DOWN_MASK

public static final int SHIFT_DOWN_MASK
Indicates that the shift key is down


MOD1_DOWN_MASK

public static final int MOD1_DOWN_MASK
Indicates that the mod1 key is down


MOD2_DOWN_MASK

public static final int MOD2_DOWN_MASK
Indicates that the mod2 key is down


MOD3_DOWN_MASK

public static final int MOD3_DOWN_MASK
Indicates that the mod3 key is down


MOD4_DOWN_MASK

public static final int MOD4_DOWN_MASK
Indicates that the mod3 key is down


BUTTON1

public static final int BUTTON1
Indicates that the 1st mouse button, the left button on right handed mouses

See Also:
Constant Field Values

BUTTON2

public static final int BUTTON2
Indicates that the 2nd mouse button.

See Also:
Constant Field Values

BUTTON3

public static final int BUTTON3
Indicates that the 3rd mouse button.

See Also:
Constant Field Values

source

public final IMapDisplay source
The Viewport pane that raised the event.


state

public final int state
Deprecated. user modifiers and buttons
The state consists buttons|modifiers


buttons

public final int buttons
All the buttons that are currently down ORed together


modifiers

public final int modifiers
All the key modifiers ORed together


button

public final int button
indicates the button that last changed


x

public final int x
indicates the x position of the event


y

public final int y
indicates the y position of the event


timestamp

public final long timestamp
the time the event occurred

Constructor Detail

MapMouseEvent

public MapMouseEvent(IMapDisplay source,
                     int x,
                     int y,
                     int modifiers,
                     int buttons,
                     int button)
Construct MapMouseEvent.

Parameters:
source - The object that raised the event
x - the x position of the event
y - the y position of the event
modifiers - indicates what modifiers are down. Modifiers are ORed together
buttons - indicates the buttons that are down. button ids are ORed together.
button - the button that last changed
Method Detail

getPoint

public java.awt.Point getPoint()
Returns the location of the event.

Returns:
the location of the event.
See Also:
Point

isShiftDown

public boolean isShiftDown()
Returns true if shift key is down.

Returns:
true if shift key is down.

isControlDown

public boolean isControlDown()
Returns true if control key is down.

Returns:
true if control key is down.

isAltDown

public boolean isAltDown()
Returns true if alt key is down.

Returns:
true if alt key is down.

isModifierDown

public boolean isModifierDown(int mask)
Returns true if the modifier is down

Parameters:
mask - the modifier to test for.
Returns:
true if modifier is down.
See Also:
CTRL_DOWN_MASK, ALT_DOWN_MASK, SHIFT_DOWN_MASK, MOD1_DOWN_MASK, MOD2_DOWN_MASK, MOD3_DOWN_MASK, MOD4_DOWN_MASK

modifiersDown

public boolean modifiersDown()
Returns:
Returns true if a keyboard modifier is down.

buttonsDown

public boolean buttonsDown()
Returns:
Returns true if a button is down.