Package heronarts.lx.structure.view
Class LXViewEngine
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.structure.view.LXViewEngine
- All Implemented Interfaces:
LX.Listener,LXPath,LXSerializable,LXParameterListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic classclassclassNested classes/interfaces inherited from class heronarts.lx.LXComponent
LXComponent.Description, LXComponent.Hidden, LXComponent.Name, LXComponent.Placeholder, LXComponent.PluginRequired, LXComponent.RenamableNested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils -
Field Summary
FieldsFields inherited from class heronarts.lx.LXComponent
childArrays, children, internalParameters, KEY_CHILDREN, KEY_CLASS, KEY_COMPONENT_ID, KEY_ID, KEY_INTERNAL, KEY_PARAMETER_PATH, KEY_PARAMETERS, KEY_PATH, KEY_RESET, label, legacyInternalParameters, legacyParameters, lx, modulationColor, modulationControlsExpanded, modulationsExpanded, parameters, presetFileFields inherited from interface heronarts.lx.LXPath
DEFAULT_SEPARATOR, ROOT, ROOT_PREFIX, ROOT_SLASH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddListener(LXViewEngine.Listener listener) Registers a listener to the view engineaddView()Add a new, uninitialized viewaddView(JsonObject viewObj, int index) Adds a view at the given indexaddViews(LX lx, JsonObject obj) voiddispose()Invoked when a component is being removed from the system and will no longer be used at all.voidload(LX lx, JsonObject obj) Loads the LX component.voidmodelGenerationChanged(LX lx, LXModel model) Fired when the generation of a model has been changed.moveView(LXViewDefinition view, int index) Moves a saved view to a different position in the listnewViewSelector(String label, String description) newViewSelectorPriority(String label, String description) removeListener(LXViewEngine.Listener listener) Unregisters a listener to the paletteremoveView(LXViewDefinition view) Removes a view from the view engine's listvoidreset()voidsave(LX lx, JsonObject obj) Serializes the LX component.Methods inherited from class heronarts.lx.LXComponent
addArray, addChild, addInternalParameter, addLegacyInternalParameter, addLegacyParameter, addParameter, addParameter, addParameters, assertDisposed, contains, copyParameters, getCategory, getChild, getComponentDescription, getComponentName, getComponentName, getComponentName, getDescription, getId, getLabel, getLX, getOscAddress, getOscLabel, getOscPath, getParameter, getParameters, getParent, getPath, handleOscMessage, hasParameter, isValidOscParameter, loadParameters, loadPreset, onParameterChanged, removeParameter, removeParameter, removeParameter, removeParameter, savePreset, setDescription, setParent, toOscQuery, toOscQuery, toOscQuery, toString, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface heronarts.lx.LX.Listener
modelChangedMethods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
-
Field Details
-
views
-
-
Constructor Details
-
LXViewEngine
-
-
Method Details
-
modelGenerationChanged
Description copied from interface:LX.ListenerFired when the generation of a model has been changed. This is the same model instance that has already been set on LX, but it has been modified. This is also fired the very first time a model is set (e.g. generation 0 for the model). Listeners that wish to take generic action based upon any new model geometry, whether it's an existing or new model, may listen to just this method.- Specified by:
modelGenerationChangedin interfaceLX.Listener- Parameters:
lx- LX instancemodel- model instance
-
addListener
Registers a listener to the view engine- Parameters:
listener- View listener- Returns:
- this
-
removeListener
Unregisters a listener to the palette- Parameters:
listener- Palette listener- Returns:
- this
-
addView
Add a new, uninitialized view- Returns:
- View that's added
-
addView
Adds a view at the given index- Parameters:
viewObj- Saved view objectindex- Index to save at- Returns:
- View object
-
removeView
Removes a view from the view engine's list- Parameters:
view- View to remove- Returns:
- this
-
moveView
Moves a saved view to a different position in the list- Parameters:
view- Saved viewindex- New index for that view- Returns:
- this
-
reset
public void reset() -
newViewSelector
-
newViewSelectorPriority
-
dispose
public void dispose()Description copied from class:LXComponentInvoked when a component is being removed from the system and will no longer be used at all. This unregisters the component and should free up any resources and parameter listeners. Ideally after this method is called the object should be eligible for garbage collection. Subclasses are generally expected to override this method to handle their particular cleanup work. They should also generally callsuper.dispose()at the appropriate time to perform the basic cleanup, which may need to happen either before or after cleaning up other objects.- Overrides:
disposein classLXComponent
-
save
Description copied from class:LXComponentSerializes the LX component. By default, all internal and user-facing parameters are serialized, as well as any explicitly registered child components. Note that child arrays are not serialized, or any other dynamic components. Subclasses may override to perform more saving, and are expected to callsuper.save(lx, obj)at the appropriate time.- Specified by:
savein interfaceLXSerializable- Overrides:
savein classLXComponent- Parameters:
lx- LX instanceobj- Object to serialize into
-
load
Description copied from class:LXComponentLoads the LX component. Restores the ID of the component, as well as its internal and user-facing parameters. Any explicitly registered children will be automatically loaded, so long as they are direct descendants. Dynamic arrays will not be automatically loaded, this is left to subclasses to implement.- Specified by:
loadin interfaceLXSerializable- Overrides:
loadin classLXComponent- Parameters:
lx- LX instanceobj- Object to deserialize
-
addViews
-