@API(type=NOT_EXTENDABLE, src=PUBLIC) public class AuthorMouseEvent extends AuthorInputEvent
AuthorMouseListener
.Modifier and Type | Field and Description |
---|---|
int |
button
Indicates which, if any, of the mouse buttons has changed its state.
|
static int |
BUTTON1
Indicates mouse button #1.
|
static int |
BUTTON2
Indicates mouse button #2.
|
static int |
BUTTON3
Indicates mouse button #3.
|
int |
clickCount
Click count.
|
static int |
NOBUTTON
Indicates no mouse button.
|
boolean |
popupTrigger
true if this event is a pop-up trigger. |
int |
state
|
static int |
STATE_CLICKED
Mouse clicked event type.
|
static int |
STATE_DRAGGED
Mouse dragged event type.
|
static int |
STATE_MOVED
Mouse moved event type.
|
static int |
STATE_PRESSED
Mouse pressed event type.
|
static int |
STATE_RELEASED
Mouse released event type.
|
static int |
STATE_WHEEL_MOVED
Mouse wheel moved event type.
|
boolean |
wheelUp
true if the mouse wheel is rotated up (away from the user), false
if the mouse wheel is rotated down (towards the user). |
int |
X
The mouse event's x coordinate.
|
int |
Y
The mouse event's y coordinate.
|
ALT_GRAPH_PRESSED, ALT_PRESSED, consumed, CTRL_PRESSED, META_PRESSED, modifiers, SHIFT_PRESSED
Constructor and Description |
---|
AuthorMouseEvent(int x,
int y,
boolean isPopupTrigger,
int state,
int modifiers,
int clickCount)
Constructor for the author mouse event.
|
AuthorMouseEvent(int x,
int y,
boolean isPopupTrigger,
int state,
int modifiers,
int clickCount,
int button)
Constructor for the author mouse event.
|
AuthorMouseEvent(int x,
int y,
boolean isPopupTrigger,
int state,
int modifiers,
int clickCount,
int button,
boolean wheelUp)
Constructor for the author mouse event.
|
Modifier and Type | Method and Description |
---|---|
int |
getButton()
Returns which, if any, of the mouse buttons has changed state.
|
int |
getClickCount()
Returns the number of mouse clicks associated with this event.
|
int |
getState()
Returns the state.
|
protected java.lang.String |
getStateDescription(int state) |
int |
getX()
Returns the horizontal x position of the event relative to the
source component.
|
int |
getY()
Returns the vertical y position of the event relative to the
source component.
|
boolean |
isPopupTrigger()
Returns whether or not this mouse event is the popup menu
trigger event for the platform.
|
java.lang.String |
toString() |
consume, getModifiers, isAltGraphPressed, isAltPressed, isCommandPressed, isCommandPressed, isConsumed, isCtrlPressed, isMetaPressed, isShiftPressed
public static final int STATE_PRESSED
public static final int STATE_RELEASED
public static final int STATE_CLICKED
public static final int STATE_MOVED
public static final int STATE_DRAGGED
public static final int STATE_WHEEL_MOVED
public static final int BUTTON1
public static final int BUTTON2
public static final int BUTTON3
public static final int NOBUTTON
public final int X
public final int Y
public final boolean popupTrigger
true
if this event is a pop-up trigger.public final int clickCount
public final int button
NOBUTTON
,
BUTTON1
,
BUTTON2
or
BUTTON3
.public final int state
public final boolean wheelUp
true
if the mouse wheel is rotated up (away from the user), false
if the mouse wheel is rotated down (towards the user).public AuthorMouseEvent(int x, int y, boolean isPopupTrigger, int state, int modifiers, int clickCount)
x
- The x coordinate of the mouse event.y
- The y coordinate of the mouse event.isPopupTrigger
- true
if it is pop-up trigger.state
- One of the constants STATE_PRESSED
, STATE_RELEASED
,
STATE_CLICKED
, STATE_MOVED
or STATE_DRAGGED
.modifiers
- Marks if CTRL, SHIFT, ALT, ALT GR, META were pressed.clickCount
- Click count.public AuthorMouseEvent(int x, int y, boolean isPopupTrigger, int state, int modifiers, int clickCount, int button)
x
- The x coordinate of the mouse event.y
- The y coordinate of the mouse event.isPopupTrigger
- true
if it is pop-up trigger.state
- One of the constants STATE_PRESSED
, STATE_RELEASED
,
STATE_CLICKED
, STATE_MOVED
or STATE_DRAGGED
.modifiers
- Marks if CTRL, SHIFT, ALT, ALT GR, META were pressed.clickCount
- Click count.button
- One of the constants BUTTON1
, BUTTON2
, BUTTON3
, NOBUTTON
.public AuthorMouseEvent(int x, int y, boolean isPopupTrigger, int state, int modifiers, int clickCount, int button, boolean wheelUp)
x
- The x coordinate of the mouse event.y
- The y coordinate of the mouse event.isPopupTrigger
- true
if it is pop-up trigger.state
- One of the constants STATE_PRESSED
, STATE_RELEASED
,
STATE_CLICKED
, STATE_MOVED
or STATE_DRAGGED
.modifiers
- Marks if CTRL, SHIFT, ALT, ALT GR, META were pressed.clickCount
- Click count.button
- One of the constants BUTTON1
, BUTTON2
, BUTTON3
,
NOBUTTON
.wheelUp
- true
if the mouse wheel is rotated up (away from the user),
false
if the mouse wheel is rotated down (towards the user).public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
protected java.lang.String getStateDescription(int state)
public int getClickCount()
public int getButton()
NOBUTTON
,
BUTTON1
,
BUTTON2
or
BUTTON3
.public boolean isPopupTrigger()
Note: Popup menus are triggered differently
on different systems. Therefore, isPopupTrigger
should be checked in both mousePressed
and mouseReleased
for proper cross-platform functionality.
public int getX()
public int getY()
public int getState()
STATE_PRESSED
,
STATE_RELEASED
,
STATE_CLICKED
STATE_DRAGGED
or
STATE_MOVED
.© Copyright SyncRO Soft SRL 2002 - 2016. All rights reserved.