Class MouseData

java.lang.Object
org.zkoss.stateless.action.data.MouseData
All Implemented Interfaces:
Serializable, ActionData
Direct Known Subclasses:
CellClickData, DropData

public class MouseData extends Object implements ActionData
Represents mouse data by mouse activity
Author:
jumperchen
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Indicates whether the Alt key is pressed.
    static final int
    Indicates whether the Ctrl key is pressed.
    static final int
    Indicates whether the left button is clicked.
    static final int
    Indicates whether the Meta key is pressed.
    static final int
    Indicates whether the middle button is clicked.
    static final int
    Indicates whether the right button is clicked.
    static final int
    Indicates whether the Shift key is pressed.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the logical name of the area that the click occurs, or null if not available.
    final int
    Returns what keys were pressed when the mouse is clicked, or 0 if none of them was pressed.
    int
    Returns the horizontal coordinate of the mouse pointer relative to the whole document.
    int
    Returns the vertical coordinate of the mouse pointer relative to the whole document.
    int
     
    int
    Returns the horizontal coordinate of the mouse pointer relevant to the component.
    int
    Returns the vertical coordinate of the mouse pointer relevant to the component.
    boolean
     
    boolean
     
    boolean
     
    boolean
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • ALT_KEY

      public static final int ALT_KEY
      Indicates whether the Alt key is pressed. It might be returned as part of getKeys().
      See Also:
    • CTRL_KEY

      public static final int CTRL_KEY
      Indicates whether the Ctrl key is pressed. It might be returned as part of getKeys().
      See Also:
    • SHIFT_KEY

      public static final int SHIFT_KEY
      Indicates whether the Shift key is pressed. It might be returned as part of getKeys().
      See Also:
    • META_KEY

      public static final int META_KEY
      Indicates whether the Meta key is pressed. It might be returned as part of getKeys().
      See Also:
    • LEFT_CLICK

      public static final int LEFT_CLICK
      Indicates whether the left button is clicked.
      See Also:
    • RIGHT_CLICK

      public static final int RIGHT_CLICK
      Indicates whether the right button is clicked.
      See Also:
    • MIDDLE_CLICK

      public static final int MIDDLE_CLICK
      Indicates 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

      public 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 of CTRL_KEY, SHIFT_KEY ALT_KEY, LEFT_CLICK and RIGHT_CLICK.