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 intALT_KEYIndicates whether the Alt key is pressed.static intCTRL_KEYIndicates whether the Ctrl key is pressed.static intLEFT_CLICKIndicates whether the left button is clicked.static intMETA_KEYIndicates whether the Meta key is pressed.static intMIDDLE_CLICKIndicates whether the middle button is clicked.static intRIGHT_CLICKIndicates whether the right button is clicked.static intSHIFT_KEYIndicates 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.StringgetArea()Returns the logical name of the area that the click occurs, or null if not available.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()booleanisCtrlKey()booleanisMetaKey()booleanisShiftKey()
-
-
-
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_KEYALT_KEY,LEFT_CLICKandRIGHT_CLICK.
-
-