org.moxieapps.gwt.highcharts.client.events
Class MouseEvent

java.lang.Object
  extended by org.moxieapps.gwt.highcharts.client.events.MouseEvent
Direct Known Subclasses:
ChartClickEvent, ChartSelectionEvent, PointEvent, SeriesEvent

public abstract class MouseEvent
extends Object

The base class of all events that are triggered by the user's mouse, and includes methods for accessing the general state of the event, such as if the user was holding down the "Shift" or "Control" key, or the x/y coordinates of the click.

Since:
1.1.0
Author:
squinn@moxiegroup.com (Shawn Quinn)

Constructor Summary
protected MouseEvent(com.google.gwt.core.client.JavaScriptObject event)
          We can only be created by instantiating one of our sub classes.
 
Method Summary
 int getClientX()
          Gets the mouse x-position within the browser window's client area.
 int getClientY()
          Gets the mouse y-position within the browser window's client area.
 int getNativeButton()
          Gets the button value.
 com.google.gwt.core.client.JavaScriptObject getNativeEvent()
          Returns a pointer to the native Highchart's instance data object that this GWT instance is wrapping.
 int getRelativeX(com.google.gwt.dom.client.Element target)
          Gets the mouse x-position relative to a given element.
 int getRelativeY(com.google.gwt.dom.client.Element target)
          Gets the mouse y-position relative to a given element.
 int getScreenX()
          Gets the mouse x-position on the user's display.
 int getScreenY()
          Gets the mouse y-position on the user's display.
 boolean isAltKeyDown()
          Is alt key down.
 boolean isControlKeyDown()
          Is control key down.
 boolean isMetaKeyDown()
          Is meta key down.
 boolean isShiftKeyDown()
          Is shift key down.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MouseEvent

protected MouseEvent(com.google.gwt.core.client.JavaScriptObject event)
We can only be created by instantiating one of our sub classes.

Parameters:
event - The native javascript object containing the details of the original event that was fired.
Method Detail

getClientX

public int getClientX()
Gets the mouse x-position within the browser window's client area.

Returns:
the mouse x-position

getClientY

public int getClientY()
Gets the mouse y-position within the browser window's client area.

Returns:
the mouse y-position

getNativeButton

public int getNativeButton()
Gets the button value. Compare it to NativeEvent.BUTTON_LEFT, NativeEvent.BUTTON_RIGHT, NativeEvent.BUTTON_MIDDLE

Returns:
the button value

getRelativeX

public int getRelativeX(com.google.gwt.dom.client.Element target)
Gets the mouse x-position relative to a given element.

Parameters:
target - the element whose coordinate system is to be used
Returns:
the relative x-position

getRelativeY

public int getRelativeY(com.google.gwt.dom.client.Element target)
Gets the mouse y-position relative to a given element.

Parameters:
target - the element whose coordinate system is to be used
Returns:
the relative y-position

getScreenX

public int getScreenX()
Gets the mouse x-position on the user's display.

Returns:
the mouse x-position

getScreenY

public int getScreenY()
Gets the mouse y-position on the user's display.

Returns:
the mouse y-position

isAltKeyDown

public boolean isAltKeyDown()
Is alt key down.

Returns:
whether the alt key is down

isControlKeyDown

public boolean isControlKeyDown()
Is control key down.

Returns:
whether the control key is down

isMetaKeyDown

public boolean isMetaKeyDown()
Is meta key down.

Returns:
whether the meta key is down

isShiftKeyDown

public boolean isShiftKeyDown()
Is shift key down.

Returns:
whether the shift key is down

getNativeEvent

public com.google.gwt.core.client.JavaScriptObject getNativeEvent()
Returns a pointer to the native Highchart's instance data object that this GWT instance is wrapping. For advanced JSNI use-cases only.

Returns:
The native Highcharts object instance that this GWT instance is associated with.
Since:
1.5.0


Copyright © 2015. All Rights Reserved.