Interface SceneObjectList

All Superinterfaces:
HasProperties, SceneObject
All Known Implementing Classes:
Layer, Thing

public interface SceneObjectList extends 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:
Author:
Lehlogonolo Poole
See Also:
  • 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 of toggleVisibility() 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

      Action<Boolean> 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 the TreeNodeIdentity for the given object to use within the LayerTree
      Returns:
      The identity
    • getTreeNode

      DefaultMutableTreeNode getTreeNode()
      The actual tree node for the representation of this object within LayerTree
      Returns:
      The tree node
    • 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 Spinner dialog is blocking the EDT thread. After the throbber has finished, you may call invokeSwingHooks safely rather than fighting with a blocked EDT thread.