List of usage examples for javafx.scene.layout Pane layoutXProperty
public final DoubleProperty layoutXProperty()
From source file:mesclasses.view.TimetableController.java
private void resizeEvent(Cours cours) { VBox event = cours.getEvent();//from ww w .ja va2s. co m Pane pane = getPane(cours); 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); }
From source file:mesclasses.view.TimetableController.java
private void handleSimultaneousEvents(Cours cours) { List<Cours> liste = getSimultaneousCours(cours); Pane pane = getPane(cours); 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); }// w w w . j av a 2 s. c om 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()); } }