Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxp/src/org/w3c/dom/events/MouseEvent.java
86410 views
/*1* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation. Oracle designates this6* particular file as subject to the "Classpath" exception as provided7* by Oracle in the LICENSE file that accompanied this code.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/2324/*25* This file is available under and governed by the GNU General Public26* License version 2 only, as published by the Free Software Foundation.27* However, the following notice accompanied the original version of this28* file and, per its terms, should not be removed:29*30* Copyright (c) 2000 World Wide Web Consortium,31* (Massachusetts Institute of Technology, Institut National de32* Recherche en Informatique et en Automatique, Keio University). All33* Rights Reserved. This program is distributed under the W3C's Software34* Intellectual Property License. This program is distributed in the35* hope that it will be useful, but WITHOUT ANY WARRANTY; without even36* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR37* PURPOSE.38* See W3C License http://www.w3.org/Consortium/Legal/ for more details.39*/4041package org.w3c.dom.events;4243import org.w3c.dom.views.AbstractView;4445/**46* The <code>MouseEvent</code> interface provides specific contextual47* information associated with Mouse events.48* <p>The <code>detail</code> attribute inherited from <code>UIEvent</code>49* indicates the number of times a mouse button has been pressed and50* released over the same screen location during a user action. The51* attribute value is 1 when the user begins this action and increments by 152* for each full sequence of pressing and releasing. If the user moves the53* mouse between the mousedown and mouseup the value will be set to 0,54* indicating that no click is occurring.55* <p>In the case of nested elements mouse events are always targeted at the56* most deeply nested element. Ancestors of the targeted element may use57* bubbling to obtain notification of mouse events which occur within its58* descendent elements.59* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.60* @since DOM Level 261*/62public interface MouseEvent extends UIEvent {63/**64* The horizontal coordinate at which the event occurred relative to the65* origin of the screen coordinate system.66*/67public int getScreenX();6869/**70* The vertical coordinate at which the event occurred relative to the71* origin of the screen coordinate system.72*/73public int getScreenY();7475/**76* The horizontal coordinate at which the event occurred relative to the77* DOM implementation's client area.78*/79public int getClientX();8081/**82* The vertical coordinate at which the event occurred relative to the DOM83* implementation's client area.84*/85public int getClientY();8687/**88* Used to indicate whether the 'ctrl' key was depressed during the firing89* of the event.90*/91public boolean getCtrlKey();9293/**94* Used to indicate whether the 'shift' key was depressed during the95* firing of the event.96*/97public boolean getShiftKey();9899/**100* Used to indicate whether the 'alt' key was depressed during the firing101* of the event. On some platforms this key may map to an alternative102* key name.103*/104public boolean getAltKey();105106/**107* Used to indicate whether the 'meta' key was depressed during the firing108* of the event. On some platforms this key may map to an alternative109* key name.110*/111public boolean getMetaKey();112113/**114* During mouse events caused by the depression or release of a mouse115* button, <code>button</code> is used to indicate which mouse button116* changed state. The values for <code>button</code> range from zero to117* indicate the left button of the mouse, one to indicate the middle118* button if present, and two to indicate the right button. For mice119* configured for left handed use in which the button actions are120* reversed the values are instead read from right to left.121*/122public short getButton();123124/**125* Used to identify a secondary <code>EventTarget</code> related to a UI126* event. Currently this attribute is used with the mouseover event to127* indicate the <code>EventTarget</code> which the pointing device128* exited and with the mouseout event to indicate the129* <code>EventTarget</code> which the pointing device entered.130*/131public EventTarget getRelatedTarget();132133/**134* The <code>initMouseEvent</code> method is used to initialize the value135* of a <code>MouseEvent</code> created through the136* <code>DocumentEvent</code> interface. This method may only be called137* before the <code>MouseEvent</code> has been dispatched via the138* <code>dispatchEvent</code> method, though it may be called multiple139* times during that phase if necessary. If called multiple times, the140* final invocation takes precedence.141* @param typeArg Specifies the event type.142* @param canBubbleArg Specifies whether or not the event can bubble.143* @param cancelableArg Specifies whether or not the event's default144* action can be prevented.145* @param viewArg Specifies the <code>Event</code>'s146* <code>AbstractView</code>.147* @param detailArg Specifies the <code>Event</code>'s mouse click count.148* @param screenXArg Specifies the <code>Event</code>'s screen x149* coordinate150* @param screenYArg Specifies the <code>Event</code>'s screen y151* coordinate152* @param clientXArg Specifies the <code>Event</code>'s client x153* coordinate154* @param clientYArg Specifies the <code>Event</code>'s client y155* coordinate156* @param ctrlKeyArg Specifies whether or not control key was depressed157* during the <code>Event</code>.158* @param altKeyArg Specifies whether or not alt key was depressed during159* the <code>Event</code>.160* @param shiftKeyArg Specifies whether or not shift key was depressed161* during the <code>Event</code>.162* @param metaKeyArg Specifies whether or not meta key was depressed163* during the <code>Event</code>.164* @param buttonArg Specifies the <code>Event</code>'s mouse button.165* @param relatedTargetArg Specifies the <code>Event</code>'s related166* <code>EventTarget</code>.167*/168public void initMouseEvent(String typeArg,169boolean canBubbleArg,170boolean cancelableArg,171AbstractView viewArg,172int detailArg,173int screenXArg,174int screenYArg,175int clientXArg,176int clientYArg,177boolean ctrlKeyArg,178boolean altKeyArg,179boolean shiftKeyArg,180boolean metaKeyArg,181short buttonArg,182EventTarget relatedTargetArg);183184}185186187