Example usage for javafx.scene.layout RowConstraints setPercentHeight

List of usage examples for javafx.scene.layout RowConstraints setPercentHeight

Introduction

In this page you can find the example usage for javafx.scene.layout RowConstraints setPercentHeight.

Prototype

public final void setPercentHeight(double value) 

Source Link

Usage

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  ww w  . j  a va 2 s.c o  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();
}