Package tripleplay.ui

Class Behavior<T extends Element<T>>

java.lang.Object
react.Slot<Object>
playn.scene.Pointer.Listener
tripleplay.ui.Behavior<T>
All Implemented Interfaces:
react.Reactor.RListener, react.SignalView.Listener<Object>, react.ValueView.Listener<Object>
Direct Known Subclasses:
Behavior.Ignore, Behavior.Select, Behavior.Toggle

public abstract class Behavior<T extends Element<T>> extends Pointer.Listener
Controls the behavior of a widget (how it responds to pointer events).
  • Constructor Details

    • Behavior

      public Behavior(T owner)
  • Method Details

    • onStart

      public void onStart(Pointer.Interaction iact)
      Overrides:
      onStart in class Pointer.Listener
    • onDrag

      public void onDrag(Pointer.Interaction iact)
      Overrides:
      onDrag in class Pointer.Listener
    • onEnd

      public void onEnd(Pointer.Interaction iact)
      Overrides:
      onEnd in class Pointer.Listener
    • layout

      public void layout()
      Called when our owner is laid out. If the behavior needs to resolve configuration via styles, this is where it should do it.
    • soundAction

      public void soundAction()
      Emits the action sound for our owner, if one is configured.
    • onPress

      public abstract void onPress(Pointer.Interaction iact)
      Called when the pointer is pressed down on our element.
    • onHover

      public abstract void onHover(Pointer.Interaction iact, boolean inBounds)
      Called as the user drags the pointer around after pressing. Derived classes map this onto the widget state, such as updating selectedness.
    • onRelease

      public abstract boolean onRelease(Pointer.Interaction iact)
      Called when the pointer is released after having been pressed on this widget. This should return true if the gesture is considered a click, in which case onClick(playn.scene.Pointer.Interaction) will be called automatically.
    • onClick

      public abstract void onClick(Pointer.Interaction iact)
      Called when the pointer is released and the subclass decides that it is a click, i.e. returns true from onRelease(playn.scene.Pointer.Interaction).