Package com.j3d.engine.scene.nodes
Interface SceneObjectList
- All Superinterfaces:
HasProperties,SceneObject
A special kind of
SceneObject which is almost all the time just a collection of other
SceneObjects but with the extra role of having to:
- Be apart of the
LayerTree - Be hidden and deleted via the
HistoryusingActions - Be serialized by
ProjectFileand reconstructed off the EDT thread viainvokeSwingHooks()
- Author:
- Lehlogonolo Poole
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionDeletes the object.TreeNodeIdentity<? extends SceneObjectList> Returns theTreeNodeIdentityfor the given object to use within theLayerTreeBiConsumer<? extends SceneObjectList, DefaultMutableTreeNode> The callback for when the object is selected in the tree.The actual tree node for the representation of this object withinLayerTreevoidAn internal delete method which all implementors should override for instantaneous deletion.voidA method to initialise anything swing related within the constructor.booleanLabels the object as for deletion.booleanisHidden()Whether the given object is hidden or notvoidsetForDeletion(boolean forDeletion) Marks the object for deletion.voidsetHidden(boolean hidden) Hides the object.default voidToggles the visibility of the object.Methods inherited from interface com.j3d.gen.properties.HasProperties
getPropertiesMethods inherited from interface com.j3d.engine.scene.SceneObject
getId, getName
-
Method Details
-
isHidden
boolean isHidden()Whether the given object is hidden or not- Returns:
- true if hidden, false otherwise
-
setHidden
void setHidden(boolean hidden) Hides the object. This is for internal use. GUI and other user things should make use oftoggleVisibility()instead. -
isForDeletion
boolean isForDeletion()Labels the object as for deletion. Has similar implications as being hidden however it will be cleaned up later and won't be available on lists.- Returns:
- true if the object was marked for deletion
-
setForDeletion
void setForDeletion(boolean forDeletion) Marks the object for deletion. -
toggleVisibility
Toggles the visibility of the object.- Returns:
- An action that toggles the visibility of the object and returns the new visibility state.
-
deleteLater
DirtyVoidAction deleteLater()Deletes the object.The use of the word "later" is because the action of deletion is only ever done once the Action object is out of the history's bounds. At that point
CleanableAction.cleanup()is called, which actually deletes.- Returns:
- An action that deletes the object.
-
toggleSaved
default void toggleSaved() -
instantDelete
void instantDelete()An internal delete method which all implementors should override for instantaneous deletion.This method should not be called by a user interface things. However, any object overriding the method must provide a way to delete everything relating to it.
-
getIdentity
TreeNodeIdentity<? extends SceneObjectList> getIdentity()Returns theTreeNodeIdentityfor the given object to use within theLayerTree- Returns:
- The identity
-
getTreeNode
DefaultMutableTreeNode getTreeNode()The actual tree node for the representation of this object withinLayerTree- Returns:
- The tree node
-
getOnSelect
BiConsumer<? extends SceneObjectList,DefaultMutableTreeNode> getOnSelect()The callback for when the object is selected in the tree.- Returns:
- The callback
-
invokeSwingHooks
void invokeSwingHooks()A method to initialise anything swing related within the constructor. This is typically called within the SceneObjectList's constructor who needs to create an object outside the EDT thread.A use case (the current use case) would be when an SceneObjectList is loaded from disk to memory and the
Spinnerdialog is blocking the EDT thread. After the throbber has finished, you may call invokeSwingHooks safely rather than fighting with a blocked EDT thread.
-