KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > w3c > dom > events > MouseEvent


1 /*
2  * Copyright (c) 2000 World Wide Web Consortium,
3  * (Massachusetts Institute of Technology, Institut National de
4  * Recherche en Informatique et en Automatique, Keio University). All
5  * Rights Reserved. This program is distributed under the W3C's Software
6  * Intellectual Property License. This program is distributed in the
7  * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
8  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  * PURPOSE.
10  * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
11  */

12
13 package org.w3c.dom.events;
14
15 import org.w3c.dom.views.AbstractView;
16
17 /**
18  * The <code>MouseEvent</code> interface provides specific contextual
19  * information associated with Mouse events.
20  * <p>The <code>detail</code> attribute inherited from <code>UIEvent</code>
21  * indicates the number of times a mouse button has been pressed and
22  * released over the same screen location during a user action. The
23  * attribute value is 1 when the user begins this action and increments by 1
24  * for each full sequence of pressing and releasing. If the user moves the
25  * mouse between the mousedown and mouseup the value will be set to 0,
26  * indicating that no click is occurring.
27  * <p>In the case of nested elements mouse events are always targeted at the
28  * most deeply nested element. Ancestors of the targeted element may use
29  * bubbling to obtain notification of mouse events which occur within its
30  * descendent elements.
31  * <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>.
32  * @since DOM Level 2
33  */

34 public interface MouseEvent extends UIEvent JavaDoc {
35     /**
36      * The horizontal coordinate at which the event occurred relative to the
37      * origin of the screen coordinate system.
38      */

39     public int getScreenX();
40
41     /**
42      * The vertical coordinate at which the event occurred relative to the
43      * origin of the screen coordinate system.
44      */

45     public int getScreenY();
46
47     /**
48      * The horizontal coordinate at which the event occurred relative to the
49      * DOM implementation's client area.
50      */

51     public int getClientX();
52
53     /**
54      * The vertical coordinate at which the event occurred relative to the DOM
55      * implementation's client area.
56      */

57     public int getClientY();
58
59     /**
60      * Used to indicate whether the 'ctrl' key was depressed during the firing
61      * of the event.
62      */

63     public boolean getCtrlKey();
64
65     /**
66      * Used to indicate whether the 'shift' key was depressed during the
67      * firing of the event.
68      */

69     public boolean getShiftKey();
70
71     /**
72      * Used to indicate whether the 'alt' key was depressed during the firing
73      * of the event. On some platforms this key may map to an alternative
74      * key name.
75      */

76     public boolean getAltKey();
77
78     /**
79      * Used to indicate whether the 'meta' key was depressed during the firing
80      * of the event. On some platforms this key may map to an alternative
81      * key name.
82      */

83     public boolean getMetaKey();
84
85     /**
86      * During mouse events caused by the depression or release of a mouse
87      * button, <code>button</code> is used to indicate which mouse button
88      * changed state. The values for <code>button</code> range from zero to
89      * indicate the left button of the mouse, one to indicate the middle
90      * button if present, and two to indicate the right button. For mice
91      * configured for left handed use in which the button actions are
92      * reversed the values are instead read from right to left.
93      */

94     public short getButton();
95
96     /**
97      * Used to identify a secondary <code>EventTarget</code> related to a UI
98      * event. Currently this attribute is used with the mouseover event to
99      * indicate the <code>EventTarget</code> which the pointing device
100      * exited and with the mouseout event to indicate the
101      * <code>EventTarget</code> which the pointing device entered.
102      */

103     public EventTarget JavaDoc getRelatedTarget();
104
105     /**
106      * The <code>initMouseEvent</code> method is used to initialize the value
107      * of a <code>MouseEvent</code> created through the
108      * <code>DocumentEvent</code> interface. This method may only be called
109      * before the <code>MouseEvent</code> has been dispatched via the
110      * <code>dispatchEvent</code> method, though it may be called multiple
111      * times during that phase if necessary. If called multiple times, the
112      * final invocation takes precedence.
113      * @param typeArgSpecifies the event type.
114      * @param canBubbleArgSpecifies whether or not the event can bubble.
115      * @param cancelableArgSpecifies whether or not the event's default
116      * action can be prevented.
117      * @param viewArgSpecifies the <code>Event</code>'s
118      * <code>AbstractView</code>.
119      * @param detailArgSpecifies the <code>Event</code>'s mouse click count.
120      * @param screenXArgSpecifies the <code>Event</code>'s screen x coordinate
121      * @param screenYArgSpecifies the <code>Event</code>'s screen y coordinate
122      * @param clientXArgSpecifies the <code>Event</code>'s client x coordinate
123      * @param clientYArgSpecifies the <code>Event</code>'s client y coordinate
124      * @param ctrlKeyArgSpecifies whether or not control key was depressed
125      * during the <code>Event</code>.
126      * @param altKeyArgSpecifies whether or not alt key was depressed during
127      * the <code>Event</code>.
128      * @param shiftKeyArgSpecifies whether or not shift key was depressed
129      * during the <code>Event</code>.
130      * @param metaKeyArgSpecifies whether or not meta key was depressed
131      * during the <code>Event</code>.
132      * @param buttonArgSpecifies the <code>Event</code>'s mouse button.
133      * @param relatedTargetArgSpecifies the <code>Event</code>'s related
134      * <code>EventTarget</code>.
135      */

136     public void initMouseEvent(String JavaDoc typeArg,
137                                boolean canBubbleArg,
138                                boolean cancelableArg,
139                                AbstractView viewArg,
140                                int detailArg,
141                                int screenXArg,
142                                int screenYArg,
143                                int clientXArg,
144                                int clientYArg,
145                                boolean ctrlKeyArg,
146                                boolean altKeyArg,
147                                boolean shiftKeyArg,
148                                boolean metaKeyArg,
149                                short buttonArg,
150                                EventTarget JavaDoc relatedTargetArg);
151
152 }
153
Popular Tags