Example usage for javafx.scene.text TextFlow getChildren

List of usage examples for javafx.scene.text TextFlow getChildren

Introduction

In this page you can find the example usage for javafx.scene.text TextFlow getChildren.

Prototype

@Override
public ObservableList<Node> getChildren() 

Source Link

Usage

From source file:com.github.drbookings.LocalDates.java

public static TextFlow getDateText(final LocalDate date) {
    final TextFlow tf = new TextFlow();
    final Text t0 = new Text(getDateString(date));
    tf.getChildren().addAll(t0);
    return tf;/*from   w  w w . j  a va  2  s  .c  om*/
}

From source file:com.github.drbookings.LocalDates.java

public static TextFlow getYearText(final LocalDate date) {
    final TextFlow tf = new TextFlow();
    final Text t0 = new Text(getYearString(date));
    t0.getStyleClass().add("center-text");
    tf.getChildren().addAll(t0);
    return tf;//  w  w  w.j av a 2 s .c o  m
}

From source file:com.github.drbookings.ui.controller.UpcomingController.java

private static void addGeneralSummary(final LocalDate date, final VBox box,
        final List<CheckInOutDetails> checkInNotes) {
    final Text t0 = new Text(getDateString(date));
    final Text t1 = new Text(", there " + (checkInNotes.size() > 1 ? " are " : "is "));
    t0.getStyleClass().add("emphasis");
    final TextFlow tf = new TextFlow();
    tf.getChildren().addAll(t0, t1);
    box.getChildren().add(tf);//from  w w  w. j  a  v  a2s.  com
}

From source file:com.github.drbookings.ui.controller.UpcomingController.java

private static void addCleanings(final LocalDate date, final VBox box,
        final Collection<CleaningEntry> upcomingBookings) {

    for (final CleaningEntry c : upcomingBookings) {
        final TextFlow tf = new TextFlow();
        final Text t0 = new Text("Room " + c.getRoom() + ": ");
        t0.getStyleClass().add("emphasis");
        final Text t1 = new Text(c.getName());
        tf.getChildren().addAll(t0, t1);
        box.getChildren().add(tf);//ww  w  .  ja v a  2  s .c om
    }

}

From source file:com.github.drbookings.ui.controller.BookingDetailsController.java

private static void addDates(final HBox content, final BookingBean be) {
    final TextFlow checkIn = LocalDates.getDateText(be.getCheckIn());
    final TextFlow checkOut = LocalDates.getDateText(be.getCheckOut());
    final TextFlow year = LocalDates.getYearText(be.getCheckOut());
    final TextFlow tf = new TextFlow();
    tf.getChildren().addAll(checkIn, new Text("\n"), checkOut, new Text("\n"), year);
    // tf.getChildren().addAll(checkIn, new Text("  "), checkOut);
    // HBox.setHgrow(tf, Priority.SOMETIMES);
    content.getChildren().add(tf);/*from  w w  w  .j a  va2s.c om*/

}

From source file:com.github.drbookings.ui.controller.UpcomingController.java

private static void addCheckOutNotes(final LocalDate date, final VBox box,
        final List<CheckInOutDetails> checkOutNotes) {
    if (checkOutNotes.size() > 0) {
        for (final CheckInOutDetails next : checkOutNotes) {
            final TextFlow tf = new TextFlow();
            final Text t0 = new Text("Room " + next.room);
            t0.getStyleClass().add("emphasis");
            final Text t1 = new Text(" (" + next.bookingOrigin + ")");
            tf.getChildren().addAll(t0, t1);
            if (!StringUtils.isBlank(next.notes)) {
                final Text t2 = new Text(": " + next.notes);
                t2.getStyleClass().add("guest-message");
                tf.getChildren().add(t2);
            }//  w w  w  . ja v a  2 s  .com
            box.getChildren().add(tf);
        }
        box.getChildren().add(new Separator());
    }
}

From source file:com.github.drbookings.ui.controller.UpcomingController.java

private static void addCheckInNotes(final LocalDate date, final VBox box,
        final List<CheckInOutDetails> checkInNotes) {

    if (checkInNotes.size() > 0) {
        for (final CheckInOutDetails next : checkInNotes) {
            final TextFlow tf = new TextFlow();
            final Text t0 = new Text("Room " + next.room);
            t0.getStyleClass().add("emphasis");
            final Text t1 = new Text(" (" + next.bookingOrigin + ")");
            tf.getChildren().addAll(t0, t1);
            if (!StringUtils.isBlank(next.notes)) {
                final Text t2 = new Text(": " + next.notes);
                t2.getStyleClass().add("guest-message");
                tf.getChildren().add(t2);
            }//  www. j  ava 2  s.co  m
            box.getChildren().add(tf);
        }
        box.getChildren().add(new Separator());
    }
}

From source file:com.github.drbookings.ui.controller.UpcomingController.java

private static void addCheckOutSummary(final LocalDate date, final VBox box,
        final List<CheckInOutDetails> checkOutNotes) {
    final TextFlow tf = new TextFlow();

    if (checkOutNotes.size() > 0) {
        final Text t0;
        t0 = new Text("");
        final Text t1 = new Text(checkOutNotes.size() + " ");
        t1.getStyleClass().add("emphasis");
        final Text t2;
        if (checkOutNotes.size() > 1) {
            t2 = new Text("check-outs,");
        } else {//from w  ww.j a  v a 2 s .  c om
            t2 = new Text("check-out,");
        }
        t2.getStyleClass().add("emphasis");

        tf.getChildren().addAll(t0, t1, t2);
    }
    if (checkOutNotes.isEmpty()) {
        // tf.getChildren().add(new Text("no check-outs,"));
    }
    box.getChildren().add(tf);
}

From source file:com.github.drbookings.ui.controller.UpcomingController.java

private static void addCleaningSummary(final LocalDate date, final VBox box,
        final Collection<CleaningEntry> upcomingBookings) {
    final TextFlow tf = new TextFlow();
    if (upcomingBookings.isEmpty()) {
        // final Text t0 = new Text("and no cleaning.");
        // tf.getChildren().add(t0);
    } else {//from w  w w  .jav  a 2  s  .  c  om
        final Text t0 = new Text("and ");
        final Text t1 = new Text(upcomingBookings.size() + " ");
        t1.getStyleClass().add("emphasis");
        final Text t2 = new Text(" cleaning" + (upcomingBookings.size() > 1 ? "s." : "."));
        t2.getStyleClass().add("emphasis");
        tf.getChildren().addAll(t0, t1, t2);
    }
    box.getChildren().add(tf);

}

From source file:com.github.drbookings.ui.controller.UpcomingController.java

private static void addCheckInSummary(final LocalDate date, final VBox box,
        final List<CheckInOutDetails> checkInNotes) {
    final TextFlow tf = new TextFlow();
    if (checkInNotes.size() > 0) {
        final Text t1 = new Text(checkInNotes.size() + " ");
        t1.getStyleClass().add("emphasis");
        t1.getStyleClass().add("copyable-label");
        final Text t2;
        if (checkInNotes.size() > 1) {
            t2 = new Text("check-ins,");
        } else {/* w ww .  ja  v  a  2s  . co  m*/
            t2 = new Text("check-in,");
        }
        t2.getStyleClass().add("emphasis");
        tf.getStyleClass().add("copyable-label");
        tf.getChildren().addAll(t1, t2);
    }

    if (checkInNotes.isEmpty()) {
        // tf.getChildren().add(new Text("no check-ins,"));
    }
    box.getChildren().add(tf);
}