Class MouseEventInit
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.dom.events.EventInit
-
- org.pepstock.charba.client.dom.events.MouseEventInit
-
- Direct Known Subclasses:
PointerEventInit
public class MouseEventInit extends EventInit
Initialization object for aNativeMouseEvent.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description MouseEventInit()Creates an empty objectMouseEventInit(double clientX, double clientY)Creates an initialization object, setting the clientX and clientY values.MouseEventInit(double clientX, double clientY, double screenX, double screenY)Creates an initialization object, setting the clientX, clientY, screenX and screenY values.MouseEventInit(NativeMouseEvent source)Creates an initialization object, cloning all source event dataMouseEventInit(NativeMouseEvent 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 EventButtongetButton()Returns aEventButtonthat describes which button is pressed during events related to the press or release of a button.List<EventButton>getButtons()Returns a list ofEventButtonthat describes which buttons are pressed when the event is launched.doublegetClientX()Returns the horizontal position of the mouse event on the client window of user's screen; setting this value doesn't move the mouse pointer.doublegetClientY()Returns the vertical position of the mouse event on the client window of the user's screen; setting this value doesn't move the mouse pointer.intgetDetail()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.org.pepstock.charba.client.dom.events.ModifiersHandlergetModifiersHandler()BaseEventTargetgetRelatedTarget()Returns anBaseHtmlElement, defaulting to null that is the element just left (in case of aMouseEventType.MOUSE_ENTERorMouseEventType.MOUSE_OVER) or is entering (in case of aMouseEventType.MOUSE_OUTorMouseEventType.MOUSE_LEAVE).doublegetScreenX()Returns the X coordinate of the mouse pointer in global (screen) coordinates.doublegetScreenY()Returns the Y coordinate of the mouse pointer in global (screen) coordinates.default booleanisAltKey()Returns true if the alt key was down when the mouse event was fired.default booleanisCtrlKey()Returns true if the control key was down when the mouse event was fired.default booleanisMetaKey()Returns true if the meta key was down when the mouse event was fired.default booleanisShiftKey()Returns true if the shift key was down when the mouse event was fired.default voidsetAltKey(boolean alt)Sets true if the alt key was down when the mouse event was fired.voidsetButton(EventButton button)Sets aEventButtonthat describes which button is pressed during events related to the press or release of a button.voidsetButtons(List<EventButton> buttons)Sets a list ofEventButtonthat describes which buttons are pressed when the event is launched.voidsetButtons(EventButton... buttons)Sets an array ofEventButtonthat describes which buttons are pressed when the event is launched.voidsetClientX(double clientX)Sets the horizontal position of the mouse event on the client window of user's screen; setting this value doesn't move the mouse pointer.voidsetClientY(double clientY)Sets the vertical position of the mouse event on the client window of the user's screen; setting this value doesn't move the mouse pointer.default voidsetCtrlKey(boolean ctrl)Sets true if the control key was down when the mouse event was fired.voidsetDetail(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 zerodefault voidsetMetaKey(boolean meta)Sets true if the meta key was down when the mouse event was fired.voidsetRelatedTarget(BaseEventTarget relatedTarget)Sets anBaseHtmlElement, defaulting to null that is the element just left (in case of aMouseEventType.MOUSE_ENTERorMouseEventType.MOUSE_OVER) or is entering (in case of aMouseEventType.MOUSE_OUTorMouseEventType.MOUSE_LEAVE).voidsetScreenX(double screenX)Sets the X coordinate of the mouse pointer in global (screen) coordinates.voidsetScreenY(double screenY)Sets the Y coordinate of the mouse pointer in global (screen) coordinates.default voidsetShiftKey(boolean shift)Sets true if the shift key was down when the mouse event was fired.-
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
checkAndGetColor, 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, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Constructor Detail
-
MouseEventInit
public MouseEventInit()
Creates an empty object
-
MouseEventInit
public MouseEventInit(double clientX, double clientY)Creates an initialization object, setting the clientX and clientY values.- Parameters:
clientX- clientX initialization property.clientY- clientY initialization property.
-
MouseEventInit
public MouseEventInit(double clientX, double clientY, double screenX, double screenY)Creates an initialization object, setting the clientX, clientY, screenX and screenY values.- Parameters:
clientX- clientX initialization property.clientY- clientY initialization property.screenX- screenX initialization property.screenY- screenY initialization property.
-
MouseEventInit
public MouseEventInit(NativeMouseEvent source)
Creates an initialization object, cloning all source event data- Parameters:
source- source event to clone.
-
MouseEventInit
public MouseEventInit(NativeMouseEvent 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
-
getModifiersHandler
public final org.pepstock.charba.client.dom.events.ModifiersHandler getModifiersHandler()
-
getButton
public final EventButton getButton()
Returns aEventButtonthat describes which button is pressed during events related to the press or release of a button.- Returns:
- a
EventButtonthat describes which button is pressed during events related to the press or release of a button
-
setButton
public final void setButton(EventButton button)
Sets aEventButtonthat describes which button is pressed during events related to the press or release of a button.- Parameters:
button- aEventButtonthat describes which button is pressed during events related to the press or release of a button
-
getButtons
public final List<EventButton> getButtons()
Returns a list ofEventButtonthat describes which buttons are pressed when the event is launched.- Returns:
- a list of
EventButtonthat describes which buttons are pressed when the event is launched
-
setButtons
public final void setButtons(EventButton... buttons)
Sets an array ofEventButtonthat describes which buttons are pressed when the event is launched.- Parameters:
buttons- an array ofEventButtonthat describes which buttons are pressed when the event is launched
-
setButtons
public final void setButtons(List<EventButton> buttons)
Sets a list ofEventButtonthat describes which buttons are pressed when the event is launched.- Parameters:
buttons- a list ofEventButtonthat describes which buttons are pressed when the event is launched
-
getClientX
public final double getClientX()
Returns the horizontal position of the mouse event on the client window of user's screen; setting this value doesn't move the mouse pointer.- Returns:
- the horizontal position of the mouse event on the client window of user's screen
-
setClientX
public final void setClientX(double clientX)
Sets the horizontal position of the mouse event on the client window of user's screen; setting this value doesn't move the mouse pointer.- Parameters:
clientX- the horizontal position of the mouse event on the client window of user's screen
-
getClientY
public final double getClientY()
Returns the vertical position of the mouse event on the client window of the user's screen; setting this value doesn't move the mouse pointer.- Returns:
- the vertical position of the mouse event on the client window of the user's screen
-
setClientY
public final void setClientY(double clientY)
Sets the vertical position of the mouse event on the client window of the user's screen; setting this value doesn't move the mouse pointer.- Parameters:
clientY- the vertical position of the mouse event on the client window of the user's screen
-
getRelatedTarget
public final BaseEventTarget getRelatedTarget()
Returns anBaseHtmlElement, defaulting to null that is the element just left (in case of aMouseEventType.MOUSE_ENTERorMouseEventType.MOUSE_OVER) or is entering (in case of aMouseEventType.MOUSE_OUTorMouseEventType.MOUSE_LEAVE).- Returns:
- an
BaseHtmlElement, defaulting to null that is the element just left (in case of aMouseEventType.MOUSE_ENTERorMouseEventType.MOUSE_OVER) or is entering (in case of aMouseEventType.MOUSE_OUTorMouseEventType.MOUSE_LEAVE)
-
setRelatedTarget
public final void setRelatedTarget(BaseEventTarget relatedTarget)
Sets anBaseHtmlElement, defaulting to null that is the element just left (in case of aMouseEventType.MOUSE_ENTERorMouseEventType.MOUSE_OVER) or is entering (in case of aMouseEventType.MOUSE_OUTorMouseEventType.MOUSE_LEAVE).- Parameters:
relatedTarget- anBaseHtmlElement, defaulting to null that is the element just left (in case of aMouseEventType.MOUSE_ENTERorMouseEventType.MOUSE_OVER) or is entering (in case of aMouseEventType.MOUSE_OUTorMouseEventType.MOUSE_LEAVE)
-
getScreenX
public final double getScreenX()
Returns the X coordinate of the mouse pointer in global (screen) coordinates.- Returns:
- the X coordinate of the mouse pointer in global (screen) coordinates
-
setScreenX
public final void setScreenX(double screenX)
Sets the X coordinate of the mouse pointer in global (screen) coordinates.- Parameters:
screenX- the X coordinate of the mouse pointer in global (screen) coordinates
-
getScreenY
public final double getScreenY()
Returns the Y coordinate of the mouse pointer in global (screen) coordinates.- Returns:
- the Y coordinate of the mouse pointer in global (screen) coordinates
-
setScreenY
public final void setScreenY(double screenY)
Sets the Y coordinate of the mouse pointer in global (screen) coordinates.- Parameters:
screenY- the Y coordinate of the mouse pointer in global (screen) coordinates
-
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
-
-