Package tripleplay.gesture
Class GestureBase<T extends GestureBase<T>>
java.lang.Object
tripleplay.gesture.GestureBase<T>
- All Implemented Interfaces:
Gesture<T>
A base class for Gestures to extend to get some common functionality.
updateState(GestureNode)
is called when the the gesture is either PASSIVE or GREEDY
and therefore primed to react to user interaction.-
Nested Class Summary
Nested classes/interfaces inherited from interface tripleplay.gesture.Gesture
Gesture.Direction, Gesture.State
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Forcibly put this gesture into the UNQUALIFIED state, as a result of another gesture transitioning to GREEDY.react.SignalView<Boolean>
Dispatched when this gesture is completed.void
evaluate
(GestureNode node) Perform a potential state transition in this Gesture based on the most recent touch information.boolean
greedy()
Returns whether this gesture will be greedy.greedy
(boolean value) Greedy gestures will dispatch both astarted()
andcompleted()
event, and are considered greedy because once their start conditions have been met, they will prevent other gestures from further consideration for dispatch.void
start()
Called at the start of a new user interaction, forcibly puts this gesture into the PASSIVE state.react.SignalView<Void>
started()
Dispatched if this gesture goes GREEDY.state()
Return the current gesture state.
-
Constructor Details
-
GestureBase
public GestureBase()
-
-
Method Details
-
greedy
Greedy gestures will dispatch both astarted()
andcompleted()
event, and are considered greedy because once their start conditions have been met, they will prevent other gestures from further consideration for dispatch.- Specified by:
greedy
in interfaceGesture<T extends GestureBase<T>>
- Returns:
- this gesture for chaining.
-
greedy
public boolean greedy()Description copied from interface:Gesture
Returns whether this gesture will be greedy.- Specified by:
greedy
in interfaceGesture<T extends GestureBase<T>>
-
start
public void start()Description copied from interface:Gesture
Called at the start of a new user interaction, forcibly puts this gesture into the PASSIVE state.- Specified by:
start
in interfaceGesture<T extends GestureBase<T>>
-
cancel
public void cancel()Description copied from interface:Gesture
Forcibly put this gesture into the UNQUALIFIED state, as a result of another gesture transitioning to GREEDY.- Specified by:
cancel
in interfaceGesture<T extends GestureBase<T>>
-
evaluate
Description copied from interface:Gesture
Perform a potential state transition in this Gesture based on the most recent touch information.- Specified by:
evaluate
in interfaceGesture<T extends GestureBase<T>>
-
state
Description copied from interface:Gesture
Return the current gesture state.- Specified by:
state
in interfaceGesture<T extends GestureBase<T>>
-
started
Description copied from interface:Gesture
Dispatched if this gesture goes GREEDY.- Specified by:
started
in interfaceGesture<T extends GestureBase<T>>
-
completed
Description copied from interface:Gesture
Dispatched when this gesture is completed. The value is only false if the gesture was GREEDY and it was canceled instead of completed.- Specified by:
completed
in interfaceGesture<T extends GestureBase<T>>
-