Class Node

    • Field Detail

      • m_Owner

        protected transient Tree m_Owner
        the owning tree.
      • m_Variables

        protected HashSet<String> m_Variables
        the variables.
      • m_RenderString

        protected String m_RenderString
        the render string.
      • m_Editable

        protected boolean m_Editable
        whether the node is editable.
      • m_Bookmarked

        protected boolean m_Bookmarked
        whether the node is currently bookmarked.
      • m_AnnotationProcessor

        protected static AnnotationProcessor m_AnnotationProcessor
        the annotation processor.
      • m_AnnotationProcessorInitialized

        protected static Boolean m_AnnotationProcessorInitialized
        whether the processor has been initialized.
      • m_CommandLine

        protected String m_CommandLine
        the commandline (cache for undo/redo).
    • Constructor Detail

      • Node

        protected Node​(Tree owner)
        Initializes the node.
        Parameters:
        owner - the owning tree, can be null
      • Node

        public Node​(Tree owner,
                    Actor actor)
        Initializes the node.
        Parameters:
        owner - the owning tree, can be null
        actor - the underlying actor
      • Node

        public Node​(Tree owner,
                    Actor actor,
                    String commandline)
        Initializes the node.
        Parameters:
        owner - the owning tree, can be null
        actor - the stripped actor
        commandline - the commandline of the actor
    • Method Detail

      • hasOwner

        public boolean hasOwner()
        Returns whether an owner is set.
        Returns:
        true if owner is set
      • setOwner

        public void setOwner​(Tree value)
        Sets the owning tree recursively.
        Parameters:
        value - the tree this node belongs to
      • setOwner

        protected void setOwner​(Tree value,
                                boolean invalidate)
        Sets the owning tree recursively.
        Parameters:
        value - the tree this node belongs to
      • getOwner

        public Tree getOwner()
        Returns the tree the node belongs to.
        Returns:
        the tree
      • setActor

        public void setActor​(Actor value)
        Sets the actor. Strips it down before using it.
        Parameters:
        value - the actor
      • getActor

        public Actor getActor()
        Returns the stored (stripped down) actor.
        Returns:
        the actor
      • getFullName

        public String getFullName()
        Returns the full name of the node (up to the root).
        Returns:
        the full name
      • getFullActor

        public Actor getFullActor()
        Returns the full actor, i.e., including all possible sub-actors.
        Returns:
        the generated actor
      • getFullActor

        public Actor getFullActor​(StringBuilder errors)
        Returns the full actor, i.e., including all possible sub-actors.
        Parameters:
        errors - for appending errors encountered while assembling, use null to ignore
        Returns:
        the generated actor
      • isRemovable

        public boolean isRemovable()
        Returns whether this node can be removed or not. E.g., the elements of non-mutable ActorHandlers.
        Returns:
        true if removeable
      • replace

        public int replace​(Comparable find,
                           Comparable replace,
                           boolean recursive)
        Replaces an object in the tree (ie, the actors), recursion is optional.
        Parameters:
        find - the object to find
        replace - the replacement
        recursive - whether to recurse deeper in the tree
        Returns:
        true if something got replaced
      • destroy

        public void destroy()
        Frees up memory in a "destructive" non-reversible way.
        Specified by:
        destroy in interface Destroyable
      • classArrayToString

        protected String classArrayToString​(Class[] classes)
        Turns a class array (from input/output arrays) into a string.
        Parameters:
        classes - the classes to turn into a list
        Returns:
        the generated list string
      • scaleFontSize

        protected String scaleFontSize​(String size)
        Scales the HTML font size using the icon scaling factor of the tree.
        Parameters:
        size - the HTML font size string
        Returns:
        the new font size
      • generateSizeAttribute

        public String generateSizeAttribute​(String size)
        Generates the size attribute HTML string. Gets skipped if the scale factor differs from 1.0, as the rendering doesn't take this properly into account.
        Parameters:
        size - the size string to parse/use
        Returns:
        the HTML code, can be empty string
        See Also:
        scaleFontSize(String)
      • strippedCommandLine

        public static String strippedCommandLine​(Actor actor)
        Returns the commandline of the stripped down version of the actor, i.e., for ActorHandlers, without any sub-actors.
        Parameters:
        actor - the actor to strip down
        Returns:
        the stripped down actor
        See Also:
        ActorHandler
      • invalidateRendering

        public void invalidateRendering()
        Invalidates the rendering string recursively, forces the tree to redraw itself.
      • indexOf

        public int indexOf​(String name)
        Returns the index of the child with the specified actor name.
        Parameters:
        name - the name to look for
        Returns:
        the index, -1 if not found
      • canExpand

        public boolean canExpand()
        Returns whether the node can be expanded at all.
        Overrides:
        canExpand in class LazyExpansionTreeNode
        Returns:
        true if it can be expanded
      • getExpansionOccurred

        public boolean getExpansionOccurred()
        Returns whether the expansion has already occurred.
        Overrides:
        getExpansionOccurred in class LazyExpansionTreeNode
        Returns:
        true if the expansion has already occurred
      • doExpand

        protected boolean doExpand()
        Expands this node.
        Specified by:
        doExpand in class LazyExpansionTreeNode
        Returns:
        true if structure below this node was changed
      • requiresReexpand

        public boolean requiresReexpand()
        Returns whether the node requires resetting.
        Overrides:
        requiresReexpand in class LazyExpansionTreeNode
        Returns:
        true if it can be expanded
      • setEditable

        public void setEditable​(boolean value)
        Sets whether the node is editable.
        Parameters:
        value - if true then the node will be editable
      • setEditable

        public void setEditable​(boolean value,
                                boolean recurse)
        Sets whether the node is editable.
        Parameters:
        value - if true then the node will be editable
        recurse - whether to set the state recursively
      • setBookmarked

        public void setBookmarked​(boolean value)
        Sets whether the node is being bookmarked.
        Parameters:
        value - true if bookmarked
      • isBookmarked

        public boolean isBookmarked()
        Returns whether the node is currently bookmarked.
        Returns:
        true if bookmarked
      • isEditable

        public boolean isEditable()
        Returns whether the node is editable.
        Returns:
        true if the node is editable
      • getCommandLine

        public String getCommandLine()
        Returns the (cached) commandline of the actor.
        Returns:
        the commandline
      • sortChildren

        public void sortChildren​(Comparator<Node> comp)
        Sorts the children using the supplied comparator.
        Parameters:
        comp - the comparator to use