/*
* Copyright (c) 2007 World Wide Web Consortium,
*
* (Massachusetts Institute of Technology, European Research Consortium for
* Informatics and Mathematics, Keio University). All Rights Reserved. This
* work is distributed under the W3C(r) Software License [1] in the hope that
* it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
*
* Difference to the original copy of this file:
* 1) REMOVE public boolean getModifierState(String keyIdentifierArg);
* 2) REMOVE public void initMouseEventNS(String namespaceURIArg,
* String typeArg,
* boolean canBubbleArg,
* boolean cancelableArg,
* AbstractView viewArg,
* int detailArg,
* int screenXArg,
* int screenYArg,
* int clientXArg,
* int clientYArg,
* short buttonArg,
* EventTarget relatedTargetArg,
* String modifiersListArg);
*/
package org.w3c.dom.events;
import org.w3c.dom.views.AbstractView;
/**
* 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 their * 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
*/
public interface MouseEvent extends UIEvent {
/**
* The horizontal coordinate at which the event occurred relative to the
* origin of the screen coordinate system.
*/
public int getScreenX();
/**
* The vertical coordinate at which the event occurred relative to the
* origin of the screen coordinate system.
*/
public int getScreenY();
/**
* The horizontal coordinate at which the event occurred relative to the
* viewport associated with the event.
*/
public int getClientX();
/**
* The vertical coordinate at which the event occurred relative to the
* viewport associated with the event.
*/
public int getClientY();
/**
* Refer to the KeyboardEvent.ctrlKey
attribute.
*/
public boolean getCtrlKey();
/**
* Refer to the KeyboardEvent.shiftKey
attribute.
*/
public boolean getShiftKey();
/**
* Refer to the KeyboardEvent.altKey
attribute.
*/
public boolean getAltKey();
/**
* Refer to the KeyboardEvent.metaKey
attribute.
*/
public boolean getMetaKey();
/**
* 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.
*/
public short getButton();
/**
* Used to identify a secondary EventTarget
related to a UI
* event, depending on the type of event.
*/
public EventTarget getRelatedTarget();
/**
* Initializes attributes of a MouseEvent
object. This
* method has the same behavior as UIEvent.initUIEvent()
.
* @param typeArg Refer to the UIEvent.initUIEvent()
method
* for a description of this parameter.
* @param canBubbleArg Refer to the UIEvent.initUIEvent()
* method for a description of this parameter.
* @param cancelableArg Refer to the UIEvent.initUIEvent()
* method for a description of this parameter.
* @param viewArg Refer to the UIEvent.initUIEvent()
method
* for a description of this parameter.
* @param detailArg Refer to the UIEvent.initUIEvent()
* method for a description of this parameter.
* @param screenXArg Specifies MouseEvent.screenX
.
* @param screenYArg Specifies MouseEvent.screenY
.
* @param clientXArg Specifies MouseEvent.clientX
.
* @param clientYArg Specifies MouseEvent.clientY
.
* @param ctrlKeyArg Specifies MouseEvent.ctrlKey
.
* @param altKeyArg Specifies MouseEvent.altKey
.
* @param shiftKeyArg Specifies MouseEvent.shiftKey
.
* @param metaKeyArg Specifies MouseEvent.metaKey
.
* @param buttonArg Specifies MouseEvent.button
.
* @param relatedTargetArg Specifies
* MouseEvent.relatedTarget
. This value may be
* null
.
*/
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);
}