Class MouseEventInit

    • Constructor Detail

      • MouseEventInit

        public MouseEventInit()
        Creates an empty object
      • MouseEventInit

        public MouseEventInit​(double clientX,
                              double clientY)
        Creates an initialization object, setting the clientX and clientY values.
        Parameters:
        clientX - clientX initialization property.
        clientY - clientY initialization property.
      • MouseEventInit

        public MouseEventInit​(double clientX,
                              double clientY,
                              double screenX,
                              double screenY)
        Creates an initialization object, setting the clientX, clientY, screenX and screenY values.
        Parameters:
        clientX - clientX initialization property.
        clientY - clientY initialization property.
        screenX - screenX initialization property.
        screenY - screenY initialization property.
      • MouseEventInit

        public MouseEventInit​(NativeMouseEvent source)
        Creates an initialization object, cloning all source event data
        Parameters:
        source - source event to clone.
      • MouseEventInit

        public MouseEventInit​(NativeMouseEvent source,
                              BaseHtmlElement relatedTarget)
        Creates an initialization object, cloning all source event data and new related target.
        Parameters:
        source - source event to clone.
        relatedTarget - new target of the event
    • Method Detail

      • getModifiersHandler

        public final org.pepstock.charba.client.dom.events.ModifiersHandler getModifiersHandler()
      • getButton

        public final EventButton getButton()
        Returns a EventButton that describes which button is pressed during events related to the press or release of a button.
        Returns:
        a EventButton that describes which button is pressed during events related to the press or release of a button
      • setButton

        public final void setButton​(EventButton button)
        Sets a EventButton that describes which button is pressed during events related to the press or release of a button.
        Parameters:
        button - a EventButton that describes which button is pressed during events related to the press or release of a button
      • getButtons

        public final List<EventButton> getButtons()
        Returns a list of EventButton that describes which buttons are pressed when the event is launched.
        Returns:
        a list of EventButton that describes which buttons are pressed when the event is launched
      • setButtons

        public final void setButtons​(EventButton... buttons)
        Sets an array of EventButton that describes which buttons are pressed when the event is launched.
        Parameters:
        buttons - an array of EventButton that describes which buttons are pressed when the event is launched
      • setButtons

        public final void setButtons​(List<EventButton> buttons)
        Sets a list of EventButton that describes which buttons are pressed when the event is launched.
        Parameters:
        buttons - a list of EventButton that describes which buttons are pressed when the event is launched
      • getClientX

        public final double getClientX()
        Returns the horizontal position of the mouse event on the client window of user's screen; setting this value doesn't move the mouse pointer.
        Returns:
        the horizontal position of the mouse event on the client window of user's screen
      • setClientX

        public final void setClientX​(double clientX)
        Sets the horizontal position of the mouse event on the client window of user's screen; setting this value doesn't move the mouse pointer.
        Parameters:
        clientX - the horizontal position of the mouse event on the client window of user's screen
      • getClientY

        public final double getClientY()
        Returns the vertical position of the mouse event on the client window of the user's screen; setting this value doesn't move the mouse pointer.
        Returns:
        the vertical position of the mouse event on the client window of the user's screen
      • setClientY

        public final void setClientY​(double clientY)
        Sets the vertical position of the mouse event on the client window of the user's screen; setting this value doesn't move the mouse pointer.
        Parameters:
        clientY - the vertical position of the mouse event on the client window of the user's screen
      • getScreenX

        public final double getScreenX()
        Returns the X coordinate of the mouse pointer in global (screen) coordinates.
        Returns:
        the X coordinate of the mouse pointer in global (screen) coordinates
      • setScreenX

        public final void setScreenX​(double screenX)
        Sets the X coordinate of the mouse pointer in global (screen) coordinates.
        Parameters:
        screenX - the X coordinate of the mouse pointer in global (screen) coordinates
      • getScreenY

        public final double getScreenY()
        Returns the Y coordinate of the mouse pointer in global (screen) coordinates.
        Returns:
        the Y coordinate of the mouse pointer in global (screen) coordinates
      • setScreenY

        public final void setScreenY​(double screenY)
        Sets the Y coordinate of the mouse pointer in global (screen) coordinates.
        Parameters:
        screenY - the Y coordinate of the mouse pointer in global (screen) coordinates
      • isAltKey

        public default boolean isAltKey()
        Returns true if the alt key was down when the mouse event was fired.
        Returns:
        true if the alt key was down when the mouse event was fired
      • setAltKey

        public default void setAltKey​(boolean alt)
        Sets true if the alt key was down when the mouse event was fired.
        Parameters:
        alt - true if the alt key was down when the mouse event was fired
      • isCtrlKey

        public default boolean isCtrlKey()
        Returns true if the control key was down when the mouse event was fired.
        Returns:
        true if the control key was down when the mouse event was fired
      • setCtrlKey

        public default void setCtrlKey​(boolean ctrl)
        Sets true if the control key was down when the mouse event was fired.
        Parameters:
        ctrl - true if the control key was down when the mouse event was fired
      • isMetaKey

        public default boolean isMetaKey()
        Returns true if the meta key was down when the mouse event was fired.
        Returns:
        true if the meta key was down when the mouse event was fired
      • setMetaKey

        public default void setMetaKey​(boolean meta)
        Sets true if the meta key was down when the mouse event was fired.
        Parameters:
        meta - true if the meta key was down when the mouse event was fired
      • isShiftKey

        public default boolean isShiftKey()
        Returns true if the shift key was down when the mouse event was fired.
        Returns:
        true if the shift key was down when the mouse event was fired
      • setShiftKey

        public default void setShiftKey​(boolean shift)
        Sets true if the shift key was down when the mouse event was fired.
        Parameters:
        shift - true if the shift key was down when the mouse event was fired
      • getDetail

        public final int getDetail()
        When non-zero, provides the current (or next, depending on the event) click count.
        For click events, is the current click count.
        For mousedown or mouseup events, is 1 plus the current click count.
        For all other, is always zero.
        Returns:
        When non-zero, provides the current (or next, depending on the event) click count.
        For click events, is the current click count.
        For mousedown or mouseup events, is 1 plus the current click count.
        For all other, is always zero
      • setDetail

        public final void setDetail​(int detail)
        Sets non-zero, provides the current (or next, depending on the event) click count.
        For click events, is the current click count.
        For mousedown or mouseup events, is 1 plus the current click count.
        For all other, is always zero
        Parameters:
        detail - non-zero, provides the current (or next, depending on the event) click count.
        For click events, is the current click count.
        For mousedown or mouseup events, is 1 plus the current click count.
        For all other, is always zero