Class BasicTree

    • Constructor Detail

      • BasicTree

        public BasicTree()
        Create an empty tree.
    • Method Detail

      • makeVisible

        public void makeVisible​(TreePath path)
        Make a node in the tree visible in the rendered tree. For example, scroll the tree viewport so that a path is visible.
        Specified by:
        makeVisible in interface Tree
        Parameters:
        path - Path to make visible.
      • expandPath

        public void expandPath​(TreePath path)
        Expand a path in the tree. Has no effect on leaf nodes.
        Specified by:
        expandPath in interface Tree
        Parameters:
        path - Path to expand.
      • collapsePath

        public void collapsePath​(TreePath path)
        Collapse a path in the tree. Has no effect on leaf nodes.
        Specified by:
        collapsePath in interface Tree
        Parameters:
        path - Path to collapse.
      • getNode

        public TreeNode getNode​(TreePath path)
        Locate a node in the tree.
        Specified by:
        getNode in interface Tree
        Parameters:
        path - Path to the node.
        Returns:
        Node identified by path if it exists in the tree.
      • togglePath

        public void togglePath​(TreePath path)
        Expand a collapsed path, or collapse an expanded path. Has no effect on leaf nodes.
        Specified by:
        togglePath in interface Tree
        Parameters:
        path - Path to operate on. If the node defined by path is expanded, it will be collapsed. If it is collapsed it will be expanded.
      • isPathExpanded

        public boolean isPathExpanded​(TreePath path)
        Is a path expanded in the tree?
        Specified by:
        isPathExpanded in interface Tree
        Parameters:
        path - Path to test.
        Returns:
        true if the path is expanded, false if collapsed. Always returns false for leaf nodes.
      • isNodeExpanded

        public boolean isNodeExpanded​(TreeNode node)
        Is a node expanded?
        Specified by:
        isNodeExpanded in interface Tree
        Parameters:
        node - Node to test.
        Returns:
        true if the node is expanded, false if collapsed. Always returns false for leaf nodes.
      • render

        public void render​(DrawContext dc)
        Causes this Renderable to render itself using the provided draw context.
        Specified by:
        render in interface Renderable
        Parameters:
        dc - the DrawContext to be used
        See Also:
        DrawContext
      • pick

        public void pick​(DrawContext dc,
                         java.awt.Point pickPoint)
        Executes a pick of the ordered renderable.
        Specified by:
        pick in interface OrderedRenderable
        Parameters:
        dc - the current draw context.
        pickPoint - the pick point.
      • getDistanceFromEye

        public double getDistanceFromEye()
        Returns the ordered renderable's distance from the current view's eye point. Intended to be used only to sort a list of ordered renderables according to eye distance, and only during frame generation when a view is active.
        Specified by:
        getDistanceFromEye in interface OrderedRenderable
        Returns:
        the distance of the ordered renderable from the current view's eye point.
      • setLayout

        public void setLayout​(TreeLayout layout)
        Set the tree layout. The layout determines how the tree will be rendered.
        Specified by:
        setLayout in interface Tree
        Parameters:
        layout - New layout.
        See Also:
        Tree.getLayout()
      • setModel

        public void setModel​(TreeModel model)
        Set the tree model. The model determines the contents of the tree.
        Specified by:
        setModel in interface Tree
        Parameters:
        model - New tree model.
        See Also:
        Tree.getModel()