Package ro.sync.ecss.extensions.api
Class AuthorMouseEvent
java.lang.Object
ro.sync.ecss.extensions.api.AuthorInputEvent
ro.sync.ecss.extensions.api.AuthorMouseEvent
Mouse event received by the
AuthorMouseListener.-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intIndicates which, if any, of the mouse buttons has changed its state.static final intIndicates mouse button #1.static final intIndicates mouse button #2.static final intIndicates mouse button #3.final intClick count.static final intIndicates no mouse button.final booleantrueif this event is a pop-up trigger.final intstatic final intMouse clicked event type.static final intMouse dragged event type.static final intMouse moved event type.static final intMouse pressed event type.static final intMouse released event type.static final intMouse wheel moved event type.final booleantrueif the mouse wheel is rotated up (away from the user),falseif the mouse wheel is rotated down (towards the user).final intThe mouse event's x coordinate.final intThe mouse event's y coordinate.Fields inherited from class ro.sync.ecss.extensions.api.AuthorInputEvent
ALT_GRAPH_PRESSED, ALT_PRESSED, consumed, CTRL_PRESSED, META_PRESSED, modifiers, SHIFT_PRESSED -
Constructor Summary
ConstructorsConstructorDescriptionAuthorMouseEvent(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. -
Method Summary
Modifier and TypeMethodDescriptionintReturns which, if any, of the mouse buttons has changed state.intReturns the number of mouse clicks associated with this event.intgetState()Returns the state.protected StringgetStateDescription(int state) intgetX()Returns the horizontal x position of the event relative to the source component.intgetY()Returns the vertical y position of the event relative to the source component.booleanReturns whether or not this mouse event is the popup menu trigger event for the platform.toString()Methods inherited from class ro.sync.ecss.extensions.api.AuthorInputEvent
consume, getModifiers, isAltGraphPressed, isAltPressed, isCommandPressed, isCommandPressed, isConsumed, isCtrlPressed, isMetaPressed, isShiftPressed
-
Field Details
-
STATE_PRESSED
public static final int STATE_PRESSEDMouse pressed event type. The value is 1.- See Also:
-
STATE_RELEASED
public static final int STATE_RELEASEDMouse released event type. The value is 2.- See Also:
-
STATE_CLICKED
public static final int STATE_CLICKEDMouse clicked event type. The value is 3.- See Also:
-
STATE_MOVED
public static final int STATE_MOVEDMouse moved event type. The value is 4.- See Also:
-
STATE_DRAGGED
public static final int STATE_DRAGGEDMouse dragged event type. The value is 5.- See Also:
-
STATE_WHEEL_MOVED
public static final int STATE_WHEEL_MOVEDMouse wheel moved event type. The value is 6.- See Also:
-
BUTTON1
public static final int BUTTON1Indicates mouse button #1. The value is 1.- See Also:
-
BUTTON2
public static final int BUTTON2Indicates mouse button #2. The value is 2.- See Also:
-
BUTTON3
public static final int BUTTON3Indicates mouse button #3. The value is 3.- See Also:
-
NOBUTTON
public static final int NOBUTTONIndicates no mouse button. The value is 0.- See Also:
-
X
public final int XThe mouse event's x coordinate. The x value is relative to the author page. -
Y
public final int YThe mouse event's y coordinate. The y value is relative to the author page. -
popupTrigger
public final boolean popupTriggertrueif this event is a pop-up trigger. -
clickCount
public final int clickCountClick count. -
button
public final int buttonIndicates which, if any, of the mouse buttons has changed its state. The only legal values are the following constants:NOBUTTON,BUTTON1,BUTTON2orBUTTON3. -
state
public final int state -
wheelUp
public final boolean wheelUptrueif the mouse wheel is rotated up (away from the user),falseif the mouse wheel is rotated down (towards the user).
-
-
Constructor Details
-
AuthorMouseEvent
public AuthorMouseEvent(int x, int y, boolean isPopupTrigger, int state, int modifiers, int clickCount) Constructor for the author mouse event.- Parameters:
x- The x coordinate of the mouse event.y- The y coordinate of the mouse event.isPopupTrigger-trueif it is pop-up trigger.state- One of the constantsSTATE_PRESSED,STATE_RELEASED,STATE_CLICKED,STATE_MOVEDorSTATE_DRAGGED.modifiers- Marks if CTRL, SHIFT, ALT, ALT GR, META were pressed.clickCount- Click count.
-
AuthorMouseEvent
public AuthorMouseEvent(int x, int y, boolean isPopupTrigger, int state, int modifiers, int clickCount, int button) Constructor for the author mouse event.- Parameters:
x- The x coordinate of the mouse event.y- The y coordinate of the mouse event.isPopupTrigger-trueif it is pop-up trigger.state- One of the constantsSTATE_PRESSED,STATE_RELEASED,STATE_CLICKED,STATE_MOVEDorSTATE_DRAGGED.modifiers- Marks if CTRL, SHIFT, ALT, ALT GR, META were pressed.clickCount- Click count.button- One of the constantsBUTTON1,BUTTON2,BUTTON3,NOBUTTON.
-
AuthorMouseEvent
public AuthorMouseEvent(int x, int y, boolean isPopupTrigger, int state, int modifiers, int clickCount, int button, boolean wheelUp) Constructor for the author mouse event.- Parameters:
x- The x coordinate of the mouse event.y- The y coordinate of the mouse event.isPopupTrigger-trueif it is pop-up trigger.state- One of the constantsSTATE_PRESSED,STATE_RELEASED,STATE_CLICKED,STATE_MOVEDorSTATE_DRAGGED.modifiers- Marks if CTRL, SHIFT, ALT, ALT GR, META were pressed.clickCount- Click count.button- One of the constantsBUTTON1,BUTTON2,BUTTON3,NOBUTTON.wheelUp-trueif the mouse wheel is rotated up (away from the user),falseif the mouse wheel is rotated down (towards the user).
-
-
Method Details
-
toString
-
getStateDescription
- Returns:
- String representation for mouse state.
-
getClickCount
public int getClickCount()Returns the number of mouse clicks associated with this event.- Returns:
- integer value for the number of clicks
-
getButton
public int getButton()Returns which, if any, of the mouse buttons has changed state.- Returns:
- one of the following constants:
NOBUTTON,BUTTON1,BUTTON2orBUTTON3.
-
isPopupTrigger
public boolean isPopupTrigger()Returns whether or not this mouse event is the popup menu trigger event for the platform.Note: Popup menus are triggered differently on different systems. Therefore,
isPopupTriggershould be checked in bothmousePressedandmouseReleasedfor proper cross-platform functionality.- Returns:
- boolean, true if this event is the popup menu trigger for this platform
-
getX
public int getX()Returns the horizontal x position of the event relative to the source component.- Returns:
- x an integer indicating horizontal position relative to the component
-
getY
public int getY()Returns the vertical y position of the event relative to the source component.- Returns:
- y an integer indicating vertical position relative to the component
-
getState
public int getState()Returns the state.- Returns:
- one of the following constants:
STATE_PRESSED,STATE_RELEASED,STATE_CLICKEDSTATE_DRAGGEDorSTATE_MOVED.
-