com.gargoylesoftware.htmlunit.javascript.host
Class MouseEvent

java.lang.Object
  extended by org.mozilla.javascript.ScriptableObject
      extended by com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
          extended by com.gargoylesoftware.htmlunit.javascript.host.Event
              extended by com.gargoylesoftware.htmlunit.javascript.host.MouseEvent
All Implemented Interfaces:
java.io.Serializable, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.Scriptable

public class MouseEvent
extends Event

JavaScript object representing a Mouse Event. For general information on which properties and functions should be supported, see DOM Level 2 Events.

Version:
$Revision: 1.3 $
Author:
Marc Guillemot, Ahmed Ashour
See Also:
Serialized Form

Field Summary
static int BUTTON_LEFT
 The code for left mouse button.
static int BUTTON_MIDDLE
 The code for middle mouse button.
static int BUTTON_RIGHT
 The code for right mouse button.
static java.lang.String TYPE_CLICK
 The click event type, triggered by "onclick" event handlers.
static java.lang.String TYPE_CONTEXT_MENU
 The context menu event type, triggered by "oncontextmenu" event handlers.
static java.lang.String TYPE_DBL_CLICK
 The dblclick event type, triggered by "ondblclick" event handlers.
static java.lang.String TYPE_MOUSE_DOWN
 The mouse down event type, triggered by "onmousedown" event handlers.
static java.lang.String TYPE_MOUSE_MOVE
 The mouse move event type, triggered by "onmousemove" event handlers.
static java.lang.String TYPE_MOUSE_OUT
 The mouse out event type, triggered by "onmouseout" event handlers.
static java.lang.String TYPE_MOUSE_OVER
 The mouse over event type, triggered by "onmouseover" event handlers.
static java.lang.String TYPE_MOUSE_UP
 The mouse up event type, triggered by "onmouseup" event handlers.
 
Fields inherited from class com.gargoylesoftware.htmlunit.javascript.host.Event
TYPE_BLUR, TYPE_CHANGE, TYPE_FOCUS, TYPE_KEY_DOWN, TYPE_LOAD, TYPE_RESET, TYPE_SUBMIT
 
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
MouseEvent()
 Used to build the prototype.
MouseEvent(DomNode domNode, java.lang.String type, boolean shiftKey, boolean ctrlKey, boolean altKey, int button)
 Creates a new event instance.
 
Method Summary
 int jsxGet_button()
 Gets the button code.
 int jsxGet_clientX()
 The horizontal coordinate at which the event occurred relative to the DOM implementation's client area.
 int jsxGet_clientY()
 The vertical coordinate at which the event occurred relative to the DOM implementation's client area.
 int jsxGet_pageX()
 Returns the horizontal coordinate of the event relative to whole document..
 int jsxGet_pageY()
 Returns the vertical coordinate of the event relative to the whole document.
 int jsxGet_screenX()
 The horizontal coordinate at which the event occurred relative to the origin of the screen coordinate system.
 int jsxGet_screenY()
 The vertical coordinate at which the event occurred relative to the origin of the screen coordinate system.
 int jsxGet_which()
 Special for FF (old stuff from Netscape time).
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.Event
isPropagationStopped, jsxFunction_stopPropagation, jsxGet_altKey, jsxGet_cancelBubble, jsxGet_ctrlKey, jsxGet_currentTarget, jsxGet_keyCode, jsxGet_shiftKey, jsxGet_srcElement, jsxGet_target, jsxGet_type, jsxSet_cancelBubble, jsxSet_srcElement, setCurrentTarget, setEventType, toString
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
get, getBooleanArg, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getHtmlElementOrDie, getHtmlElementOrNull, getIntArg, getObjectArg, getStringArg, makeScriptableFor, setDomNode, setHtmlElement
 
Methods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BUTTON_LEFT

public static final int BUTTON_LEFT
The code for left mouse button.

See Also:
Constant Field Values

BUTTON_MIDDLE

