Interface MouseEventParams

All Superinterfaces:
EventParams, UiEventModifierParams
All Known Subinterfaces:
WheelEventParams

public interface MouseEventParams extends UiEventModifierParams
The DOM mouse event parameters.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    A builder of MouseEventParams.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a button pressed during events caused by pressing or releasing one or multiple buttons.
    default int
    Returns the count of consecutive clicks that happened in a short amount of time for mouse events, such as "click", "mouseDown, "mouseUp".
    default Point
    Returns the location of the mouse cursor in the local (DOM content) coordinate system at the time the event occurred.
    default boolean
    Returns true if the event bubbles up through the DOM.
    default boolean
    Returns true if the event can be canceled, and therefore prevented as if the event never happened.
    default boolean
    Returns true if the event is trusted, and therefore was generated by a user action.
    default KeyModifiers
    Returns the key modifiers that are applied to the event.
    Creates a new MouseEventParams builder.
    default Point
    Returns the location of the mouse cursor in the component's coordinate system at the time the event occurred.
    default Point
    Returns the location of the mouse cursor in the document coordinate system at the time the event occurred.
    default Point
    Returns the location of the mouse cursor in the screen's coordinate system at the time the event occurred.
  • Method Details

    • newBuilder

      static MouseEventParams.Builder newBuilder()
      Creates a new MouseEventParams builder.
      Returns:
      a new MouseEventParams.Builder instance
    • isBubbles

      default boolean isBubbles()
      Returns true if the event bubbles up through the DOM.
      Specified by:
      isBubbles in interface EventParams
      Specified by:
      isBubbles in interface UiEventModifierParams
    • isCancelable

      default boolean isCancelable()
      Returns true if the event can be canceled, and therefore prevented as if the event never happened.
      Specified by:
      isCancelable in interface EventParams
      Specified by:
      isCancelable in interface UiEventModifierParams
    • isTrusted

      default boolean isTrusted()
      Returns true if the event is trusted, and therefore was generated by a user action.
      Specified by:
      isTrusted in interface EventParams
      Specified by:
      isTrusted in interface UiEventModifierParams
      Since:
      7.12
    • clientLocation

      default Point clientLocation()
      Returns the location of the mouse cursor in the local (DOM content) coordinate system at the time the event occurred.
    • screenLocation

      default Point screenLocation()
      Returns the location of the mouse cursor in the screen's coordinate system at the time the event occurred.
    • offsetLocation

      default Point offsetLocation()
      Returns the location of the mouse cursor in the component's coordinate system at the time the event occurred.

      For example, clicking in the top-left corner of the client area will always result in that the x field of the result equals 0, regardless of whether the page is scrolled horizontally.

      Since:
      7.8
    • pageLocation

      default Point pageLocation()
      Returns the location of the mouse cursor in the document coordinate system at the time the event occurred.
      Since:
      7.12
    • button

      default MouseEvent.Button button()
      Returns a button pressed during events caused by pressing or releasing one or multiple buttons. As such, it is not reliable for events such as mouseenter, mouseleave, mouseover, mouseout or mousemove.

      Users may change the configuration of buttons on their pointing device so that if an event's button property is MouseEvent.Button.MAIN (left), it may not have been caused by the button that is physically left–most on the pointing device; however, it should behave as if the left button was clicked in the standard button layout.

    • clickCount

      default int clickCount()
      Returns the count of consecutive clicks that happened in a short amount of time for mouse events, such as "click", "mouseDown, "mouseUp".

      For all other UI events returns 0.

    • keyModifiers

      default KeyModifiers keyModifiers()
      Returns the key modifiers that are applied to the event.
      Specified by:
      keyModifiers in interface UiEventModifierParams