Example usage for javax.swing.tree DefaultMutableTreeNode getNextLeaf

List of usage examples for javax.swing.tree DefaultMutableTreeNode getNextLeaf

Introduction

In this page you can find the example usage for javax.swing.tree DefaultMutableTreeNode getNextLeaf.

Prototype

public DefaultMutableTreeNode getNextLeaf() 

Source Link

Document

Returns the leaf after this node or null if this node is the last leaf in the tree.

Usage

From source file:streamme.visuals.Main.java

public void addToPlaylist(DefaultMutableTreeNode node, int listIdx, boolean recursive) {
    DefaultMutableTreeNode leaf = node.getFirstLeaf();
    while (node.isNodeDescendant(leaf)) {
        DataNode dn = (DataNode) leaf.getUserObject();
        javax.swing.tree.TreeNode[] tree = leaf.getPath();
        String path = StreamMe.OPTIONS.getOutputPath();
        for (int i = 1; i < tree.length; i++) {
            path += "\\" + ((DataNode) ((DefaultMutableTreeNode) tree[i]).getUserObject()).getName();
        }/* w  w  w  .  j av  a2  s  .c  o  m*/
        PlaylistManager.get().addToPlaylist(listIdx, dn.toFileLink(path));
        leaf = leaf.getNextLeaf();
    }
}