Search in sources :

Example 1 with FilePathTreeItem

use of com.negativevr.media_library.storage.FilePathTreeItem in project Media-Library by The-Rain-Goddess.

the class ApplicationWindow method updateFileSystem.

private void updateFileSystem() {
    System.out.println("Updating File System...");
    rootNode.getChildren().clear();
    Iterable<Path> rootDirectories = getDirectories(rootPath);
    for (Path name : rootDirectories) {
        FilePathTreeItem treeNode = new FilePathTreeItem(name);
        rootNode.getChildren().add(treeNode);
    //treeNode.setExpanded(true);
    }
    rootNode.setExpanded(true);
}
Also used : Path(java.nio.file.Path) FilePathTreeItem(com.negativevr.media_library.storage.FilePathTreeItem)

Example 2 with FilePathTreeItem

use of com.negativevr.media_library.storage.FilePathTreeItem in project Media-Library by The-Rain-Goddess.

the class ApplicationWindow method setupMediaFileBrowser.

//private File Browser mutators / accessors
private VBox setupMediaFileBrowser() {
    VBox treeBox = new VBox();
    treeBox.setMinHeight(650);
    treeBox.setMaxHeight(650);
    treeBox.setPadding(new Insets(10, 10, 10, 10));
    treeBox.setSpacing(10);
    //setup the root directory for file browser
    rootNode.setGraphic(new ImageView(new Image("com/negativevr/media_library/res/remove.png")));
    Iterable<Path> rootDirectories = getDirectories(rootPath);
    //populates the rootNode with Tree Items
    for (Path name : rootDirectories) {
        FilePathTreeItem treeNode = new FilePathTreeItem(name);
        rootNode.getChildren().add(treeNode);
    //treeNode.setExpanded(true);
    }
    rootNode.setExpanded(true);
    //create the tree view
    TreeView<String> treeView = new TreeView<>(rootNode);
    treeView.setMinHeight(600);
    //add everything to the tree pane
    treeBox.getChildren().addAll(new Label("File browser"), treeView);
    return treeBox;
}
Also used : Path(java.nio.file.Path) Insets(javafx.geometry.Insets) Label(javafx.scene.control.Label) TreeView(javafx.scene.control.TreeView) FilePathTreeItem(com.negativevr.media_library.storage.FilePathTreeItem) ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image) VBox(javafx.scene.layout.VBox)

Aggregations

FilePathTreeItem (com.negativevr.media_library.storage.FilePathTreeItem)2 Path (java.nio.file.Path)2 Insets (javafx.geometry.Insets)1 Label (javafx.scene.control.Label)1 TreeView (javafx.scene.control.TreeView)1 Image (javafx.scene.image.Image)1 ImageView (javafx.scene.image.ImageView)1 VBox (javafx.scene.layout.VBox)1