| org.w3c.dom.events.MouseEvent
All known Subclasses: org.apache.batik.dom.events.DOMMouseEvent,
MouseEvent | public interface MouseEvent extends UIEvent(Code) | | The MouseEvent interface provides specific contextual
information associated with Mouse events.
In the case of nested elements mouse events are always targeted at the
most deeply nested element. Ancestors of the targeted element may use
bubbling to obtain notification of mouse events which occur within theirs
descendent elements.
To create an instance of the MouseEvent interface, use the
DocumentEvent.createEvent("MouseEvent") method call.
Note: When initializing MouseEvent objects using
initMouseEvent or initMouseEventNS ,
implementations should use the client coordinates clientX
and clientY for calculation of other coordinates (such as
target coordinates exposed by DOM Level 0 implementations).
See also the
Document Object Model (DOM) Level 3 Events Specification
.
since: DOM Level 2 |
Method Summary | |
public boolean | getAltKey() true if the alt (alternative) key modifier is activated. | public short | getButton() During mouse events caused by the depression or release of a mouse
button, button is used to indicate which mouse button
changed state. | public int | getClientX() The horizontal coordinate at which the event occurred relative to the
DOM implementation's client area. | public int | getClientY() The vertical coordinate at which the event occurred relative to the
DOM implementation's client area. | public boolean | getCtrlKey() true if the control (Ctrl) key modifier is activated. | public boolean | getMetaKey() true if the meta (Meta) key modifier is activated. | public boolean | getModifierState(String keyIdentifierArg) This methods queries the state of a modifier using a key identifier. | public EventTarget | getRelatedTarget() Used to identify a secondary EventTarget related to a UI
event, depending on the type of event. | public int | getScreenX() The horizontal coordinate at which the event occurred relative to the
origin of the screen coordinate system. | public int | getScreenY() The vertical coordinate at which the event occurred relative to the
origin of the screen coordinate system. | public boolean | getShiftKey() true if the shift (Shift) key modifier is activated. | public void | initMouseEvent(String typeArg, boolean canBubbleArg, boolean cancelableArg, AbstractView viewArg, int detailArg, int screenXArg, int screenYArg, int clientXArg, int clientYArg, boolean ctrlKeyArg, boolean altKeyArg, boolean shiftKeyArg, boolean metaKeyArg, short buttonArg, EventTarget relatedTargetArg) The initMouseEvent method is used to initialize the value
of a MouseEvent object and has the same behavior as
UIEvent.initUIEvent() . | public void | initMouseEventNS(String namespaceURI, String typeArg, boolean canBubbleArg, boolean cancelableArg, AbstractView viewArg, int detailArg, int screenXArg, int screenYArg, int clientXArg, int clientYArg, short buttonArg, EventTarget relatedTargetArg, String modifiersList) The initMouseEventNS method is used to initialize the
value of a MouseEvent object and has the same behavior
as UIEvent.initUIEventNS() . |
getAltKey | public boolean getAltKey()(Code) | | true if the alt (alternative) key modifier is activated.
Note: The Option key modifier on Macintosh systems must be
represented using this key modifier.
|
getButton | public short getButton()(Code) | | During mouse events caused by the depression or release of a mouse
button, button is used to indicate which mouse button
changed state. 0 indicates the normal button of the
mouse (in general on the left or the one button on Macintosh mice,
used to activate a button or select text). 2 indicates
the contextual property (in general on the right, used to display a
context menu) button of the mouse if present. 1
indicates the extra (in general in the middle and often combined with
the mouse wheel) button. Some mice may provide or simulate more
buttons, and values higher than 2 can be used to
represent such buttons.
|
getClientX | public int getClientX()(Code) | | The horizontal coordinate at which the event occurred relative to the
DOM implementation's client area.
|
getClientY | public int getClientY()(Code) | | The vertical coordinate at which the event occurred relative to the
DOM implementation's client area.
|
getCtrlKey | public boolean getCtrlKey()(Code) | | true if the control (Ctrl) key modifier is activated.
|
getMetaKey | public boolean getMetaKey()(Code) | | true if the meta (Meta) key modifier is activated.
Note: The Command key modifier on Macintosh system must be
represented using this meta key.
|
getModifierState | public boolean getModifierState(String keyIdentifierArg)(Code) | | This methods queries the state of a modifier using a key identifier.
See also .
Parameters: keyIdentifierArg - A modifier key identifier, as defined by the KeyboardEvent.keyIdentifier attribute. Common modifier keys are "Alt" , "AltGraph" , "CapsLock" , "Control" , "Meta" , "NumLock" , "Scroll" , or "Shift" . Note: If an application wishes to distinguish between right and left modifiers, this information could be deduced using keyboard events and KeyboardEvent.keyLocation . true if it is modifier key and the modifier is activated, false otherwise. since: DOM Level 3 |
getRelatedTarget | public EventTarget getRelatedTarget()(Code) | | Used to identify a secondary EventTarget related to a UI
event, depending on the type of event.
|
getScreenX | public int getScreenX()(Code) | | The horizontal coordinate at which the event occurred relative to the
origin of the screen coordinate system.
|
getScreenY | public int getScreenY()(Code) | | The vertical coordinate at which the event occurred relative to the
origin of the screen coordinate system.
|
getShiftKey | public boolean getShiftKey()(Code) | | true if the shift (Shift) key modifier is activated.
|
initMouseEvent | public void initMouseEvent(String typeArg, boolean canBubbleArg, boolean cancelableArg, AbstractView viewArg, int detailArg, int screenXArg, int screenYArg, int clientXArg, int clientYArg, boolean ctrlKeyArg, boolean altKeyArg, boolean shiftKeyArg, boolean metaKeyArg, short buttonArg, EventTarget relatedTargetArg)(Code) | | The initMouseEvent method is used to initialize the value
of a MouseEvent object and has the same behavior as
UIEvent.initUIEvent() .
Parameters: typeArg - Refer to the UIEvent.initUIEvent() method for a description of this parameter. Parameters: canBubbleArg - Refer to the UIEvent.initUIEvent() method for a description of this parameter. Parameters: cancelableArg - Refer to the UIEvent.initUIEvent() method for a description of this parameter. Parameters: viewArg - Refer to the UIEvent.initUIEvent() method for a description of this parameter. Parameters: detailArg - Refer to the UIEvent.initUIEvent() method for a description of this parameter. Parameters: screenXArg - Specifies MouseEvent.screenX . Parameters: screenYArg - Specifies MouseEvent.screenY . Parameters: clientXArg - Specifies MouseEvent.clientX . Parameters: clientYArg - Specifies MouseEvent.clientY . Parameters: ctrlKeyArg - Specifies MouseEvent.ctrlKey . Parameters: altKeyArg - Specifies MouseEvent.altKey . Parameters: shiftKeyArg - Specifies MouseEvent.shiftKey . Parameters: metaKeyArg - Specifies MouseEvent.metaKey . Parameters: buttonArg - Specifies MouseEvent.button . Parameters: relatedTargetArg - Specifies MouseEvent.relatedTarget . This value may be null . |
initMouseEventNS | public void initMouseEventNS(String namespaceURI, String typeArg, boolean canBubbleArg, boolean cancelableArg, AbstractView viewArg, int detailArg, int screenXArg, int screenYArg, int clientXArg, int clientYArg, short buttonArg, EventTarget relatedTargetArg, String modifiersList)(Code) | | The initMouseEventNS method is used to initialize the
value of a MouseEvent object and has the same behavior
as UIEvent.initUIEventNS() .
Parameters: namespaceURI - Refer to the UIEvent.initUIEventNS() method for a description of this parameter. Parameters: typeArg - Refer to the UIEvent.initUIEventNS() method for a description of this parameter. Parameters: canBubbleArg - Refer to the UIEvent.initUIEventNS() method for a description of this parameter. Parameters: cancelableArg - Refer to the UIEvent.initUIEventNS() method for a description of this parameter. Parameters: viewArg - Refer to the UIEvent.initUIEventNS() method for a description of this parameter. Parameters: detailArg - Refer to the UIEvent.initUIEventNS() method for a description of this parameter. Parameters: screenXArg - Refer to the MouseEvent.initMouseEvent() method for a description of this parameter. Parameters: screenYArg - Refer to the MouseEvent.initMouseEvent() method for a description of this parameter. Parameters: clientXArg - Refer to the MouseEvent.initMouseEvent() method for a description of this parameter. Parameters: clientYArg - Refer to the MouseEvent.initMouseEvent() method for a description of this parameter. Parameters: buttonArg - Refer to the MouseEvent.initMouseEvent() method for a description of this parameter. Parameters: relatedTargetArg - Refer to the MouseEvent.initMouseEvent() method for a description of this parameter. Parameters: modifiersList - A white space separated list of modifier key identifiers to be activated on this object. As an example, "Control Alt" will activated the control and alt modifiers. since: DOM Level 3 |
|
|