Package heronarts.lx.snapshot
Class LXSnapshot.View
java.lang.Object
heronarts.lx.snapshot.LXSnapshot.View
- All Implemented Interfaces:
LXSerializable
- Direct Known Subclasses:
LXSnapshot.ActivePatternView
,LXSnapshot.ChannelFaderView
,LXSnapshot.ParameterView
- Enclosing class:
- LXSnapshot
A view is a component of a snapshot, it's a single piece of the snapshot that
is "looking at" one piece of state.
-
Nested Class Summary
Nested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils
-
Field Summary
Modifier and TypeFieldDescriptionfinal BooleanParameter
Whether this view is enabled for recall or not.final LXSnapshot.ViewScope
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
protected void
Subclasses may override, indicates the completion of a transitionabstract LXCommand
Gets a command version of this view's operation, needed to make this action undoable.Returns the snapshot that this view belongs toprotected void
interpolate
(double amount) Subclasses may override, indicates the progress of a transitionprotected abstract boolean
isDependentOf
(LXComponent component) Subclasses must implement, determines whether the given view is dependent upon the specified component, and whether this view should be removed if the component is disposedvoid
load
(LX lx, JsonObject obj) Restores this instance from a JSON objectprotected abstract void
recall()
Subclasses must implement, should reapply the state of the view immediatelyvoid
save
(LX lx, JsonObject obj) Serializes this instance into the JSON objectprotected void
Subclasses may override, indicates the beginning of a transition
-
Field Details
-
scope
-
enabled
Whether this view is enabled for recall or not.
-
-
Method Details
-
getSnapshot
Returns the snapshot that this view belongs to- Returns:
- Snapshot that this view belongs to
-
getCommand
Gets a command version of this view's operation, needed to make this action undoable.- Returns:
- Command implementation of this view
-
isDependentOf
Subclasses must implement, determines whether the given view is dependent upon the specified component, and whether this view should be removed if the component is disposed- Parameters:
component
- Component to test- Returns:
true
if this view depends upon that component's existence,false
otherwise
-
recall
protected abstract void recall()Subclasses must implement, should reapply the state of the view immediately -
startTransition
protected void startTransition()Subclasses may override, indicates the beginning of a transition -
interpolate
protected void interpolate(double amount) Subclasses may override, indicates the progress of a transition- Parameters:
amount
- Amount of interpolation to apply
-
finishTransition
protected void finishTransition()Subclasses may override, indicates the completion of a transition -
save
Description copied from interface:LXSerializable
Serializes this instance into the JSON object- Specified by:
save
in interfaceLXSerializable
- Parameters:
lx
- LX instanceobj
- Object to serialize into
-
load
Description copied from interface:LXSerializable
Restores this instance from a JSON object- Specified by:
load
in interfaceLXSerializable
- Parameters:
lx
- LX instanceobj
- Object to deserialize
-
dispose
public void dispose()
-