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,LXSnapshot.RackPatternView
- Enclosing class:
LXSnapshot
public abstract sealed class LXSnapshot.View
extends Object
implements LXSerializable
permits LXSnapshot.ParameterView, LXSnapshot.ChannelFaderView, LXSnapshot.ActivePatternView, LXSnapshot.RackPatternView
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.abstract StringGets a description of the behavior of the parameter or field represented by the viewabstract StringgetLabel()Gets a descriptive label for the parameter or field represented by the viewReturns the snapshot that this view belongs toabstract LXComponentGets the component that owns the parameter/field referenced by the viewabstract StringGets a unique path identifier for this view in the context of its snapshotprotected 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
-
getLabel
Gets a descriptive label for the parameter or field represented by the view- Returns:
- Descriptive label for the parameter or field represented by the view
-
getDescription
Gets a description of the behavior of the parameter or field represented by the view- Returns:
- Description of the behavior of the parameter or field represented by the view
-
getViewComponent
Gets the component that owns the parameter/field referenced by the view- Returns:
- Component that owns the parameter/field referenced by the view
-
getViewPath
Gets a unique path identifier for this view in the context of its snapshot- Returns:
- Unique path identifier for this view in the context of its snapshot
-
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()
-