Example usage for javafx.scene.layout Priority ALWAYS

List of usage examples for javafx.scene.layout Priority ALWAYS

Introduction

In this page you can find the example usage for javafx.scene.layout Priority ALWAYS.

Prototype

Priority ALWAYS

To view the source code for javafx.scene.layout Priority ALWAYS.

Click Source Link

Document

Layout area will always try to grow (or shrink), sharing the increase (or decrease) in space with other layout areas that have a grow (or shrink) of ALWAYS.

Usage

From source file:Main.java

WizardPage(String title) {
    getChildren().add(/*from  w  w w .ja  v a  2s .  c  o  m*/
            LabelBuilder.create().text(title).style("-fx-font-weight: bold; -fx-padding: 0 0 5 0;").build());
    setId(title);
    setSpacing(5);
    setStyle(
            "-fx-padding:10; -fx-background-color: honeydew; -fx-border-color: derive(honeydew, -30%); -fx-border-width: 3;");

    Region spring = new Region();
    VBox.setVgrow(spring, Priority.ALWAYS);
    getChildren().addAll(getContent(), spring, getButtons());

    priorButton.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent actionEvent) {
            priorPage();
        }
    });
    nextButton.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent actionEvent) {
            nextPage();
        }
    });
    cancelButton.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent actionEvent) {
            getWizard().cancel();
        }
    });
    finishButton.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent actionEvent) {
            getWizard().finish();
        }
    });
}

From source file:Main.java

private void createControls(GridPane grid) {
    final Label volumeLabel = new Label("Volume");
    final Label rateLabel = new Label("Rate");
    final Label balanceLabel = new Label("Balance");

    GridPane.setHalignment(volumeLabel, HPos.CENTER);
    GridPane.setHalignment(rateLabel, HPos.CENTER);
    GridPane.setHalignment(balanceLabel, HPos.CENTER);

    volumeSlider = new Slider(0.0, 1.0, 1.0);
    rateSlider = new Slider(0.25, 2.5, 1.0);
    balanceSlider = new Slider(-1.0, 1.0, 0.0);

    GridPane.setHgrow(volumeSlider, Priority.ALWAYS);
    GridPane.setHgrow(rateSlider, Priority.ALWAYS);
    GridPane.setHgrow(balanceSlider, Priority.ALWAYS);

    grid.add(volumeLabel, 0, 2);/*from w  w  w. j av  a2 s.  c o  m*/
    grid.add(volumeSlider, 0, 3);
    grid.add(rateLabel, 1, 2);
    grid.add(rateSlider, 1, 3);
    grid.add(balanceLabel, 2, 2);
    grid.add(balanceSlider, 2, 3);
}

From source file:org.jacp.demo.components.ContactChartViewComponent.java

private GridPane createRoot() {
    final GridPane myRoot = new GridPane();
    myRoot.getStyleClass().addAll("dark", "bar-chart-root");
    myRoot.setAlignment(Pos.CENTER);//w  w  w .  ja va 2s  .  c o m
    GridPane.setHgrow(myRoot, Priority.ALWAYS);
    GridPane.setVgrow(myRoot, Priority.ALWAYS);
    return myRoot;
}

From source file:org.pdfsam.merge.MergeModule.java

@Override
protected Pane getInnerPanel() {
    VBox pane = new VBox();
    pane.setAlignment(Pos.TOP_CENTER);//from  ww w.  ja va2s. c  om
    VBox.setVgrow(selectionPane, Priority.ALWAYS);

    pane.getChildren().addAll(selectionPane,
            titledPane(DefaultI18nContext.getInstance().i18n("Merge settings"), mergeOptions),
            titledPane(DefaultI18nContext.getInstance().i18n("Destination file"), destinationPane));
    return pane;
}

From source file:poe.trade.assist.Main.java

