All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.w3c.dom.events.MouseEvent Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version
/*
 * Portions Copyright  2000-2008 Sun Microsystems, Inc. All Rights
 * Reserved.  Use is subject to license terms.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version
 * 2 only, as published by the Free Software Foundation.
 * 
 * This program is distributed 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. See the GNU
 * General Public License version 2 for more details (a copy is
 * included at /legal/license.txt).
 * 
 * You should have received a copy of the GNU General Public License
 * version 2 along with this work; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 * 
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
 * Clara, CA 95054 or visit www.sun.com if you need additional
 * information or have any questions.
 */

/*
 * Copyright (c) 2006 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
 */

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 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 */ 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 * DOM implementation's client area. */ public int getClientX(); /** * The vertical coordinate at which the event occurred relative to the * DOM implementation's client area. */ public int getClientY(); /** * true if the control (Ctrl) key modifier is activated. */ public boolean getCtrlKey(); /** * true if the shift (Shift) key modifier is activated. */ public boolean getShiftKey(); /** * true if the alt (alternative) key modifier is activated. *

Note: The Option key modifier on Macintosh systems must be * represented using this key modifier. */ public boolean getAltKey(); /** * true if the meta (Meta) key modifier is activated. *

Note: The Command key modifier on Macintosh system must be * represented using this meta key. */ 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(); /** * The initMouseEvent method is used to initialize the value * of a MouseEvent object and 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); /** * The initMouseEventNS method is used to initialize the * value of a MouseEvent object and has the same behavior * as UIEvent.initUIEventNS(). * @param namespaceURI Refer to the UIEvent.initUIEventNS() * method for a description of this parameter. * @param typeArg Refer to the UIEvent.initUIEventNS() * method for a description of this parameter. * @param canBubbleArg Refer to the UIEvent.initUIEventNS() * method for a description of this parameter. * @param cancelableArg Refer to the UIEvent.initUIEventNS() * method for a description of this parameter. * @param viewArg Refer to the UIEvent.initUIEventNS() * method for a description of this parameter. * @param detailArg Refer to the UIEvent.initUIEventNS() * method for a description of this parameter. * @param screenXArg Refer to the * MouseEvent.initMouseEvent() method for a description * of this parameter. * @param screenYArg Refer to the * MouseEvent.initMouseEvent() method for a description * of this parameter. * @param clientXArg Refer to the * MouseEvent.initMouseEvent() method for a description * of this parameter. * @param clientYArg Refer to the * MouseEvent.initMouseEvent() method for a description * of this parameter. * @param buttonArg Refer to the MouseEvent.initMouseEvent() * method for a description of this parameter. * @param relatedTargetArg Refer to the * MouseEvent.initMouseEvent() method for a description * of this parameter. * @param 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 */ 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); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy