com.jogamp.newt.event
Class MouseEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.jogamp.newt.event.NEWTEvent
          extended by com.jogamp.newt.event.InputEvent
              extended by com.jogamp.newt.event.MouseEvent
All Implemented Interfaces:
Serializable

public class MouseEvent
extends InputEvent

See Also:
Serialized Form

Field Summary
static int BUTTON_NUMBER
          Maximum number of buttons, value 16
static int BUTTON1
          ID for button 1, value 1
static int BUTTON2
          ID for button 2, value 2
static int BUTTON3
          ID for button 3, value 3
static int BUTTON4
          ID for button 4, value 4
static int BUTTON5
          ID for button 5, value 5
static int BUTTON6
          ID for button 6, value 6
static int BUTTON7
          ID for button 6, value 7
static int BUTTON8
          ID for button 6, value 8
static int BUTTON9
          ID for button 6, value 9
static int EVENT_MOUSE_CLICKED
           
static int EVENT_MOUSE_DRAGGED
           
static int EVENT_MOUSE_ENTERED
           
static int EVENT_MOUSE_EXITED
           
static int EVENT_MOUSE_MOVED
           
static int EVENT_MOUSE_PRESSED
           
static int EVENT_MOUSE_RELEASED
           
static int EVENT_MOUSE_WHEEL_MOVED
           
 
Fields inherited from class com.jogamp.newt.event.InputEvent
ALT_GRAPH_MASK, ALT_MASK, AUTOREPEAT_MASK, BUTTON1_MASK, BUTTON2_MASK, BUTTON3_MASK, BUTTON4_MASK, BUTTON5_MASK, BUTTON6_MASK, BUTTON7_MASK, BUTTON8_MASK, BUTTON9_MASK, BUTTONLAST_MASK, CONFINED_MASK, consumedTag, CTRL_MASK, INVISIBLE_MASK, META_MASK, SHIFT_MASK
 
Constructor Summary
MouseEvent(int eventType, Object source, long when, int modifiers, int[] x, int[] y, float[] pressure, int[] pointerids, int clickCount, int button, int rotation)
           
MouseEvent(int eventType, Object source, long when, int modifiers, int x, int y, int clickCount, int button, int rotation)
           
 
Method Summary
 int getButton()
           
 int getClickCount()
           
static int getClickTimeout()
           
static String getEventTypeString(int type)
           
 int getPointerCount()
           
 int getPointerId(int index)
           
 float getPressure()
           
 float getPressure(int index)
           
 int getWheelRotation()
          Usually a wheel rotation of > 0 is up, and < 0 is down.
However, on some OS this might be flipped due to the OS default behavior.
 int getX()
           
 int getX(int index)
           
 int getY()
           
 int getY(int index)
           
 String toString()
           
 StringBuilder toString(StringBuilder sb)
           
 
Methods inherited from class com.jogamp.newt.event.InputEvent
getButtonMask, getButtonsDown, getModifiers, getModifiersString, isAltDown, isAltGraphDown, isAutoRepeat, isButtonDown, isConfined, isControlDown, isInvisible, isMetaDown, isShiftDown
 
Methods inherited from class com.jogamp.newt.event.NEWTEvent
getAttachment, getEventType, getWhen, isSystemEvent, setAttachment, toHexString, toHexString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BUTTON1

public static final int BUTTON1
ID for button 1, value 1

See Also:
Constant Field Values

BUTTON2

public static final int BUTTON2
ID for button 2, value 2

See Also:
Constant Field Values

BUTTON3

public static final int BUTTON3
ID for button 3, value 3

See Also:
Constant Field Values

BUTTON4

public static final int BUTTON4
ID for button 4, value 4

See Also:
Constant Field Values

BUTTON5

public static final int BUTTON5
ID for button 5, value 5

See Also:
Constant Field Values

BUTTON6

public static final int BUTTON6
ID for button 6, value 6

See Also:
Constant Field Values

BUTTON7

public static final int BUTTON7
ID for button 6, value 7

See Also:
Constant Field Values

BUTTON8

public static final int BUTTON8
ID for button 6, value 8

See Also:
Constant Field Values

BUTTON9

public static final int BUTTON9
ID for button 6, value 9

See Also:
Constant Field Values

BUTTON_NUMBER

public static final int BUTTON_NUMBER
Maximum number of buttons, value 16

See Also:
Constant Field Values

EVENT_MOUSE_CLICKED

public static final int EVENT_MOUSE_CLICKED
See Also:
Constant Field Values

EVENT_MOUSE_ENTERED

public static final int EVENT_MOUSE_ENTERED
See Also:
Constant Field Values

EVENT_MOUSE_EXITED

public static final int EVENT_MOUSE_EXITED
See Also:
Constant Field Values

EVENT_MOUSE_PRESSED

public static final int EVENT_MOUSE_PRESSED
See Also:
Constant Field Values

EVENT_MOUSE_RELEASED

public static final int EVENT_MOUSE_RELEASED
See Also:
Constant Field Values

EVENT_MOUSE_MOVED

public static final int EVENT_MOUSE_MOVED
See Also:
Constant Field Values

EVENT_MOUSE_DRAGGED

public static final int EVENT_MOUSE_DRAGGED
See Also:
Constant Field Values

EVENT_MOUSE_WHEEL_MOVED

public static final int EVENT_MOUSE_WHEEL_MOVED
See Also:
Constant Field Values
Constructor Detail

MouseEvent

public MouseEvent(int eventType,
                  Object source,
                  long when,
                  int modifiers,
                  int x,
                  int y,
                  int clickCount,
                  int button,
                  int rotation)

MouseEvent

public MouseEvent(int eventType,
                  Object source,
                  long when,
                  int modifiers,
                  int[] x,
                  int[] y,
                  float[] pressure,
                  int[] pointerids,
                  int clickCount,
                  int button,
                  int rotation)
Method Detail

getClickTimeout

public static final int getClickTimeout()

getPointerCount

public int getPointerCount()
Returns:
the count of pointers involved in this event

getPointerId

public int getPointerId(int index)
Returns:
the pointer id for the data at index. return -1 if index not available.

getButton

public int getButton()

getClickCount

public int getClickCount()

getX

public int getX()

getY

public int getY()

getX

public int getX(int index)
Returns:
x-coord at index where index refers to the data coming from a pointer.
See Also:
getPointerId(index)

getY

public int getY(int index)

getPressure

public float getPressure()

getPressure

public float getPressure(int index)
Returns:
the pressure associated with the pointer at index. the value of zero is return if not available.

getWheelRotation

public int getWheelRotation()
Usually a wheel rotation of > 0 is up, and < 0 is down.
However, on some OS this might be flipped due to the OS default behavior. The latter is true for OS X 10.7 (Lion) for example.

The events will be send usually in steps of one, ie. -1 and 1. Higher values may result due to fast scrolling.

The button number refers to the wheel number.

Returns:

toString

public String toString()
Overrides:
toString in class InputEvent

toString

public StringBuilder toString(StringBuilder sb)
Overrides:
toString in class InputEvent

getEventTypeString

public static String getEventTypeString(int type)


Copyright 2010 JogAmp Community.