@Override
public void start(Stage stage) {
    //      try {
    //         fh = new FileHandler("D:\\MxDownload\\POE\\poe.trade.assist\\assist.log");
    //      } catch (IOException e) {
    //         e.printStackTrace();
    //      }/*from w w  w.ja  va  2s.c o  m*/
    //      logger.addHandler(fh);
    //      SimpleFormatter formatter = new SimpleFormatter();
    //      fh.setFormatter(formatter);
    //      logger.info("Init application.");

    BorderPane root = new BorderPane();

    config = Config.load();
    config.get(Config.SEARCH_FILE).ifPresent(searchFileTextField::setText);

    searchFileTextField.setPromptText("Search CSV File URL or blank");
    searchFileTextField.setTooltip(new Tooltip(
            "Any url to a valid poe.trade.assist CSV search file. Can be googlespreadsheet URL. If left blank, will load search.csv file instead"));
    searchFileTextField.setMinWidth(330);
    HBox.setHgrow(searchFileTextField, Priority.ALWAYS);

    List<Search> searchList = loadSearchListFromFile();

    AutoSearchService autoSearchService = new AutoSearchService(
            Boolean.parseBoolean(config.get(Config.AUTO_ENABLE).get()),
            Float.parseFloat(config.get(Config.SEARCH_MINUTES).get()));
    searchPane = new SearchPane(searchList);
    resultPane = new ResultPane(searchFileTextField, this);

    autoSearchService.searchesProperty().bind(searchPane.dataProperty());

    EventHandler<ActionEvent> reloadAction = e -> {
        System.out.println("Loading search file: " + searchFileTextField.getText());
        List<Search> newList = loadSearchListFromFile();
        searchPane.dataProperty().clear();
        searchPane.dataProperty().addAll(newList);
        autoSearchService.restart();
        if (searchPane.dataProperty().size() > 0)
            searchPane.searchTable.getSelectionModel().select(0);
    };

    searchFileTextField.setOnAction(reloadAction);
    resultPane.loadButton.setOnAction(reloadAction);
    resultPane.defaultButton.setOnAction(e -> {
        searchFileTextField.setText(DEFAULT_SEARCH_CSV_FILE);
        resultPane.loadButton.fire();
    });

    resultPane.runNowButton.setOnAction(e -> autoSearchService.restart());
    //        autoSearchService.minsToSleepProperty().bind(resultPane.noOfMinsTextField.textProperty());
    setupResultPaneBinding(searchPane, resultPane, autoSearchService);
    if (searchList.size() > 0)
        searchPane.searchTable.getSelectionModel().select(0);

    stage.setOnCloseRequest(we -> {
        saveSearchList(searchPane);
        config.setProperty(Config.SEARCH_FILE, searchFileTextField.getText());
        config.setProperty(Config.SOUND_FILE, resultPane.soundButton.getUserData().toString());
        config.save();
    });

    config.get(Config.SOUND_FILE).ifPresent(resultPane.soundButton::setUserData);

    autoSearchService.restart();

    //        HBox container = new HBox(5, searchPane, resultPane);
    SplitPane container = new SplitPane(searchPane, resultPane);
    container.setDividerPositions(0.1);
    HBox.setHgrow(searchPane, Priority.ALWAYS);
    HBox.setHgrow(resultPane, Priority.ALWAYS);
    container.setMaxWidth(Double.MAX_VALUE);
    //        root.getChildren().addAll(container);
    root.setCenter(container);
    Scene scene = new Scene(root);
    stage.getIcons().add(new Image("/48px-Durian.png"));
    stage.titleProperty().bind(new SimpleStringProperty("poe.trade.assist v5 (Durian) - ")
            .concat(autoSearchService.messageProperty()));
    //        stage.setWidth(1200);
    //        stage.setHeight(550);
    stage.setMaximized(true);
    stage.setScene(scene);
    stage.show();
    searchPane.searchTable.requestFocus();
}

From source file:org.pdfsam.ui.selection.single.SingleSelectionPane.java

public SingleSelectionPane(String ownerModule) {
    super(5);/*from  w  ww.  j  a v  a 2  s . com*/
    this.ownerModule = defaultString(ownerModule);
    field.enforceValidation(true, false);
    field.getTextField().setPromptText(
            DefaultI18nContext.getInstance().i18n("Select or drag and drop the PDF you want to split"));
    encryptionIndicator = new LoadingStatusIndicator(this, this.ownerModule);
    field.setGraphic(encryptionIndicator);
    HBox.setMargin(encryptionIndicator, new Insets(0, 0, 0, 2));
    HBox topRow = new HBox(5, field);
    HBox.setHgrow(field, Priority.ALWAYS);
    topRow.setAlignment(Pos.CENTER_LEFT);
    getChildren().addAll(topRow, pages);
    field.getTextField().setEditable(false);
    field.getTextField().validProperty().addListener((o, oldVal, newVal) -> {
        if (newVal == ValidationState.VALID) {
            if (descriptor != null) {
                descriptor.invalidate();
            }
            PdfLoadRequestEvent loadEvent = new PdfLoadRequestEvent(getOwnerModule());
            descriptor = PdfDocumentDescriptor
                    .newDescriptorNoPassword(new File(field.getTextField().getText()));
            descriptor.loadedProperty().addListener(new WeakChangeListener<>(onDescriptorLoaded));
            field.getTextField().getContextMenu().getItems().forEach(i -> i.setDisable(false));
            loadEvent.add(descriptor);
            eventStudio().broadcast(loadEvent);
        }
    });
    initContextMenu();
}

