Class JTreeUtil


  • public class JTreeUtil
    extends GuiUtilBase
    Common utility methods for working with JTrees.

    Chief among these is the loadTree method, for creating a tree from an XML definition

    Since:
    2.9.4
    • Method Detail

      • loadTree

        public static javax.swing.tree.DefaultMutableTreeNode loadTree​(java.lang.String name,
                                                                       WindowInterface wi,
                                                                       java.lang.Object context)
        Parameters:
        name - XML file to be read and processed
        wi - WindowInterface to be passed to the nodes in the tree
        context - Blind context Object passed to the nodes in the tree
        Returns:
        a mutable tree node
      • treeFromElement

        static javax.swing.tree.DefaultMutableTreeNode treeFromElement​(org.jdom2.Element main,
                                                                       WindowInterface wi,
                                                                       java.lang.Object context)
        Parameters:
        main - Element to be processed
        wi - WindowInterface to be passed to the nodes in the tree
        context - Blind context Object passed to the nodes in the tree
        Returns:
        a mutable tree node