Interface Tree

    • Method Detail

      • setLayout

        void setLayout​(TreeLayout layout)
        Set the tree layout. The layout determines how the tree will be rendered.
        Parameters:
        layout - New layout.
        See Also:
        getLayout()
      • getLayout

        TreeLayout getLayout()
        Get the tree layout. The layout determines how the tree will be rendered.
        Returns:
        The tree layout.
        See Also:
        setLayout(TreeLayout)
      • setModel

        void setModel​(TreeModel model)
        Set the tree model. The model determines the contents of the tree.
        Parameters:
        model - New tree model.
        See Also:
        getModel()
      • getModel

        TreeModel getModel()
        Get the tree model. The model determines the contents of the tree.
        Returns:
        the tree model.
        See Also:
        setModel(TreeModel)
      • getNode

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

        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.
        Parameters:
        path - Path to make visible.
      • expandPath

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

        void collapsePath​(TreePath path)
        Collapse a path in the tree. Has no effect on leaf nodes.
        Parameters:
        path - Path to collapse.
      • togglePath

        void togglePath​(TreePath path)
        Expand a collapsed path, or collapse an expanded path. Has no effect on leaf nodes.
        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

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

        boolean isNodeExpanded​(TreeNode node)
        Is a node expanded?
        Parameters:
        node - Node to test.
        Returns:
        true if the node is expanded, false if collapsed. Always returns false for leaf nodes.