Package tripleplay.ui
Class Behavior.Track<T extends Element<T>>
java.lang.Object
react.Slot<Object>
playn.scene.Pointer.Listener
tripleplay.ui.Behavior<T>
tripleplay.ui.Behavior.Ignore<T>
tripleplay.ui.Behavior.Track<T>
- All Implemented Interfaces:
react.Reactor.RListener
,react.SignalView.Listener<Object>
,react.ValueView.Listener<Object>
Tracks the pressed position as an anchor and delegates to subclasses to update state based
on anchor and drag position.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Holds the necessary data for the currently active press.Nested classes/interfaces inherited from class tripleplay.ui.Behavior
Behavior.Capturing<T extends Element<T>>, Behavior.Click<T extends Element<T>>, Behavior.Ignore<T extends Element<T>>, Behavior.RapidFire<T extends Element<T>>, Behavior.Select<T extends Element<T>>, Behavior.Toggle<T extends Element<T>>, Behavior.Track<T extends Element<T>>
-
Field Summary
Modifier and TypeFieldDescriptionA distance, in event coordinates, used to decide if tracking should be temporarily cancelled. -
Method Summary
Modifier and TypeMethodDescriptionvoid
layout()
Called when our owner is laid out.void
onCancel
(Pointer.Interaction iact) void
onHover
(Pointer.Interaction iact, boolean inBounds) Called as the user drags the pointer around after pressing.void
onPress
(Pointer.Interaction iact) Called when the pointer is pressed down on our element.boolean
onRelease
(Pointer.Interaction iact) Called when the pointer is released after having been pressed on this widget.Methods inherited from class tripleplay.ui.Behavior.Ignore
onClick
Methods inherited from class tripleplay.ui.Behavior
onDrag, onEnd, onStart, soundAction
Methods inherited from class playn.scene.Pointer.Listener
onEmit
Methods inherited from class react.Slot
andThen, compose, filtered, onChange
-
Field Details
-
HOVER_LIMIT
A distance, in event coordinates, used to decide if tracking should be temporarily cancelled. If the pointer is hovered more than this distance outside of the owner's bounds, the tracking will revert to the anchor position, just like when the pointer is cancelled. A null value indicates that the tracking will be unconfined in this way. TODO: default to 35 if no Slider uses are relying on lack of hover limit.
-
-
Method Details
-
onPress
Description copied from class:Behavior
Called when the pointer is pressed down on our element.- Overrides:
onPress
in classBehavior.Ignore<T extends Element<T>>
-
onHover
Description copied from class:Behavior
Called as the user drags the pointer around after pressing. Derived classes map this onto the widget state, such as updating selectedness.- Overrides:
onHover
in classBehavior.Ignore<T extends Element<T>>
-
onRelease
Description copied from class:Behavior
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 caseBehavior.onClick(playn.scene.Pointer.Interaction)
will be called automatically.- Overrides:
onRelease
in classBehavior.Ignore<T extends Element<T>>
-
onCancel
- Overrides:
onCancel
in classBehavior.Ignore<T extends Element<T>>
-
layout
public void layout()Description copied from class:Behavior
Called when our owner is laid out. If the behavior needs to resolve configuration via styles, this is where it should do it.
-