Package org.zkoss.stateless.action.data
Class MouseData
- java.lang.Object
-
- org.zkoss.stateless.action.data.MouseData
-
- All Implemented Interfaces:
java.io.Serializable
,ActionData
- Direct Known Subclasses:
CellClickData
,DropData
public class MouseData extends java.lang.Object implements ActionData
Represents mouse data by mouse activity- Author:
- jumperchen
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
ALT_KEY
Indicates whether the Alt key is pressed.static int
CTRL_KEY
Indicates whether the Ctrl key is pressed.static int
LEFT_CLICK
Indicates whether the left button is clicked.static int
META_KEY
Indicates whether the Meta key is pressed.static int
MIDDLE_CLICK
Indicates whether the middle button is clicked.static int
RIGHT_CLICK
Indicates whether the right button is clicked.static int
SHIFT_KEY
Indicates whether the Shift key is pressed.
-
Constructor Summary
Constructors Constructor Description MouseData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getArea()
Returns the logical name of the area that the click occurs, or null if not available.int
getKeys()
Returns what keys were pressed when the mouse is clicked, or 0 if none of them was pressed.int
getPageX()
Returns the horizontal coordinate of the mouse pointer relative to the whole document.int
getPageY()
Returns the vertical coordinate of the mouse pointer relative to the whole document.int
getWhich()
int
getX()
Returns the horizontal coordinate of the mouse pointer relevant to the component.int
getY()
Returns the vertical coordinate of the mouse pointer relevant to the component.boolean
isAltKey()
boolean
isCtrlKey()
boolean
isMetaKey()
boolean
isShiftKey()
-
-
-
Field Detail
-
ALT_KEY
public static final int ALT_KEY
Indicates whether the Alt key is pressed. It might be returned as part ofgetKeys()
.- See Also:
- Constant Field Values
-
CTRL_KEY
public static final int CTRL_KEY
Indicates whether the Ctrl key is pressed. It might be returned as part ofgetKeys()
.- See Also:
- Constant Field Values
-
SHIFT_KEY
public static final int SHIFT_KEY
Indicates whether the Shift key is pressed. It might be returned as part ofgetKeys()
.- See Also:
- Constant Field Values
-
META_KEY
public static final int META_KEY
Indicates whether the Meta key is pressed. It might be returned as part ofgetKeys()
.- See Also:
- Constant Field Values
-
LEFT_CLICK
public static final int LEFT_CLICK
Indicates whether the left button is clicked.- See Also:
- Constant Field Values
-
RIGHT_CLICK
public static final int RIGHT_CLICK
Indicates whether the right button is clicked.- See Also:
- Constant Field Values
-
MIDDLE_CLICK
public static final int MIDDLE_CLICK
Indicates whether the middle button is clicked.- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public java.lang.String 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_KEY
ALT_KEY
,LEFT_CLICK
andRIGHT_CLICK
.
-
-