public static final int BUTTON_MIDDLE
The code for middle mouse button.

See Also:
Constant Field Values

BUTTON_RIGHT

public static final int BUTTON_RIGHT
The code for right mouse button.

See Also:
Constant Field Values

TYPE_CLICK

public static final java.lang.String TYPE_CLICK
The click event type, triggered by "onclick" event handlers.

See Also:
Constant Field Values

TYPE_CONTEXT_MENU

public static final java.lang.String TYPE_CONTEXT_MENU
The context menu event type, triggered by "oncontextmenu" event handlers.

See Also:
Constant Field Values

TYPE_DBL_CLICK

public static final java.lang.String TYPE_DBL_CLICK
The dblclick event type, triggered by "ondblclick" event handlers.

See Also:
Constant Field Values

TYPE_MOUSE_DOWN

public static final java.lang.String TYPE_MOUSE_DOWN
The mouse down event type, triggered by "onmousedown" event handlers.

See Also:
Constant Field Values

TYPE_MOUSE_MOVE

public static final java.lang.String TYPE_MOUSE_MOVE
The mouse move event type, triggered by "onmousemove" event handlers.

See Also:
Constant Field Values

TYPE_MOUSE_OUT

public static final java.lang.String TYPE_MOUSE_OUT
The mouse out event type, triggered by "onmouseout" event handlers.

See Also:
Constant Field Values

TYPE_MOUSE_OVER

public static final java.lang.String TYPE_MOUSE_OVER
The mouse over event type, triggered by "onmouseover" event handlers.

See Also:
Constant Field Values

TYPE_MOUSE_UP

public static final java.lang.String TYPE_MOUSE_UP
The mouse up event type, triggered by "onmouseup" event handlers.

See Also:
Constant Field Values
Constructor Detail

MouseEvent

public MouseEvent()
Used to build the prototype.


MouseEvent

public MouseEvent(DomNode domNode,
                  java.lang.String type,
                  boolean shiftKey,
                  boolean ctrlKey,
                  boolean altKey,
                  int button)
Creates a new event instance.

Parameters:
domNode - The DOM node that triggered the event.
type - The event type.
shiftKey - true if SHIFT is pressed
ctrlKey - true if CTRL is pressed
altKey - true if ALT is pressed
button - the button code, must be BUTTON_LEFT, BUTTON_MIDDLE or BUTTON_RIGHT
Method Detail

jsxGet_button

public int jsxGet_button()
Gets the button code.

Returns:
the button code

jsxGet_clientX

public int jsxGet_clientX()
The horizontal coordinate at which the event occurred relative to the DOM implementation's client area.

Returns:
the horizontal coordinate (currently the same as jsxGet_screenX())

jsxGet_clientY

public int jsxGet_clientY()
The vertical coordinate at which the event occurred relative to the DOM implementation's client area.

Returns:
the horizontal coordinate (currently the same as jsxGet_screenY())

jsxGet_pageX

public int jsxGet_pageX()
Returns the horizontal coordinate of the event relative to whole document..

Returns:
the horizontal coordinate (currently the same as jsxGet_screenX())
See Also:
Mozilla doc

jsxGet_pageY

public int jsxGet_pageY()
Returns the vertical coordinate of the event relative to the whole document.

Returns:
the horizontal coordinate (currently the same as jsxGet_screenY())
See Also:
Mozilla doc

jsxGet_screenX

public int jsxGet_screenX()
The horizontal coordinate at which the event occurred relative to the origin of the screen coordinate system.

Returns:
the horizontal coordinate.

jsxGet_screenY

public int jsxGet_screenY()
The vertical coordinate at which the event occurred relative to the origin of the screen coordinate system.

Returns:
the vertical coordinate.

jsxGet_which

public int jsxGet_which()
Special for FF (old stuff from Netscape time).

Returns:
the button code
See Also:
Javascript Madness: Mouse Events


Copyright © 2003-2016 AppPerfect Corporation. All Rights Reserved.