Example usage for javafx.scene.layout VBox layoutXProperty

List of usage examples for javafx.scene.layout VBox layoutXProperty

Introduction

In this page you can find the example usage for javafx.scene.layout VBox layoutXProperty.

Prototype

public final DoubleProperty layoutXProperty() 

Source Link

Usage

From source file:mesclasses.view.TimetableController.java

private void handleSimultaneousEvents(Cours cours) {
    List<Cours> liste = getSimultaneousCours(cours);
    Pane pane = getPane(cours);//from   ww  w .ja va2  s . c  o m
    if (liste.size() == 1) {
        if (cours.getWeek().equals(config.getProperty(Constants.CONF_WEEK_P1_NAME))
                || cours.getWeek().equals(config.getProperty(Constants.CONF_WEEK_P2_NAME))) {
            bindWidth(cours.getEvent(), pane, 2);
        }
        if (cours.getWeek().equals(config.getProperty(Constants.CONF_WEEK_P2_NAME))) {
            cours.getEvent().layoutXProperty().bind(pane.layoutXProperty().add(pane.widthProperty().divide(2)));
        }
        return;
    }
    for (int i = 0; i < liste.size(); i++) {
        VBox event = liste.get(i).getEvent();
        event.layoutXProperty()
                .bind(pane.layoutXProperty().add(pane.widthProperty().multiply(i).divide(liste.size())));
        bindWidth(event, pane, liste.size());
    }

}

From source file:mesclasses.view.TimetableController.java

private void resizeEvent(Cours cours) {
    VBox event = cours.getEvent();
    Pane pane = getPane(cours);/*  ww  w . j  av  a 2  s .c  o m*/
    bindWidth(event, pane, 1);
    event.layoutXProperty().bind(pane.layoutXProperty());
    Double startTime = cours.getStartHour() + cours.getStartMin() / 60.0;
    Double endTime = cours.getEndHour() + cours.getEndMin() / 60.0;
    Double height = Math.max((endTime - startTime) * 60, 20);
    event.layoutYProperty().bind(pane.layoutYProperty().add(60 * (startTime - 7)));
    event.setMinHeight(height);
    event.setPrefHeight(height);
    event.setMaxHeight(height);
    handleSimultaneousEvents(cours);
}