From source file:at.ac.tuwien.qse.sepm.gui.controller.impl.HighlightsViewControllerImpl.java

@FXML
private void initialize() {
    tagImageTiles.addAll(Arrays.asList(tag1, tag2, tag3, tag4, tag5));

    wikipediaInfoPane = new WikipediaInfoPane(wikipediaService);
    HBox.setHgrow(wikipediaInfoPane, Priority.ALWAYS);
    wikipediaInfoPaneContainer.getChildren().addAll(wikipediaInfoPane, wikipediaPlaceholder);

    wikipediaPlaceholder.setGlyphSize(80);
    wikipediaInfoPaneContainer.setAlignment(Pos.CENTER);
    wikipediaPlaceholder.getStyleClass().addAll("wikipedia-placeholder");
    wikipediaInfoPane.managedProperty().bind(wikipediaInfoPane.visibleProperty());
    wikipediaPlaceholder.visibleProperty().bind(wikipediaInfoPane.visibleProperty().not());
    wikipediaInfoPane.setVisible(false);

    journeyPlaceList.setOnJourneySelected(this::handleJourneySelected);
    journeyPlaceList.setOnPlaceSelected(this::handlePlaceSelected);
    journeyPlaceList.setOnAllPlacesSelected(this::handleAllPlacesSelected);

    // give each row and each column in the grid the same size
    ColumnConstraints column1 = new ColumnConstraints();
    column1.setPercentWidth(25);//from  w w w  .  jav a 2 s  .  co m
    ColumnConstraints column2 = new ColumnConstraints();
    column2.setPercentWidth(25);
    ColumnConstraints column3 = new ColumnConstraints();
    column3.setPercentWidth(25);
    ColumnConstraints column4 = new ColumnConstraints();
    column4.setPercentWidth(25);
    gridPane.getColumnConstraints().addAll(column1, column2, column3, column4);

    RowConstraints row1 = new RowConstraints();
    row1.setPercentHeight(33);
    RowConstraints row2 = new RowConstraints();
    row2.setPercentHeight(33);
    RowConstraints row3 = new RowConstraints();
    row3.setPercentHeight(33);
    gridPane.getRowConstraints().addAll(row1, row2, row3);

    clusterService.subscribeJourneyChanged((journey) -> scheduler
            .schedule(() -> Platform.runLater(this::reloadJourneys), 2, TimeUnit.SECONDS));

    clusterService.subscribePlaceChanged(
            (place) -> scheduler.schedule(() -> Platform.runLater(this::reloadJourneys), 2, TimeUnit.SECONDS));

    photoService.subscribeCreate(addBuffer::add);

    reloadJourneys();
}

From source file:uk.co.everywheremusic.viewcontroller.SetupScene.java

