Class PointerEventInit
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.dom.events.EventInit
-
- org.pepstock.charba.client.dom.events.MouseEventInit
-
- org.pepstock.charba.client.dom.events.PointerEventInit
-
public class PointerEventInit extends MouseEventInit
Initialization object for aNativePointerEvent
.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description PointerEventInit()
Creates an empty objectPointerEventInit(int id)
Creates an object setting the pointer id by the passed argument.PointerEventInit(int id, PointerType type)
Creates an initialization object, setting the pointer id and the pointer type values.PointerEventInit(NativePointerEvent source)
Creates an initialization object, cloning all source event dataPointerEventInit(NativePointerEvent source, BaseHtmlElement relatedTarget)
Creates an initialization object, cloning all source event data and new related target.
-
Method Summary
All Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description int
getDetail()
When non-zero, provides the current (or next, depending on the event) click count.
For click events, is the current click count.
For mousedown or mouseup events, is 1 plus the current click count.
For all other, is always zero.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.default boolean
isAltKey()
Returns true if the alt key was down when the mouse event was fired.default boolean
isCtrlKey()
Returns true if the control key was down when the mouse event was fired.default boolean
isMetaKey()
Returns true if the meta key was down when the mouse event was fired.boolean
isPrimary()
Returnstrue
if the pointer represents the primary pointer of this pointer type.default boolean
isShiftKey()
Returns true if the shift key was down when the mouse event was fired.default void
setAltKey(boolean alt)
Sets true if the alt key was down when the mouse event was fired.default void
setCtrlKey(boolean ctrl)
Sets true if the control key was down when the mouse event was fired.void
setDetail(int detail)
Sets non-zero, provides the current (or next, depending on the event) click count.
For click events, is the current click count.
For mousedown or mouseup events, is 1 plus the current click count.
For all other, is always zerovoid
setHeight(double height)
Sets the height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer.void
setId(int id)
Sets a unique identifier for the pointer causing the event.default void
setMetaKey(boolean meta)
Sets true if the meta key was down when the mouse event was fired.void
setPointerType(PointerType pointerType)
Sets the device type that caused the event (mouse, pen, touch, etc.).void
setPressure(double pressure)
Sets 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.void
setPrimary(boolean isPrimary)
Setstrue
if the pointer represents the primary pointer of this pointer type.default void
setShiftKey(boolean shift)
Sets true if the shift key was down when the mouse event was fired.void
setTiltX(double tiltx)
Sets 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.void
setTiltY(double tilty)
Sets 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.void
setWidth(double width)
Sets the width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer.-
Methods inherited from class org.pepstock.charba.client.dom.events.MouseEventInit
getButton, getButtons, getClientX, getClientY, getModifiersHandler, getRelatedTarget, getScreenX, getScreenY, setButton, setButtons, setButtons, setClientX, setClientY, setRelatedTarget, setScreenX, setScreenY
-
Methods inherited from class org.pepstock.charba.client.dom.events.EventInit
isBubbles, isCancelable, setBubbles, setCancelable
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Constructor Detail
-
PointerEventInit
public PointerEventInit()
Creates an empty object
-
PointerEventInit
public PointerEventInit(int id)
Creates an object setting the pointer id by the passed argument.- Parameters:
id
- pointer id to set.
-
PointerEventInit
public PointerEventInit(int id, PointerType type)
Creates an initialization object, setting the pointer id and the pointer type values.- Parameters:
id
- pointer id to set.type
- pointer type initialization property.
-
PointerEventInit
public PointerEventInit(NativePointerEvent source)
Creates an initialization object, cloning all source event data- Parameters:
source
- source event to clone.
-
PointerEventInit
public PointerEventInit(NativePointerEvent source, BaseHtmlElement relatedTarget)
Creates an initialization object, cloning all source event data and new related target.- Parameters:
source
- source event to clone.relatedTarget
- new target of the event
-
-
Method Detail
-
getId
public final int getId()
Returns a unique identifier for the pointer causing the event.- Returns:
- a unique identifier for the pointer causing the event
-
setId
public final void setId(int id)
Sets a unique identifier for the pointer causing the event.- Parameters:
id
- a unique identifier for the pointer causing the event
-
getWidth
public final 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
-
setWidth
public final void setWidth(double width)
Sets the width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer.- Parameters:
width
- the width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer
-
getHeight
public final 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.
-
setHeight
public final void setHeight(double height)
Sets the height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer.- Parameters:
height
- the height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer.
-
getPressure
public final 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.
-
setPressure
public final void setPressure(double pressure)
Sets 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.- Parameters:
pressure
- 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
public final 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.
-
setTiltX
public final void setTiltX(double tiltx)
Sets 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.- Parameters:
tiltx
- 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
public final 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.
-
setTiltY
public final void setTiltY(double tilty)
Sets 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.- Parameters:
tilty
- 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.
-
getPointerType
public final 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.)
-
setPointerType
public final void setPointerType(PointerType pointerType)
Sets the device type that caused the event (mouse, pen, touch, etc.).- Parameters:
pointerType
- the device type that caused the event (mouse, pen, touch, etc.)
-
isPrimary
public final 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
-
setPrimary
public final void setPrimary(boolean isPrimary)
Setstrue
if the pointer represents the primary pointer of this pointer type.- Parameters:
isPrimary
-true
if the pointer represents the primary pointer of this pointer type
-
isAltKey
public default boolean isAltKey()
Returns true if the alt key was down when the mouse event was fired.- Returns:
- true if the alt key was down when the mouse event was fired
-
setAltKey
public default void setAltKey(boolean alt)
Sets true if the alt key was down when the mouse event was fired.- Parameters:
alt
- true if the alt key was down when the mouse event was fired
-
isCtrlKey
public default boolean isCtrlKey()
Returns true if the control key was down when the mouse event was fired.- Returns:
- true if the control key was down when the mouse event was fired
-
setCtrlKey
public default void setCtrlKey(boolean ctrl)
Sets true if the control key was down when the mouse event was fired.- Parameters:
ctrl
- true if the control key was down when the mouse event was fired
-
isMetaKey
public default boolean isMetaKey()
Returns true if the meta key was down when the mouse event was fired.- Returns:
- true if the meta key was down when the mouse event was fired
-
setMetaKey
public default void setMetaKey(boolean meta)
Sets true if the meta key was down when the mouse event was fired.- Parameters:
meta
- true if the meta key was down when the mouse event was fired
-
isShiftKey
public default boolean isShiftKey()
Returns true if the shift key was down when the mouse event was fired.- Returns:
- true if the shift key was down when the mouse event was fired
-
setShiftKey
public default void setShiftKey(boolean shift)
Sets true if the shift key was down when the mouse event was fired.- Parameters:
shift
- true if the shift key was down when the mouse event was fired
-
getDetail
public final int getDetail()
When non-zero, provides the current (or next, depending on the event) click count.
For click events, is the current click count.
For mousedown or mouseup events, is 1 plus the current click count.
For all other, is always zero.- Returns:
- When non-zero, provides the current (or next, depending on the event) click count.
For click events, is the current click count.
For mousedown or mouseup events, is 1 plus the current click count.
For all other, is always zero
-
setDetail
public final void setDetail(int detail)
Sets non-zero, provides the current (or next, depending on the event) click count.
For click events, is the current click count.
For mousedown or mouseup events, is 1 plus the current click count.
For all other, is always zero- Parameters:
detail
- non-zero, provides the current (or next, depending on the event) click count.
For click events, is the current click count.
For mousedown or mouseup events, is 1 plus the current click count.
For all other, is always zero
-
-