Package org.zkoss.stateless.action.data
Class MouseData
java.lang.Object
org.zkoss.stateless.action.data.MouseData
- All Implemented Interfaces:
Serializable,ActionData
- Direct Known Subclasses:
CellClickData,DropData
Represents mouse data by mouse activity
- Author:
- jumperchen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIndicates whether the Alt key is pressed.static final intIndicates whether the Ctrl key is pressed.static final intIndicates whether the left button is clicked.static final intIndicates whether the Meta key is pressed.static final intIndicates whether the middle button is clicked.static final intIndicates whether the right button is clicked.static final intIndicates whether the Shift key is pressed. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetArea()Returns the logical name of the area that the click occurs, or null if not available.final intgetKeys()Returns what keys were pressed when the mouse is clicked, or 0 if none of them was pressed.intgetPageX()Returns the horizontal coordinate of the mouse pointer relative to the whole document.intgetPageY()Returns the vertical coordinate of the mouse pointer relative to the whole document.intgetWhich()intgetX()Returns the horizontal coordinate of the mouse pointer relevant to the component.intgetY()Returns the vertical coordinate of the mouse pointer relevant to the component.booleanisAltKey()booleanbooleanboolean
-
Field Details
-
ALT_KEY
public static final int ALT_KEYIndicates whether the Alt key is pressed. It might be returned as part ofgetKeys().- See Also:
-
CTRL_KEY
public static final int CTRL_KEYIndicates whether the Ctrl key is pressed. It might be returned as part ofgetKeys().- See Also:
-
SHIFT_KEY
public static final int SHIFT_KEYIndicates whether the Shift key is pressed. It might be returned as part ofgetKeys().- See Also:
-
META_KEY
public static final int META_KEYIndicates whether the Meta key is pressed. It might be returned as part ofgetKeys().- See Also:
-
LEFT_CLICK
public static final int LEFT_CLICKIndicates whether the left button is clicked.- See Also:
-
RIGHT_CLICK
public static final int RIGHT_CLICKIndicates whether the right button is clicked.- See Also:
-
MIDDLE_CLICK
public static final int MIDDLE_CLICKIndicates whether the middle button is clicked.- See Also:
-
-
Constructor Details
-
MouseData
public MouseData()
-
-
Method Details
-
getX
public int getX()Returns the horizontal coordinate of the mouse pointer relevant to the component. -
getY
public int getY()Returns the vertical coordinate of the mouse pointer relevant to the component. -
getPageX
public int getPageX()Returns the horizontal coordinate of the mouse pointer relative to the whole document. -
getPageY
public int getPageY()Returns the vertical coordinate of the mouse pointer relative to the whole document. -
getWhich
public int getWhich() -
isAltKey
public boolean isAltKey() -
isCtrlKey
public boolean isCtrlKey() -
isShiftKey
public boolean isShiftKey() -
isMetaKey
public boolean isMetaKey() -
getArea
Returns the logical name of the area that the click occurs, or null if not available.- Returns:
-
getKeys
public final int getKeys()Returns what keys were pressed when the mouse is clicked, or 0 if none of them was pressed. It is a combination ofCTRL_KEY,SHIFT_KEYALT_KEY,LEFT_CLICKandRIGHT_CLICK.
-