private void startSetupWindow(Stage primaryStage) {
    try {/*from  www .  ja  va  2s.com*/
        installFolder = new File(".").getCanonicalPath() + Globals.INSTALL_EXT;
    } catch (IOException ex) {
        Logger.getLogger(SetupScene.class.getName()).log(Level.SEVERE, null, ex);
        installFolder = System.getProperty("user.dir") + Globals.INSTALL_EXT;
    }

    primaryStage.setTitle(Globals.APP_NAME);

    grid = new GridPane();
    grid.setAlignment(Pos.CENTER);
    grid.setHgap(10);
    grid.setVgap(10);
    grid.setPadding(new Insets(25, 25, 25, 25));

    column1 = new ColumnConstraints(100, 100, Double.MAX_VALUE);
    column1.setHgrow(Priority.ALWAYS);
    column2 = new ColumnConstraints(100, 100, Double.MAX_VALUE);
    column2.setHgrow(Priority.ALWAYS);
    column3 = new ColumnConstraints(100, 100, Double.MAX_VALUE);
    column3.setHgrow(Priority.ALWAYS);
    column4 = new ColumnConstraints(100, 100, Double.MAX_VALUE);
    column4.setHgrow(Priority.ALWAYS);
    grid.getColumnConstraints().addAll(column1, column2, column3, column4);

    sceneTitle = new Label(Globals.SETUP_FRAME_TITLE);
    sceneTitle.setId(Globals.CSS_TITLE_ID);
    sceneTitle.setPrefWidth(Double.MAX_VALUE);
    sceneTitle.setAlignment(Pos.CENTER);

    ImageView imageView = null;
    try {

        imageView = new ImageView();
        String img = new File(Globals.IC_LOGO).toURI().toURL().toString();
        imgLogo = new Image(img);

        imageView.setImage(imgLogo);

    } catch (MalformedURLException ex) {
        Logger.getLogger(ServerScene.class.getName()).log(Level.SEVERE, null, ex);
    }

    GridPane titlePane = new GridPane();
    ColumnConstraints c1 = new ColumnConstraints(50);
    ColumnConstraints c2 = new ColumnConstraints(400);
    titlePane.getColumnConstraints().addAll(c1, c2);
    titlePane.add(imageView, 0, 0);
    titlePane.add(sceneTitle, 1, 0);
    titlePane.setAlignment(Pos.CENTER);
    grid.add(titlePane, 0, 0, 4, 1);

    lblFolder = new Label(Globals.SETUP_LBL_MUSIC_FOLDER);
    grid.add(lblFolder, 0, 2, 3, 1);

    txtFolder = new TextField();
    txtFolder.setText("/home/kyle/Music/Test music");
    grid.add(txtFolder, 0, 3, 3, 1);

    btnFolder = new Button(Globals.SETUP_BTN_MUSIC_FOLDER);
    btnFolder.setPrefWidth(Double.MAX_VALUE);
    grid.add(btnFolder, 3, 3);

    final DirectoryChooser dirChooser = new DirectoryChooser();

    btnFolder.setOnAction((ActionEvent event) -> {
        File dir = dirChooser.showDialog(primaryStage);
        if (dir != null) {
            txtFolder.setText(dir.getAbsolutePath());
        }
    });

    lblPassword = new Label("Choose a password:");
    grid.add(lblPassword, 0, 4, 2, 1);

    lblConfirmPassword = new Label("Confirm your password:");
    grid.add(lblConfirmPassword, 2, 4, 2, 1);

    txtPassword = new PasswordField();
    grid.add(txtPassword, 0, 5, 2, 1);

    txtConfirmPassword = new PasswordField();
    grid.add(txtConfirmPassword, 2, 5, 1, 1);

    textArea = new TextArea();
    textArea.setPrefHeight(Double.MAX_VALUE);
    textArea.setDisable(true);
    textArea.setWrapText(true);
    grid.add(textArea, 0, 7, 4, 2);

    StackPane progressPane = new StackPane();
    lblProgress = new Label(Globals.SETUP_LBL_PERCENT);
    lblProgress.setId(Globals.CSS_PROGBAR_LBL_ID);
    lblProgress.setVisible(false);
    progressBar = new ProgressBar(0);
    progressBar.setPrefWidth(Double.MAX_VALUE);
    progressBar.setVisible(false);
    progressPane.getChildren().addAll(progressBar, lblProgress);
    progressPane.setAlignment(Pos.CENTER_RIGHT);
    grid.add(progressPane, 0, 11, 3, 1);

    StackPane buttonPane = new StackPane();
    btnInstall = new Button(Globals.SETUP_BTN_INSTALL);
    btnInstall.setPrefWidth(Double.MAX_VALUE);
    btnDone = new Button(Globals.SETUP_BTN_DONE);
    btnDone.setPrefWidth(Double.MAX_VALUE);
    btnDone.setVisible(false);
    buttonPane.getChildren().addAll(btnInstall, btnDone);
    grid.add(buttonPane, 3, 11);

    btnInstall.setOnAction((ActionEvent event) -> {

        boolean valid = validateForm();
        if (valid) {

            lblFolder.setDisable(true);
            txtFolder.setDisable(true);
            btnFolder.setDisable(true);
            lblPassword.setDisable(true);
            txtPassword.setDisable(true);
            lblConfirmPassword.setDisable(true);
            txtConfirmPassword.setDisable(true);

            textArea.setDisable(false);
            lblProgress.setVisible(true);
            progressBar.setVisible(true);
            btnInstall.setDisable(true);

            musicFolder = txtFolder.getText();
            password = txtPassword.getText();

            setupWorker = createSetupWorker();
            progressBar.progressProperty().unbind();
            progressBar.progressProperty().bind(setupWorker.progressProperty());

            setupWorker.messageProperty().addListener(
                    (ObservableValue<? extends String> observable, String oldValue, String newValue) -> {
                        String[] values = newValue.split("\\|");
                        lblProgress.setText(values[0] + "%");
                        textArea.appendText(values[1] + "\n");

                        if (values[1].equals(Globals.SETUP_MSG_DONE)) {
                            btnInstall.setVisible(false);
                            btnDone.setVisible(true);
                        }

                    });

            new Thread(setupWorker).start();

        }
    });

    btnDone.setOnAction((ActionEvent event) -> {
        primaryStage.hide();
        new ServerScene(installFolder, musicFolder).showWindow(new Stage());
    });

    try {
        String imgUrl = new File(Globals.IC_LOGO).toURI().toURL().toString();
        javafx.scene.image.Image i = new javafx.scene.image.Image(imgUrl);
        primaryStage.getIcons().add(i);
    } catch (MalformedURLException ex) {
        Logger.getLogger(ServerScene.class.getName()).log(Level.SEVERE, null, ex);
    }

    scene = new Scene(grid, 600, 400);
    primaryStage.setScene(scene);

    scene.getStylesheets().add(SetupScene.class.getResource(Globals.CSS_FILE).toExternalForm());
    //  grid.setGridLinesVisible(true);
    primaryStage.show();
}

