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
Modifier and TypeClassDescriptionstatic interface
static class
class
class
Nested classes/interfaces inherited from class heronarts.lx.LXComponent
LXComponent.Hidden, LXComponent.Placeholder, LXComponent.Renamable
Nested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils
-
Field Summary
Fields inherited from class heronarts.lx.LXComponent
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, presetFile
Fields inherited from interface heronarts.lx.LXPath
ROOT, ROOT_PREFIX, ROOT_SLASH
-
Constructor Summary
-
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) void
dispose()
Invoked when a component is being removed from the system and will no longer be used at all.void
load
(LX lx, JsonObject obj) Loads the LX component.void
modelGenerationChanged
(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 listvoid
reset()
void
save
(LX lx, JsonObject obj) Serializes the LX component.Methods inherited from class heronarts.lx.LXComponent
addArray, addChild, addInternalParameter, addLegacyInternalParameter, addLegacyParameter, addParameter, addParameter, addParameters, contains, copyParameters, getCategory, getChild, 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, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface heronarts.lx.LX.Listener
modelChanged
Methods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
-
Field Details
-
views
-
-
Constructor Details
-
LXViewEngine
-
-
Method Details
-
modelGenerationChanged
Description copied from interface:LX.Listener
Fired 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:
modelGenerationChanged
in 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:LXComponent
Invoked 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:
dispose
in classLXComponent
-
save
Description copied from class:LXComponent
Serializes 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:
save
in interfaceLXSerializable
- Overrides:
save
in classLXComponent
- Parameters:
lx
- LX instanceobj
- Object to serialize into
-
load
Description copied from class:LXComponent
Loads 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:
load
in interfaceLXSerializable
- Overrides:
load
in classLXComponent
- Parameters:
lx
- LX instanceobj
- Object to deserialize
-
addViews
-