Class AbstractTreeNode

    • Field Detail

      • parent

        protected ITreeNode parent
        The parent node.
      • searching

        protected boolean searching
        Flag to indicate search in progress.
      • recurse

        protected boolean recurse
        Flag to indicate recursive refresh.
      • dirty

        protected boolean dirty
        Flag to indicate that children were added / removed during ongoing search (->restart search).
      • childrenfuture

        protected Future<java.util.List<ITreeNode>> childrenfuture
        The children future (result of next search).
    • Method Detail

      • dispose

        public void dispose()
        Called when the node is removed or the tree is closed.
        Specified by:
        dispose in interface ITreeNode
      • setParent

        public void setParent​(ITreeNode parent)
        The dirty to set.
        Parameters:
        dirty - The dirty to set
      • getChildCount

        public int getChildCount()
        Get the child count.
        Specified by:
        getChildCount in interface ITreeNode
      • isLeaf

        public boolean isLeaf()
        Check if the node is a leaf.
        Specified by:
        isLeaf in interface ITreeNode
      • refresh

        public void refresh​(boolean recurse)
        Refresh the node.
        Specified by:
        refresh in interface ITreeNode
        Parameters:
        recurse - Recursively refresh subnodes, if true.
      • getCachedChildren

        public java.util.List<ITreeNode> getCachedChildren()
        Get the cached children, i.e. do not start any background processes for updating the children.
        Specified by:
        getCachedChildren in interface ITreeNode
      • getChildren

        public IFuture<java.util.List<ITreeNode>> getChildren()
        Get the current children, i.e. start a new update process and provide the result as a future.
        Specified by:
        getChildren in interface ITreeNode
      • hasProperties

        public boolean hasProperties()
        True, if the node has properties that can be displayed.
        Specified by:
        hasProperties in interface ITreeNode
      • getIcon

        public abstract byte[] getIcon()
        Get the icon for a node.
        Specified by:
        getIcon in interface ITreeNode
      • getTooltipText

        public abstract java.lang.String getTooltipText()
        Get tooltip text.
        Specified by:
        getTooltipText in interface ITreeNode
      • searchChildren

        protected abstract void searchChildren()
        Asynchronously search for children. Called once for each node. Should call setChildren() once children are found.
      • setChildren

        protected void setChildren​(java.util.List<? extends ITreeNode> newchildren)
        Set the children. No children should be represented as empty list to avoid ongoing search for children.
      • expandChildren

        protected void expandChildren​(boolean dorecurse,
                                      java.util.List<ITreeNode> children)
      • checkChildren

        protected boolean checkChildren​(java.util.List oldcs,
                                        java.util.List newcs)
        Check the children for validity. I.e. it is not allowed to have two equal children in the list or to alter the ordering of existing children.
      • addChild

        public void addChild​(int index,
                             ITreeNode node)
        Add a child and update the tree. Must be called from swing thread.
      • addChild

        public void addChild​(ITreeNode node)
        Add a child and update the tree.
      • removeChild

        public void removeChild​(ITreeNode node)
        Remove a child and update the tree.
      • removeAllChildren

        public void removeAllChildren()
        Remove all children.
      • equals

        public boolean equals​(java.lang.Object obj)
        Test if two nodes are equal.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Generate a has code.
        Overrides:
        hashCode in class java.lang.Object