From source file:org.sleuthkit.autopsy.imagegallery.gui.navpanel.NavPanel.java

@FXML
void initialize() {
    assert hashTab != null : "fx:id=\"hashTab\" was not injected: check your FXML file 'NavPanel.fxml'.";
    assert hashTree != null : "fx:id=\"hashTree\" was not injected: check your FXML file 'NavPanel.fxml'.";
    assert navTab != null : "fx:id=\"navTab\" was not injected: check your FXML file 'NavPanel.fxml'.";
    assert navTabPane != null : "fx:id=\"navTabPane\" was not injected: check your FXML file 'NavPanel.fxml'.";
    assert navTree != null : "fx:id=\"navTree\" was not injected: check your FXML file 'NavPanel.fxml'.";
    assert sortByBox != null : "fx:id=\"sortByBox\" was not injected: check your FXML file 'NavPanel.fxml'.";

    VBox.setVgrow(this, Priority.ALWAYS);

    navTree.setShowRoot(false);//from  ww w  .j a  v a  2  s  .c  o  m
    hashTree.setShowRoot(false);

    navTree.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
    hashTree.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);

    sortByBox.setCellFactory((ListView<TreeNodeComparators> p) -> new TreeNodeComparators.ComparatorListCell());

    sortByBox.setButtonCell(new TreeNodeComparators.ComparatorListCell());
    sortByBox.setItems(
            FXCollections.observableArrayList(FXCollections.observableArrayList(TreeNodeComparators.values())));
    sortByBox.getSelectionModel().select(TreeNodeComparators.HIT_COUNT);
    sortByBox.getSelectionModel().selectedItemProperty().addListener((Observable o) -> {
        resortHashTree();
    });

    navTree.setCellFactory((TreeView<TreeNode> p) -> new GroupTreeCell());

    hashTree.setCellFactory((TreeView<TreeNode> p) -> new GroupTreeCell());

    activeTreeProperty.addListener((Observable o) -> {
        updateControllersGroup();
        activeTreeProperty.get().getSelectionModel().selectedItemProperty().addListener((Observable o1) -> {
            updateControllersGroup();
        });
    });

    this.activeTreeProperty.set(navTree);

    navTabPane.getSelectionModel().selectedItemProperty()
            .addListener((ObservableValue<? extends Tab> ov, Tab t, Tab t1) -> {
                if (t1 == hashTab) {
                    activeTreeProperty.set(hashTree);
                } else if (t1 == navTab) {
                    activeTreeProperty.set(navTree);
                }
            });

    initHashTree();
    initNavTree();

    controller.getGroupManager().getAnalyzedGroups()
            .addListener((ListChangeListener.Change<? extends DrawableGroup> change) -> {
                boolean wasPermuted = false;
                while (change.next()) {
                    for (DrawableGroup g : change.getAddedSubList()) {
                        insertIntoNavTree(g);
                        if (g.getHashSetHitsCount() > 0) {
                            insertIntoHashTree(g);
                        }
                    }
                    for (DrawableGroup g : change.getRemoved()) {
                        removeFromNavTree(g);
                        removeFromHashTree(g);
                    }
                    if (change.wasPermutated()) {
                        // Handle this afterward
                        wasPermuted = true;
                    }
                }

                if (wasPermuted) {
                    rebuildTrees();

                }
            });

    for (DrawableGroup g : controller.getGroupManager().getAnalyzedGroups()) {
        insertIntoNavTree(g);
        if (g.getHashSetHitsCount() > 0) {
            insertIntoHashTree(g);
        }
    }

    controller.viewState().addListener((ObservableValue<? extends GroupViewState> observable,
            GroupViewState oldValue, GroupViewState newValue) -> {
        if (newValue != null && newValue.getGroup() != null) {
            setFocusedGroup(newValue.getGroup());
        }
    });
}

