eu.webtoolkit.jwt
Class WMouseEvent

java.lang.Object
  extended by eu.webtoolkit.jwt.WMouseEvent
All Implemented Interfaces:
WAbstractEvent

public class WMouseEvent
extends java.lang.Object
implements WAbstractEvent

A class providing details for a mouse event.

See Also:
WInteractWidget.clicked(), WInteractWidget.doubleClicked(), WInteractWidget.mouseWentDown(), WInteractWidget.mouseWentUp(), WInteractWidget.mouseWentOver(), WInteractWidget.mouseMoved()

Nested Class Summary
static class WMouseEvent.Button
          Enumeration for the mouse button.
 
Constructor Summary
WMouseEvent()
          Default constructor.
 
Method Summary
 WAbstractEvent createFromJSEvent(eu.webtoolkit.jwt.JavaScriptEvent jsEvent)
          Internal method.
 WMouseEvent.Button getButton()
          Returns the button.
 Coordinates getDocument()
          Returns the mouse position relative to the document.
 Coordinates getDragDelta()
          Returns the distance over which the mouse has been dragged.
 java.util.EnumSet<KeyboardModifier> getModifiers()
          Returns keyboard modifiers.
 Coordinates getScreen()
          Returns the mouse position relative to the screen.
 int getWheelDelta()
          Returns the scroll wheel delta.
 Coordinates getWidget()
          Returns the mouse position relative to the widget.
 Coordinates getWindow()
          Returns the mouse position relative to the window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WMouseEvent

public WMouseEvent()
Default constructor.

Method Detail

getButton

public WMouseEvent.Button 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 java.util.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