Package javax.swing.tree

Examples of javax.swing.tree.MutableTreeNode


    final MutableTreeNode root = createRoot();
    final TestTree tree = new TestTree(nodes(root));

    private static MutableTreeNode createRoot() {
      MutableTreeNode root = node("root",
          node("branch1", node("branch1.1", node("branch1.1.1"), node("branch1.1.2")), node("branch1.2")),
          node("branch2"));
      return root;
    }
View Full Code Here


    }

    final TestTree tree = new TestTree(nodes());

    private static TreeModel nodes() {
      MutableTreeNode root = node("root", node("a", node("b", node("c"))));
      return new DefaultTreeModel(root);
    }
View Full Code Here

    final MutableTreeNode root = createRoot();
    final TestTree tree = new TestTree(nodes(root));

    private static MutableTreeNode createRoot() {
      MutableTreeNode root = node("root", node("branch1", node("branch1.1"), node("branch1.2")), node("branch2"));
      return root;
    }
View Full Code Here

    }

    final TestTree tree = new TestTree(nodes());

    private static TreeModel nodes() {
      MutableTreeNode root = node("root",
          node("branch1", node("branch1.1", node("branch1.1.1"), node("branch1.1.2")), node("branch1.2")),
          node("branch2"));
      return new DefaultTreeModel(root);
    }
View Full Code Here

    }

    final TestTree tree = new TestTree(nodes());

    private static TreeModel nodes() {
      MutableTreeNode root = node("root",
          node("branch1", node("branch1.1", node("branch1.1.1"), node("branch1.1.2")), node("branch1.2")));
      return new DefaultTreeModel(root);
    }
View Full Code Here

            throw new RuntimeException(t.getMessage());
        }

        is.close();

        final MutableTreeNode parentNode = getNode(d.path, filename, rootNode);
        final MutableTreeNode nameNode = new DefaultMutableTreeNode(d.name);
        parentNode.insert(nameNode, 0);
        final MutableTreeNode dNode = new DefaultMutableTreeNode(d);
        nameNode.insert(dNode, 0);
    }
View Full Code Here

     */
    private MutableTreeNode getNode(final POIFSDocumentPath path,
                                    final String fsName,
                                    final MutableTreeNode root)
    {
        MutableTreeNode n = (MutableTreeNode) pathToNode.get(path);
        if (n != null)
            /* Node found in map, just return it. */
            return n;
        if (path.length() == 0)
        {
            /* This is the root path of the POI filesystem. Its tree
             * node is resp. must be located below the tree node of
             * the POI filesystem itself. This is a tree node with the
             * POI filesystem's name (this the operating system file's
             * name) as its key it the path-to-node map. */
            n = (MutableTreeNode) pathToNode.get(fsName);
            if (n == null)
            {
                /* A tree node for the POI filesystem does not yet
                 * exist. */
                n = new DefaultMutableTreeNode(fsName);
                pathToNode.put(fsName, n);
                root.insert(n, 0);
            }
            return n;
        }
        else
        {
            /* The path is somewhere down in the POI filesystem's
             * hierarchy. We need the tree node of this path's parent
             * and attach our new node to it. */
            final String name = path.getComponent(path.length() - 1);
            final POIFSDocumentPath parentPath = path.getParent();
            final MutableTreeNode parentNode =
                getNode(parentPath, fsName, root);
            n = new DefaultMutableTreeNode(name);
            pathToNode.put(path, n);
            parentNode.insert(n, 0);
            return n;
        }
    }
View Full Code Here

                ("Unexpected exception while closing " +
                event.getName() + " in " + event.getPath().toString());
            ex.printStackTrace(System.err);
        }

        final MutableTreeNode parentNode = getNode(d.path, filename, rootNode);
        final MutableTreeNode nameNode = new DefaultMutableTreeNode(d.name);
        parentNode.insert(nameNode, 0);
        final MutableTreeNode dNode = new DefaultMutableTreeNode(d);
        nameNode.insert(dNode, 0);
    }
View Full Code Here

     */
    private MutableTreeNode getNode(final POIFSDocumentPath path,
                                    final String fsName,
                                    final MutableTreeNode root)
    {
        MutableTreeNode n = (MutableTreeNode) pathToNode.get(path);
        if (n != null)
            /* Node found in map, just return it. */
            return n;
        if (path.length() == 0)
        {
            /* This is the root path of the POI filesystem. Its tree
             * node is resp. must be located below the tree node of
             * the POI filesystem itself. This is a tree node with the
             * POI filesystem's name (this the operating system file's
             * name) as its key it the path-to-node map. */
            n = (MutableTreeNode) pathToNode.get(fsName);
            if (n == null)
            {
                /* A tree node for the POI filesystem does not yet
                 * exist. */
                n = new DefaultMutableTreeNode(fsName);
                pathToNode.put(fsName, n);
                root.insert(n, 0);
            }
            return n;
        }
        else
        {
            /* The path is somewhere down in the POI filesystem's
             * hierarchy. We need the tree node of this path's parent
             * and attach our new node to it. */
            final String name = path.getComponent(path.length() - 1);
            final POIFSDocumentPath parentPath = path.getParent();
            final MutableTreeNode parentNode =
                getNode(parentPath, fsName, root);
            n = new DefaultMutableTreeNode(name);
            pathToNode.put(path, n);
            parentNode.insert(n, 0);
            return n;
        }
    }
View Full Code Here

                ("Unexpected exception while closing " +
                event.getName() + " in " + event.getPath().toString());
            ex.printStackTrace(System.err);
        }

        final MutableTreeNode parentNode = getNode(d.path, filename, rootNode);
        final MutableTreeNode nameNode = new DefaultMutableTreeNode(d.name);
        parentNode.insert(nameNode, 0);
        final MutableTreeNode dNode = new DefaultMutableTreeNode(d);
        nameNode.insert(dNode, 0);
    }
View Full Code Here

TOP

Related Classes of javax.swing.tree.MutableTreeNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.