From source file:org.sleuthkit.autopsy.imageanalyzer.gui.navpanel.NavPanel.java

@FXML
void initialize() {
    assert hashTab != null : "fx:id=\"hashTab\" was not injected: check your FXML file 'NavPanel.fxml'.";
    assert hashTree != null : "fx:id=\"hashTree\" was not injected: check your FXML file 'NavPanel.fxml'.";
    assert navTab != null : "fx:id=\"navTab\" was not injected: check your FXML file 'NavPanel.fxml'.";
    assert navTabPane != null : "fx:id=\"navTabPane\" was not injected: check your FXML file 'NavPanel.fxml'.";
    assert navTree != null : "fx:id=\"navTree\" was not injected: check your FXML file 'NavPanel.fxml'.";
    assert sortByBox != null : "fx:id=\"sortByBox\" was not injected: check your FXML file 'NavPanel.fxml'.";

    VBox.setVgrow(this, Priority.ALWAYS);

    navTree.setShowRoot(false);//w  w  w . j  a  v  a 2s .c o  m
    hashTree.setShowRoot(false);

    navTree.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
    hashTree.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);

    sortByBox.setCellFactory((ListView<TreeNodeComparators> p) -> new TreeNodeComparators.ComparatorListCell());

    sortByBox.setButtonCell(new TreeNodeComparators.ComparatorListCell());
    sortByBox.setItems(
            FXCollections.observableArrayList(FXCollections.observableArrayList(TreeNodeComparators.values())));
    sortByBox.getSelectionModel().select(TreeNodeComparators.HIT_COUNT);
    sortByBox.getSelectionModel().selectedItemProperty().addListener((Observable o) -> {
        resortHashTree();
    });

    navTree.setCellFactory((TreeView<TreeNode> p) -> new GroupTreeCell());

    hashTree.setCellFactory((TreeView<TreeNode> p) -> new GroupTreeCell());

    activeTreeProperty.addListener((Observable o) -> {
        updateControllersGroup();
        activeTreeProperty.get().getSelectionModel().selectedItemProperty().addListener((Observable o1) -> {
            updateControllersGroup();
        });
    });

    this.activeTreeProperty.set(navTree);

    navTabPane.getSelectionModel().selectedItemProperty()
            .addListener((ObservableValue<? extends Tab> ov, Tab t, Tab t1) -> {
                if (t1 == hashTab) {
                    activeTreeProperty.set(hashTree);
                } else if (t1 == navTab) {
                    activeTreeProperty.set(navTree);
                }
            });

    initHashTree();
    initNavTree();

    controller.getGroupManager().getAnalyzedGroups()
            .addListener((ListChangeListener.Change<? extends DrawableGroup> change) -> {
                while (change.next()) {
                    for (DrawableGroup g : change.getAddedSubList()) {
                        insertIntoNavTree(g);
                        if (g.getFilesWithHashSetHitsCount() > 0) {
                            insertIntoHashTree(g);
                        }
                    }
                    for (DrawableGroup g : change.getRemoved()) {
                        removeFromNavTree(g);
                        removeFromHashTree(g);
                    }
                }
            });

    for (DrawableGroup g : controller.getGroupManager().getAnalyzedGroups()) {
        insertIntoNavTree(g);
        if (g.getFilesWithHashSetHitsCount() > 0) {
            insertIntoHashTree(g);
        }
    }

    controller.viewState().addListener((ObservableValue<? extends GroupViewState> observable,
            GroupViewState oldValue, GroupViewState newValue) -> {
        if (newValue != null && newValue.getGroup() != null) {
            setFocusedGroup(newValue.getGroup());
        }
    });
}