Example usage for javafx.scene.layout VBox setOnMouseReleased

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

Introduction

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

Prototype

public final void setOnMouseReleased(EventHandler<? super MouseEvent> value) 

Source Link

Usage

From source file:mesclasses.view.TimetableController.java

private VBox createEvent(Cours theCours) {
    VBox event = new VBox();
    CssUtil.addClass(event, "event");
    CssUtil.addClass(event, getCSS(theCours));
    String periodicite = theCours.getWeek().equals(config.getProperty(Constants.CONF_WEEK_DEFAULT)) ? ""
            : theCours.getWeek();/*w w  w .j  av  a 2  s.c om*/
    String salle = StringUtils.isNotBlank(theCours.getRoom()) ? "salle " + theCours.getRoom() : "";
    Label periodiciteAndSalle = new Label((periodicite + " " + salle).trim());
    bindWidth(periodiciteAndSalle, event, 1);
    Label classe = new Label(theCours.getClasse().getName());
    CssUtil.addClass(classe, "event-classe");
    bindWidth(classe, event, 1);

    //horaires
    HBox horaires = new HBox();
    CssUtil.addClass(horaires, "horaires");
    Label start = new Label(" " + NodeUtil.getStartTime(theCours));
    CssUtil.addClass(start, "start");
    Label end = new Label(NodeUtil.getEndTime(theCours) + " ");
    CssUtil.addClass(end, "end");
    horaires.getChildren().add(start);
    horaires.getChildren().add(end);
    bindWidth(horaires, event, 1);
    bindWidth(start, horaires, 2);
    bindWidth(end, horaires, 2);

    event.getChildren().add(periodiciteAndSalle);
    bindHeight(periodiciteAndSalle, event, 3);
    event.getChildren().add(classe);
    bindHeight(classe, event, 3);
    event.getChildren().add(horaires);
    bindHeight(horaires, event, 3);
    event.setOnMouseReleased((e) -> {
        handleEditCours(theCours);
    });
    theCours.setEvent(event);
    return event;
}