Package com.google.gwt.event.dom.client
Class MouseWheelEvent
- java.lang.Object
-
- com.google.web.bindery.event.shared.Event<H>
-
- com.google.gwt.event.shared.GwtEvent<H>
-
- com.google.gwt.event.dom.client.DomEvent<H>
-
- com.google.gwt.event.dom.client.HumanInputEvent<H>
-
- com.google.gwt.event.dom.client.MouseEvent<MouseWheelHandler>
-
- com.google.gwt.event.dom.client.MouseWheelEvent
-
- All Implemented Interfaces:
HasNativeEvent
public class MouseWheelEvent extends MouseEvent<MouseWheelHandler>
Represents a native mouse wheel event.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.gwt.event.dom.client.DomEvent
DomEvent.Type<H extends EventHandler>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MouseWheelEvent()
Protected constructor, useDomEvent.fireNativeEvent(com.google.gwt.dom.client.NativeEvent, com.google.gwt.event.shared.HasHandlers)
to fire mouse wheel events.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
dispatch(MouseWheelHandler handler)
Should only be called byHandlerManager
.DomEvent.Type<MouseWheelHandler>
getAssociatedType()
Returns theEvent.Type
used to register this event, allowing anEventBus
to find handlers of the appropriate class.int
getDeltaY()
Get the change in the mouse wheel position along the Y-axis; negative if the mouse wheel is moving north (toward the top of the screen) or positive if the mouse wheel is moving south (toward the bottom of the screen).static DomEvent.Type<MouseWheelHandler>
getType()
Gets the event type associated with mouse wheel events.boolean
isNorth()
Convenience method that returnstrue
ifgetDeltaY()
is a negative value (ie, the velocity is directed toward the top of the screen).boolean
isSouth()
Convenience method that returnstrue
ifgetDeltaY()
is a positive value (ie, the velocity is directed toward the bottom of the screen).-
Methods inherited from class com.google.gwt.event.dom.client.MouseEvent
getClientX, getClientY, getNativeButton, getRelativeX, getRelativeY, getScreenX, getScreenY, getX, getY
-
Methods inherited from class com.google.gwt.event.dom.client.HumanInputEvent
isAltKeyDown, isControlKeyDown, isMetaKeyDown, isShiftKeyDown
-
Methods inherited from class com.google.gwt.event.dom.client.DomEvent
fireNativeEvent, fireNativeEvent, getNativeEvent, getRelativeElement, init, preventDefault, setNativeEvent, setRelativeElement, stopPropagation
-
Methods inherited from class com.google.gwt.event.shared.GwtEvent
assertLive, getSource, isLive, kill, revive
-
Methods inherited from class com.google.web.bindery.event.shared.Event
setSource, toDebugString, toString
-
-
-
-
Constructor Detail
-
MouseWheelEvent
protected MouseWheelEvent()
Protected constructor, useDomEvent.fireNativeEvent(com.google.gwt.dom.client.NativeEvent, com.google.gwt.event.shared.HasHandlers)
to fire mouse wheel events.
-
-
Method Detail
-
getType
public static DomEvent.Type<MouseWheelHandler> getType()
Gets the event type associated with mouse wheel events.- Returns:
- the handler type
-
getAssociatedType
public final DomEvent.Type<MouseWheelHandler> getAssociatedType()
Description copied from class:Event
Returns theEvent.Type
used to register this event, allowing anEventBus
to find handlers of the appropriate class.- Specified by:
getAssociatedType
in classDomEvent<MouseWheelHandler>
- Returns:
- the type
-
getDeltaY
public int getDeltaY()
Get the change in the mouse wheel position along the Y-axis; negative if the mouse wheel is moving north (toward the top of the screen) or positive if the mouse wheel is moving south (toward the bottom of the screen). Note that delta values are not normalized across browsers or OSes.- Returns:
- the delta of the mouse wheel along the y axis
-
isNorth
public boolean isNorth()
Convenience method that returnstrue
ifgetDeltaY()
is a negative value (ie, the velocity is directed toward the top of the screen).- Returns:
- true if the velocity is directed toward the top of the screen
-
isSouth
public boolean isSouth()
Convenience method that returnstrue
ifgetDeltaY()
is a positive value (ie, the velocity is directed toward the bottom of the screen).- Returns:
- true if the velocity is directed toward the bottom of the screen
-
dispatch
protected void dispatch(MouseWheelHandler handler)
Description copied from class:GwtEvent
Should only be called byHandlerManager
. In other words, do not use or call.- Specified by:
dispatch
in classGwtEvent<MouseWheelHandler>
- Parameters:
handler
- handler- See Also:
EventBus.dispatchEvent(Event, Object)
-
-