Class WMouseEvent

All Implemented Interfaces:

public class WMouseEvent extends Object implements WAbstractEvent
A class providing details for a mouse event.

See Also:
  • Constructor Details

    • WMouseEvent

      public WMouseEvent()
      Default constructor.
  • Method Details

    • getButton

      public MouseButton getButton()
      Returns the button.

      If multiple buttons are currently pressed for a mouse moved or mouse dragged event, then the one with the smallest numerical value is returned.

    • getModifiers

      public EnumSet<KeyboardModifier> getModifiers()
      Returns keyboard modifiers.

      The result is a logical OR of KeyboardModifier flags.

    • getDocument

      public Coordinates getDocument()
      Returns the mouse position relative to the document.
    • getWindow

      public Coordinates getWindow()
      Returns the mouse position relative to the window.

      This differs from documentX() only through scrolling through the document.

    • getScreen

      public Coordinates getScreen()
      Returns the mouse position relative to the screen.
    • getWidget

      public Coordinates getWidget()
      Returns the mouse position relative to the widget.
    • getDragDelta

      public Coordinates getDragDelta()
      Returns the distance over which the mouse has been dragged.

      This is only defined for a WInteractWidget.mouseWentUp() event.

    • getWheelDelta

      public int getWheelDelta()
      Returns the scroll wheel delta.

      This is 1 when wheel was scrolled up or -1 when wheel was scrolled down.

      This is only defined for a WInteractWidget.mouseWheel() event.

    • createFromJSEvent

      public WAbstractEvent createFromJSEvent(eu.webtoolkit.jwt.JavaScriptEvent jsEvent)
      Description copied from interface: WAbstractEvent
      Internal method.
      Specified by:
      createFromJSEvent in interface WAbstractEvent