/*
The contents of this file are subject to the Mozilla Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is mozilla.org code.
The Initial Developer of the Original Code is Sun Microsystems,
Inc. Portions created by Sun are
Copyright (C) 1999 Sun Microsystems, Inc. All
Rights Reserved.
Contributor(s):
*/
package org.mozilla.dom.events;
import org.w3c.dom.Node;
import org.w3c.dom.views.AbstractView;
import org.w3c.dom.events.MouseEvent;
/**
* The MouseEvent
interface provides specific contextual
* information associated with Mouse events.
*
The detail
attribute inherited from UIEvent
* indicates the number of times a mouse button has been pressed and released
* over the same screen location during a user action. The attribute value
* is 1 when the user begins this action and increments by 1 for each full
* sequence of pressing and releasing. If the user moves the mouse between
* the mousedown and mouseup the value will be set to 0, indicating that no
* click is occurring.
* @since DOM Level 2
*/
public class MouseEventImpl extends UIEventImpl implements MouseEvent {
// instantiated from JNI only
private MouseEventImpl() {}
public String toString() {
return "screenX
indicates the horizontal coordinate at which the
* event occurred in relative to the origin of the screen coordinate system.
*/
public native int getScreenX();
/**
* screenY
indicates the vertical coordinate at which the event
* occurred relative to the origin of the screen coordinate system.
*/
public native int getScreenY();
/**
* clientX
indicates the horizontal coordinate at which the
* event occurred relative to the DOM implementation's client area.
*/
public native int getClientX();
/**
* clientY
indicates the vertical coordinate at which the event
* occurred relative to the DOM implementation's client area.
*/
public native int getClientY();
/**
* ctrlKey
indicates whether the 'ctrl' key was depressed
* during the firing of the event.
*/
public native boolean getCtrlKey();
/**
* shiftKey
indicates whether the 'shift' key was depressed
* during the firing of the event.
*/
public native boolean getShiftKey();
/**
* altKey
indicates whether the 'alt' key was depressed during
* the firing of the event. On some platforms this key may map to an
* alternative key name.
*/
public native boolean getAltKey();
/**
* metaKey
indicates whether the 'meta' key was depressed
* during the firing of the event. On some platforms this key may map to
* an alternative key name.
*/
public native 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.
*/
public native short getButton();
/**
* relatedNode
is used to identify a secondary node related to
* a UI event.
*/
public Node getRelatedNode() {
throw new UnsupportedOperationException();
}
/**
*
* @param typeArg Specifies the event type.
* @param canBubbleArg Specifies whether or not the event can bubble.
* @param cancelableArg Specifies whether or not the event's default action
* can be prevent.
* @param viewArg Specifies the Event
's
* AbstractView
.
* @param detailArg Specifies the Event
's mouse click count.
* @param screenXArg Specifies the Event
's screen x coordinate
* @param screenYArg Specifies the Event
's screen y coordinate
* @param clientXArg Specifies the Event
's client x coordinate
* @param clientYArg Specifies the Event
's client y coordinate
* @param ctrlKeyArg Specifies whether or not control key was depressed
* during the Event
.
* @param altKeyArg Specifies whether or not alt key was depressed during
* the Event
.
* @param shiftKeyArg Specifies whether or not shift key was depressed
* during the Event
.
* @param metaKeyArg Specifies whether or not meta key was depressed during
* the Event
.
* @param buttonArg Specifies the Event
's mouse button.
* @param relatedNodeArg Specifies the Event
's related Node.
*/
public void initMouseEvent(String typeArg,
boolean canBubbleArg,
boolean cancelableArg,
AbstractView viewArg,
short detailArg,
int screenXArg,
int screenYArg,
int clientXArg,
int clientYArg,
boolean ctrlKeyArg,
boolean altKeyArg,
boolean shiftKeyArg,
boolean metaKeyArg,
short buttonArg,
Node relatedNodeArg) {
throw new UnsupportedOperationException();
}
}