public abstract class

MouseEvent

extends HumanInputEvent<H extends EventHandler>
java.lang.Object
   ↳ com.google.gwt.event.shared.GwtEvent<H extends com.google.gwt.event.shared.EventHandler>
     ↳ com.google.gwt.event.dom.client.DomEvent<H extends com.google.gwt.event.shared.EventHandler>
       ↳ com.google.gwt.event.dom.client.HumanInputEvent<H extends com.google.gwt.event.shared.EventHandler>
         ↳ com.google.gwt.event.dom.client.MouseEvent<H extends com.google.gwt.event.shared.EventHandler>
Known Direct Subclasses

Class Overview

Abstract class representing mouse events.

Summary

Public Constructors
MouseEvent()
Public Methods
int getClientX()
Gets the mouse x-position within the browser window's client area.
int getClientY()
Gets the mouse y-position within the browser window's client area.
int getNativeButton()
Gets the button value.
int getRelativeX(Element target)
Gets the mouse x-position relative to a given element.
int getRelativeY(Element target)
Gets the mouse y-position relative to a given element.
int getScreenX()
Gets the mouse x-position on the user's display.
int getScreenY()
Gets the mouse y-position on the user's display.
int getX()
Gets the mouse x-position relative to the event's current target element.
int getY()
Gets the mouse y-position relative to the event's current target element.
[Expand]
Inherited Methods
From class com.google.gwt.event.dom.client.HumanInputEvent
From class com.google.gwt.event.dom.client.DomEvent
From class com.google.gwt.event.shared.GwtEvent
From class java.lang.Object
From interface com.google.gwt.event.dom.client.HasNativeEvent

Public Constructors

public MouseEvent ()

Public Methods

public int getClientX ()

Gets the mouse x-position within the browser window's client area.

Returns
  • the mouse x-position

public int getClientY ()

Gets the mouse y-position within the browser window's client area.

Returns
  • the mouse y-position

public int getNativeButton ()

Gets the button value. Compare it to BUTTON_LEFT, BUTTON_RIGHT, BUTTON_MIDDLE

Returns
  • the button value

public int getRelativeX (Element target)

Gets the mouse x-position relative to a given element.

Parameters
target the element whose coordinate system is to be used
Returns
  • the relative x-position

public int getRelativeY (Element target)

Gets the mouse y-position relative to a given element.

Parameters
target the element whose coordinate system is to be used
Returns
  • the relative y-position

public int getScreenX ()

Gets the mouse x-position on the user's display.

Returns
  • the mouse x-position

public int getScreenY ()

Gets the mouse y-position on the user's display.

Returns
  • the mouse y-position

public int getX ()

Gets the mouse x-position relative to the event's current target element.

Returns
  • the relative x-position

public int getY ()

Gets the mouse y-position relative to the event's current target element.

Returns
  • the relative y-position