@JsType(isNative=true, name="Object", namespace="<global>") public class BaseNativeEvent extends Object implements IsCastable
Modifier and Type | Method and Description |
---|---|
int |
getButton()
Returns the button number that was pressed (if applicable) when the mouse event was fired.
|
int |
getButtons()
Returns the buttons being depressed (if any) when the mouse event was fired.
|
TouchList |
getChangedTouches()
Returns a list of all the touch objects representing individual points of contact whose states changed between the previous touch event and this one.
|
double |
getClientX()
Returns the X coordinate of the mouse pointer in local (DOM content) coordinates.
|
double |
getClientY()
Returns the Y coordinate of the mouse pointer in local (DOM content) coordinates.
|
BaseEventTarget |
getCurrentTarget()
Returns a reference to the currently registered target for the event.
This is the object to which the event is currently slated to be sent. |
int |
getLayerX()
Returns the horizontal coordinate of the event relative to the current layer.
|
int |
getLayerY()
Returns the vertical coordinate of the event relative to the current layer.
|
double |
getOffsetX()
Returns the X coordinate of the mouse pointer relative to the position of the padding edge of the target node.
|
double |
getOffsetY()
Returns the Y coordinate of the mouse pointer relative to the position of the padding edge of the target node.
|
double |
getPageX()
Returns the X coordinate of the mouse pointer relative to the whole document.
|
double |
getPageY()
Returns the Y coordinate of the mouse pointer relative to the whole document.
|
BaseHtmlElement |
getRelatedTarget()
Returns the secondary target for the event, if there is one.
|
double |
getScreenX()
Returns the X coordinate of the mouse pointer in global (screen) coordinates.
|
double |
getScreenY()
Returns the Y coordinate of the mouse pointer in global (screen) coordinates.
|
BaseEventTarget |
getTarget()
Returns a reference to the target to which the event was originally dispatched.
|
TouchList |
getTargetTouches()
Returns a list of all the touch objects that are both currently in contact with the touch surface and were also started on the same element that is the target of the event.
|
TouchList |
getTouches()
Returns a list of all the touch objects representing all current points of contact with the surface, regardless of target or changed status.
|
String |
getType()
Returns the type of the event.
|
double |
getX()
Returns the horizontal coordinate of the event relative to the current layer.
|
double |
getY()
Returns the vertical coordinate of the event relative to the current layer.
|
void |
initEvent(String eventTypeArg,
boolean bubbles,
boolean cancelable)
Initialize the value of a created event.
|
boolean |
isAltKey()
Returns true if the alt key was down when the mouse event was fired.
|
boolean |
isCtrlKey()
Returns true if the control key was down when the mouse event was fired.
|
boolean |
isDefaultPrevented()
Indicates whether or not the call to
BaseEvent.preventDefault() canceled the event. |
boolean |
isMetaKey()
Returns true if the meta key was down when the mouse event was fired.
|
boolean |
isShiftKey()
Returns true if the shift key was down when the mouse event was fired.
|
void |
preventDefault()
Cancels the event (if it is cancelable).
|
void |
stopImmediatePropagation()
Prevents all other listeners from being called.
|
void |
stopPropagation()
Stops the propagation of events further along in the DOM.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
as
@JsProperty public final boolean isAltKey()
@JsProperty public final int getButton()
@JsProperty public final int getButtons()
@JsProperty public final double getClientX()
@JsProperty public final double getClientY()
@JsProperty public final boolean isCtrlKey()
@JsProperty public final boolean isMetaKey()
@JsProperty public final double getOffsetX()
@JsProperty public final double getOffsetY()
@JsProperty public final double getPageX()
@JsProperty public final double getPageY()
@JsProperty public final double getScreenX()
@JsProperty public final double getScreenY()
@JsProperty public final boolean isShiftKey()
@JsProperty public final BaseHtmlElement getRelatedTarget()
@JsProperty public final TouchList getChangedTouches()
@JsProperty public final TouchList getTargetTouches()
@JsProperty public final TouchList getTouches()
@JsProperty public final int getLayerX()
@JsProperty public final int getLayerY()
@JsOverlay public final double getX()
@JsOverlay public final double getY()
@JsProperty public final BaseEventTarget getCurrentTarget()
@JsProperty public final boolean isDefaultPrevented()
BaseEvent.preventDefault()
canceled the event.BaseEvent.preventDefault()
canceled the event@JsProperty public final BaseEventTarget getTarget()
@JsProperty public final String getType()
@JsMethod public final void initEvent(String eventTypeArg, boolean bubbles, boolean cancelable)
eventTypeArg
- a string which is defining the type of eventbubbles
- deciding whether the event should bubble up through the event chain or notcancelable
- defining whether the event can be canceled@JsMethod public final void preventDefault()
@JsMethod public final void stopImmediatePropagation()
@JsMethod public final void stopPropagation()