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
Controls the behavior of a widget (how it responds to pointer events).
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Behavior.Capturing<T extends Element<T>>
A click behavior that captures the pointer and optionally issues clicks based on some time based function.static class
Behavior.Click<T extends Element<T>>
Implements clicking behavior.static class
Behavior.Ignore<T extends Element<T>>
A behavior that ignores everything.static class
Behavior.RapidFire<T extends Element<T>>
Captures the pointer and dispatches one click on press, a second after an initial delay and at regular intervals after that.static class
Behavior.Select<T extends Element<T>>
Implements button-like behavior: selects the element when the pointer is in bounds, and deselects on release.static class
Behavior.Toggle<T extends Element<T>>
Implements toggling behavior.static class
Behavior.Track<T extends Element<T>>
Tracks the pressed position as an anchor and delegates to subclasses to update state based on anchor and drag position. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
layout()
Called when our owner is laid out.abstract void
onClick
(Pointer.Interaction iact) Called when the pointer is released and the subclass decides that it is a click, i.e.void
onDrag
(Pointer.Interaction iact) void
onEnd
(Pointer.Interaction iact) abstract void
onHover
(Pointer.Interaction iact, boolean inBounds) Called as the user drags the pointer around after pressing.abstract void
onPress
(Pointer.Interaction iact) Called when the pointer is pressed down on our element.abstract boolean
onRelease
(Pointer.Interaction iact) Called when the pointer is released after having been pressed on this widget.void
onStart
(Pointer.Interaction iact) void
Emits the action sound for our owner, if one is configured.Methods inherited from class playn.scene.Pointer.Listener
onCancel, onEmit
Methods inherited from class react.Slot
andThen, compose, filtered, onChange
-
Constructor Details
-
Behavior
-
-
Method Details
-
onStart
- Overrides:
onStart
in classPointer.Listener
-
onDrag
- Overrides:
onDrag
in classPointer.Listener
-
onEnd
- Overrides:
onEnd
in classPointer.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
Called when the pointer is pressed down on our element. -
onHover
Called as the user drags the pointer around after pressing. Derived classes map this onto the widget state, such as updating selectedness. -
onRelease
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 caseonClick(playn.scene.Pointer.Interaction)
will be called automatically. -
onClick
Called when the pointer is released and the subclass decides that it is a click, i.e. returns true fromonRelease(playn.scene.Pointer.Interaction)
.
-