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
FieldsModifier and TypeFieldDescriptionfinal BooleanParameterWhether this view is enabled for recall or not.final LXSnapshot.ViewScope -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()protected voidSubclasses may override, indicates the completion of a transitionabstract LXCommandGets a command version of this view's operation, needed to make this action undoable.Returns the snapshot that this view belongs toprotected voidinterpolate(double amount) Subclasses may override, indicates the progress of a transitionprotected abstract booleanisDependentOf(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 disposedvoidload(LX lx, JsonObject obj) Restores this instance from a JSON objectprotected abstract voidrecall()Subclasses must implement, should reapply the state of the view immediatelyvoidsave(LX lx, JsonObject obj) Serializes this instance into the JSON objectprotected voidSubclasses 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:
trueif this view depends upon that component's existence,falseotherwise
-
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:LXSerializableSerializes this instance into the JSON object- Specified by:
savein interfaceLXSerializable- Parameters:
lx- LX instanceobj- Object to serialize into
-
load
Description copied from interface:LXSerializableRestores this instance from a JSON object- Specified by:
loadin interfaceLXSerializable- Parameters:
lx- LX instanceobj- Object to deserialize
-
dispose
public void dispose()
-