@DOMObjectAttribute @DOMNameAttribute(name="MouseEvent") public class MouseEvent extends UIEvent
The MouseEvent interface provides specific contextual information associated with Mouse events.
Modifier and Type | Class and Description |
---|---|
class |
MouseEvent.MouseEventInit
Represents a dictionary that is having optional arguments for setting the details information about the event.
|
UIEvent.EventModifierInit, UIEvent.UIEventInit
Event.EventInit
AT_TARGET_PHASE, BUBBLING_PHASE, CAPTURING_PHASE, NONE_PHASE
PropertyChanged, PropertyChangedDelegate
Constructor and Description |
---|
MouseEvent(java.lang.String type)
Initializes a new instance of the
MouseEvent class. |
MouseEvent(java.lang.String type,
MouseEvent.MouseEventInit eventInitDict)
Initializes a new instance of the
MouseEvent class. |
Modifier and Type | Method and Description |
---|---|
static Event |
createClickEvent(UIEvent.UIEventInit eventInit) |
static Event |
createDblClickEvent(UIEvent.UIEventInit eventInit) |
static Event |
createEvent(java.lang.String type,
MouseEvent.MouseEventInit eventInit) |
static Event |
createMouseDownEvent(UIEvent.UIEventInit eventInit) |
static Event |
createMouseEnterEvent(UIEvent.UIEventInit eventInit) |
static Event |
createMouseLeaveEvent(UIEvent.UIEventInit eventInit) |
static Event |
createMouseMoveEvent(UIEvent.UIEventInit eventInit) |
static Event |
createMouseOutEvent(UIEvent.UIEventInit eventInit) |
static Event |
createMouseOverEvent(UIEvent.UIEventInit eventInit) |
static Event |
createMouseUpEvent(UIEvent.UIEventInit eventInit) |
boolean |
getAltKey()
Refer to the altKey attribute.
|
short |
getButton()
During mouse events caused by the depression or release of a mouse button, button MUST be used to indicate which pointer device button changed state.
|
int |
getButtons()
During any mouse events, buttons MUST be used to indicate which combination of mouse buttons are currently being pressed, expressed as a bitmask.
|
long |
getClientX()
The horizontal coordinate at which the event occurred relative to the viewport associated with the event.
|
long |
getClientY()
The vertical coordinate at which the event occurred relative to the viewport associated with the event.
|
boolean |
getCtrlKey()
Refer to the ctrlKey attribute.
|
boolean |
getMetaKey()
Refer to the metaKey attribute.
|
EventTarget |
getRelatedTarget()
Used to identify a secondary EventTarget related to a UI event, depending on the type of event.
|
long |
getScreenX()
The horizontal coordinate at which the event occurred relative to the origin of the screen coordinate system.
|
long |
getScreenY()
The vertical coordinate at which the event occurred relative to the origin of the screen coordinate system.
|
boolean |
getShiftKey()
Refer to the shiftKey attribute.
|
createAbortEvent, createEvent, createLoadEvent, createSelectEvent, createUnLoadEvent, getDetail, getView
createDOMContentLoadedEvent, createError, createEvent, createEvent, createEventByType, dispatch, getBubbles, getCancelable, getCurrentTarget, getDefaultPrevented, getEventPhase, getTarget, getTimeStamp, getType, initEvent, isTrusted, preventDefault, setCurrentTarget, setEventPhase, setTarget, stopImmediatePropagation, stopPropagation
fireNotifyPropertyChanged, getCurrentValues, getRuntimesBinding, setCurrentValues, setField, setRuntimesBinding
public MouseEvent(java.lang.String type)
Initializes a new instance of the MouseEvent
class.
type
- The event type.public MouseEvent(java.lang.String type, MouseEvent.MouseEventInit eventInitDict)
Initializes a new instance of the MouseEvent
class.
type
- The event type.eventInitDict
- The event initialize dictionary.public static Event createClickEvent(UIEvent.UIEventInit eventInit)
public static Event createDblClickEvent(UIEvent.UIEventInit eventInit)
public static Event createMouseDownEvent(UIEvent.UIEventInit eventInit)
public static Event createMouseEnterEvent(UIEvent.UIEventInit eventInit)
public static Event createMouseLeaveEvent(UIEvent.UIEventInit eventInit)
public static Event createMouseMoveEvent(UIEvent.UIEventInit eventInit)
public static Event createMouseOutEvent(UIEvent.UIEventInit eventInit)
public static Event createMouseOverEvent(UIEvent.UIEventInit eventInit)
public static Event createMouseUpEvent(UIEvent.UIEventInit eventInit)
public static Event createEvent(java.lang.String type, MouseEvent.MouseEventInit eventInit)
@DOMNameAttribute(name="screenX") public long getScreenX()
The horizontal coordinate at which the event occurred relative to the origin of the screen coordinate system.
Value: The screen x.@DOMNameAttribute(name="screenY") public long getScreenY()
The vertical coordinate at which the event occurred relative to the origin of the screen coordinate system.
Value: The screen y.@DOMNameAttribute(name="clientX") public long getClientX()
The horizontal coordinate at which the event occurred relative to the viewport associated with the event.
Value: The client x.@DOMNameAttribute(name="clientY") public long getClientY()
The vertical coordinate at which the event occurred relative to the viewport associated with the event.
Value: The client y.@DOMNameAttribute(name="ctrlKey") public boolean getCtrlKey()
Refer to the ctrlKey attribute.
Value:true
if [control key]; otherwise, false
.@DOMNameAttribute(name="shiftKey") public boolean getShiftKey()
Refer to the shiftKey attribute.
Value:true
if [shift key]; otherwise, false
.@DOMNameAttribute(name="altKey") public boolean getAltKey()
Refer to the altKey attribute.
Value:true
if [alt key]; otherwise, false
.@DOMNameAttribute(name="metaKey") public boolean getMetaKey()
Refer to the metaKey attribute.
Value:true
if [meta key]; otherwise, false
.@DOMNameAttribute(name="button") public short getButton()
During mouse events caused by the depression or release of a mouse button, button MUST be used to indicate which pointer device button changed state.
Value: The button.@DOMNameAttribute(name="buttons") public int getButtons()
During any mouse events, buttons MUST be used to indicate which combination of mouse buttons are currently being pressed, expressed as a bitmask.
Value: The buttons.@DOMNameAttribute(name="relatedTarget") public EventTarget getRelatedTarget()
Used to identify a secondary EventTarget related to a UI event, depending on the type of event.
Value: The related target.