Class GestureBase<T extends GestureBase<T>>

java.lang.Object
tripleplay.gesture.GestureBase<T>
All Implemented Interfaces:
Gesture<T>
Direct Known Subclasses:
Swipe, Tap

public abstract class GestureBase<T extends GestureBase<T>> extends Object implements 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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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
    Perform a potential state transition in this Gesture based on the most recent touch information.
    boolean
    Returns whether this gesture will be greedy.
    greedy(boolean value)
    Greedy gestures will dispatch both a started() and completed() event, and are considered greedy because once their start conditions have been met, they will prevent other gestures from further consideration for dispatch.
    void
    Called at the start of a new user interaction, forcibly puts this gesture into the PASSIVE state.
    react.SignalView<Void>
    Dispatched if this gesture goes GREEDY.
    Return the current gesture state.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GestureBase

      public GestureBase()
  • Method Details

    • greedy

      public T greedy(boolean value)
      Greedy gestures will dispatch both a started() and completed() 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 interface Gesture<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 interface Gesture<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 interface Gesture<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 interface Gesture<T extends GestureBase<T>>
    • evaluate

      public void evaluate(GestureNode node)
      Description copied from interface: Gesture
      Perform a potential state transition in this Gesture based on the most recent touch information.
      Specified by:
      evaluate in interface Gesture<T extends GestureBase<T>>
    • state

      public Gesture.State state()
      Description copied from interface: Gesture
      Return the current gesture state.
      Specified by:
      state in interface Gesture<T extends GestureBase<T>>
    • started

      public react.SignalView<Void> started()
      Description copied from interface: Gesture
      Dispatched if this gesture goes GREEDY.
      Specified by:
      started in interface Gesture<T extends GestureBase<T>>
    • completed

      public react.SignalView<Boolean> 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 interface Gesture<T extends GestureBase<T>>