|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.maryanovsky.gwtutils.client.ui.mouse.gestures.MouseGestureRecognizer
com.maryanovsky.gwtutils.client.ui.mouse.gestures.wheelscroll.WheelScrollRecognizer
public class WheelScrollRecognizer
Recognizes and fires mouse wheel scroll events.
Field Summary |
---|
Fields inherited from class com.maryanovsky.gwtutils.client.ui.mouse.gestures.MouseGestureRecognizer |
---|
handlerManager |
Constructor Summary | |
---|---|
WheelScrollRecognizer(Object wheelScrollEventsSource)
Creates a new WheelScrollRecognizer which will fire mouse wheel
scroll events with the specified source object. |
|
WheelScrollRecognizer(Object wheelScrollEventsSource,
Condition<WheelScrollUpEvent> wheelScrollUpCondition,
Condition<WheelScrollDownEvent> wheelScrollDownCondition)
Creates a new WheelScrollRecognizer which will fire mouse wheel
scroll events with the specified source object and consult the specified
conditions before doing so. |
|
WheelScrollRecognizer(Object wheelScrollEventsSource,
H mouseEventsSource)
Creates a new WheelScrollRecognizer which will fire mouse wheel
scroll events with the specified source object and use the specified
source of mouse events. |
|
WheelScrollRecognizer(Object wheelScrollEventsSource,
H mouseEventsSource,
Condition<WheelScrollUpEvent> wheelScrollUpCondition,
Condition<WheelScrollDownEvent> wheelScrollDownCondition)
Creates a new WheelScrollRecognizer which will fire mouse wheel
scroll events with the specified source object, use the specified source
of mouse events and consult the specified conditions before firing the
event(s). |
Method Summary | |
---|---|
HandlerRegistration |
addWheelScrollDownHandler(WheelScrollDownHandler handler)
Adds a mouse wheel scroll-down handler. |
HandlerRegistration |
addWheelScrollUpHandler(WheelScrollUpHandler handler)
Adds a mouse wheel scroll-up handler. |
protected void |
onMouseWheel(MouseWheelEvent event)
Invoked when the mouse wheel is scrolled. |
protected boolean |
wheelScrollDownCondition(WheelScrollDownEvent evt)
Returns whether the specified WheelScrollDownEvent should be
delivered to the handlers. |
protected boolean |
wheelScrollUpCondition(WheelScrollUpEvent evt)
Returns whether the specified WheelScrollUpEvent should be
delivered to the handlers. |
Methods inherited from class com.maryanovsky.gwtutils.client.ui.mouse.gestures.MouseGestureRecognizer |
---|
fireEvent, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp, setMouseEventsSource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WheelScrollRecognizer(Object wheelScrollEventsSource)
WheelScrollRecognizer
which will fire mouse wheel
scroll events with the specified source object.
public WheelScrollRecognizer(Object wheelScrollEventsSource, H mouseEventsSource)
WheelScrollRecognizer
which will fire mouse wheel
scroll events with the specified source object and use the specified
source of mouse events.
public WheelScrollRecognizer(Object wheelScrollEventsSource, Condition<WheelScrollUpEvent> wheelScrollUpCondition, Condition<WheelScrollDownEvent> wheelScrollDownCondition)
WheelScrollRecognizer
which will fire mouse wheel
scroll events with the specified source object and consult the specified
conditions before doing so.
public WheelScrollRecognizer(Object wheelScrollEventsSource, H mouseEventsSource, Condition<WheelScrollUpEvent> wheelScrollUpCondition, Condition<WheelScrollDownEvent> wheelScrollDownCondition)
WheelScrollRecognizer
which will fire mouse wheel
scroll events with the specified source object, use the specified source
of mouse events and consult the specified conditions before firing the
event(s).
See the documentation of
wheelScrollUpCondition(WheelScrollUpEvent)
and
wheelScrollDownCondition(WheelScrollDownEvent)
for information
on the wheel scroll conditions.
Method Detail |
---|
public HandlerRegistration addWheelScrollUpHandler(WheelScrollUpHandler handler)
addWheelScrollUpHandler
in interface HasWheelScrollUpHandlers
public HandlerRegistration addWheelScrollDownHandler(WheelScrollDownHandler handler)
addWheelScrollDownHandler
in interface HasWheelScrollDownHandlers
protected boolean wheelScrollUpCondition(WheelScrollUpEvent evt)
WheelScrollUpEvent
should be
delivered to the handlers. This allows filtering mouse wheel scroll up
gestures to only those you really want. For example, if you only want to
recognize scrolls while the control key is held, you would override this
method and return
evt.getSourceEvent().isControlKeyDown()
.
The default implementation delegates the decision to the wheel scroll up
condition passed in the constructor.
protected boolean wheelScrollDownCondition(WheelScrollDownEvent evt)
WheelScrollDownEvent
should be
delivered to the handlers. This allows filtering mouse wheel scroll down
gestures to only those you really want. For example, if you only want to
recognize scrolls while the control key is held, you would override this
method and return
evt.getSourceEvent().isControlKeyDown()
.
The default implementation delegates the decision to the wheel scroll
down condition passed in the constructor.
protected void onMouseWheel(MouseWheelEvent event)
onMouseWheel
in class MouseGestureRecognizer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |