Class NativePointerEvent
- java.lang.Object
-
- org.pepstock.charba.client.dom.events.NativeBaseEvent
-
- org.pepstock.charba.client.dom.events.NativeUIEvent
-
- org.pepstock.charba.client.dom.events.NativeAbstractMouseEvent
-
- org.pepstock.charba.client.dom.events.NativePointerEvent
-
- All Implemented Interfaces:
IsJSType
,IsCastable
@JsType(isNative=true, name="PointerEvent", namespace="<global>") public final class NativePointerEvent extends NativeAbstractMouseEvent
Much of today's web content assumes the user's pointing device will be a mouse.
However, since many devices support other types of pointing input devices, such as pen/stylus and touch surfaces, extensions to the existing pointing device event models are needed.
Pointer events address that need.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NativePointerEvent
createPointerEvent(String type)
Creates a new event object for a specific event type.static NativePointerEvent
createPointerEvent(String type, PointerEventInit init)
Creates a new event object for a specific event type with initial configuration.static NativePointerEvent
createPointerEvent(IsEvent type)
Creates a new event object for a specific event type.static NativePointerEvent
createPointerEvent(IsEvent type, PointerEventInit init)
Creates a new event object for a specific event type with initial configuration.double
getHeight()
Returns the height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer.int
getId()
Returns a unique identifier for the pointer causing the event.PointerType
getPointerType()
Returns the device type that caused the event (mouse, pen, touch, etc.).double
getPressure()
Returns the normalized pressure of the pointer input in the range of 0 to 1, where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively.double
getTiltX()
Returns the plane angle (in degrees, in the range of -90 to 90) between the Y–Z plane and the plane containing both the pointer (e.g.double
getTiltY()
Returns the plane angle (in degrees, in the range of -90 to 90) between the X–Z plane and the plane containing both the pointer (e.g.double
getWidth()
Returns the width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer.boolean
isPrimary()
Returnstrue
if the pointer represents the primary pointer of this pointer type.-
Methods inherited from class org.pepstock.charba.client.dom.events.NativeAbstractMouseEvent
getButton, getButtons, getClientX, getClientY, getLayerX, getLayerY, getOffsetX, getOffsetY, getPageX, getPageY, getRelatedTarget, getScreenX, getScreenY, getX, getY, isAltKey, isCtrlKey, isMetaKey, isShiftKey
-
Methods inherited from class org.pepstock.charba.client.dom.events.NativeUIEvent
getDetail, getModifierState
-
Methods inherited from class org.pepstock.charba.client.dom.events.NativeBaseEvent
createEvent, createEvent, createEvent, createEvent, getCurrentTarget, getEventPhase, getTarget, getType, isBubbles, isCancelable, isDefaultPrevented, preventDefault, stopImmediatePropagation, stopPropagation
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.dom.IsCastable
as
-
-
-
-
Method Detail
-
getId
@JsProperty(name="pointerId") public int getId()
Returns a unique identifier for the pointer causing the event.- Returns:
- a unique identifier for the pointer causing the event
-
getWidth
@JsProperty public double getWidth()
Returns the width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer.- Returns:
- the width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer
-
getHeight
@JsProperty public double getHeight()
Returns the height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer.- Returns:
- the height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer.
-
getPressure
@JsProperty public double getPressure()
Returns the normalized pressure of the pointer input in the range of 0 to 1, where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively.- Returns:
- the normalized pressure of the pointer input in the range of 0 to 1, where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively.
-
getTiltX
@JsProperty public double getTiltX()
Returns the plane angle (in degrees, in the range of -90 to 90) between the Y–Z plane and the plane containing both the pointer (e.g. pen stylus) axis and the Y axis.- Returns:
- the plane angle (in degrees, in the range of -90 to 90) between the Y–Z plane and the plane containing both the pointer (e.g. pen stylus) axis and the Y axis.
-
getTiltY
@JsProperty public double getTiltY()
Returns the plane angle (in degrees, in the range of -90 to 90) between the X–Z plane and the plane containing both the pointer (e.g. pen stylus) axis and the X axis.- Returns:
- the plane angle (in degrees, in the range of -90 to 90) between the X–Z plane and the plane containing both the pointer (e.g. pen stylus) axis and the X axis.
-
isPrimary
@JsProperty(name="isPrimary") public boolean isPrimary()
Returnstrue
if the pointer represents the primary pointer of this pointer type.- Returns:
true
if the pointer represents the primary pointer of this pointer type
-
createPointerEvent
@JsOverlay public static NativePointerEvent createPointerEvent(String type)
Creates a new event object for a specific event type.- Parameters:
type
- type of event- Returns:
- a new event object for a specific event type
-
createPointerEvent
@JsOverlay public static NativePointerEvent createPointerEvent(IsEvent type)
Creates a new event object for a specific event type.- Parameters:
type
- type of event- Returns:
- a new event object for a specific event type
-
createPointerEvent
@JsOverlay public static NativePointerEvent createPointerEvent(IsEvent type, PointerEventInit init)
Creates a new event object for a specific event type with initial configuration.- Parameters:
type
- type of eventinit
- initial configuration of the event- Returns:
- a new event object for a specific event type
-
createPointerEvent
@JsOverlay public static NativePointerEvent createPointerEvent(String type, PointerEventInit init)
Creates a new event object for a specific event type with initial configuration.- Parameters:
type
- type of eventinit
- initial configuration of the event- Returns:
- a new event object for a specific event type
-
getPointerType
@JsOverlay public PointerType getPointerType()
Returns the device type that caused the event (mouse, pen, touch, etc.).- Returns:
- the device type that caused the event (mouse, pen, touch, etc.)
-
-