Example usage for javafx.scene.layout HBox getStyleClass

List of usage examples for javafx.scene.layout HBox getStyleClass

Introduction

In this page you can find the example usage for javafx.scene.layout HBox getStyleClass.

Prototype

@Override
    public final ObservableList<String> getStyleClass() 

Source Link

Usage

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

private static void addRow0(final Pane content, final BookingBean be) {
    final HBox box = new HBox();
    final HBox boxName = new HBox();
    final HBox boxDates = new HBox();
    final HBox boxNights = new HBox();
    box.setAlignment(Pos.CENTER);/*from w  ww. j  a va2s . co  m*/
    boxName.getStyleClass().add("first-line");
    boxDates.getStyleClass().add("first-line");
    boxNights.getStyleClass().add("first-line");
    boxName.setPadding(boxPadding);
    boxDates.setPadding(boxPadding);
    boxNights.setPadding(boxPadding);
    boxName.setAlignment(Pos.CENTER);
    boxDates.setAlignment(Pos.CENTER);
    boxNights.setAlignment(Pos.CENTER);
    HBox.setHgrow(boxName, Priority.ALWAYS);
    HBox.setHgrow(boxDates, Priority.ALWAYS);
    HBox.setHgrow(boxNights, Priority.ALWAYS);
    addName(boxName, be);
    // box.getChildren().add(new Separator(Orientation.VERTICAL));
    addDates(boxDates, be);
    // box.getChildren().add(new Separator(Orientation.VERTICAL));
    addNights(boxNights, be);
    box.getChildren().addAll(boxName, boxDates, boxNights);
    box.getStyleClass().add(Styles.getBackgroundStyleSource(be.getBookingOrigin().getName()));
    content.getChildren().add(box);

}

From source file:org.pdfsam.ui.module.ProgressPane.java

public ProgressPane() {
    this.getStyleClass().add("progress-pane");
    this.statusLabel.getStyleClass().add("progress-status");
    this.failed.setVisible(false);
    this.open.setVisible(false);
    this.bar.getStyleClass().add("pdfsam-footer-bar");
    StackPane buttons = new StackPane(failed, open);
    HBox progressStatusBox = new HBox(statusLabel, buttons);
    progressStatusBox.getStyleClass().add("progress-status-pane");
    HBox.setHgrow(statusLabel, Priority.ALWAYS);
    statusLabel.setMaxWidth(Double.MAX_VALUE);
    getChildren().addAll(progressStatusBox, bar);
    eventStudio().addAnnotatedListeners(this);
}

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

private static void addRow4(final Pane content, final BookingBean be) {
    final HBox box = new HBox();
    box.setPadding(new Insets(4));
    box.setAlignment(Pos.CENTER_LEFT);//from w ww  .j  a va  2s . co m
    box.setFillHeight(true);
    final TextFlow tf = new TextFlow();
    final Text t0 = new Text("Net Earnings: \t");
    final Text netEarnings = new Text(String.format("%3.2f", be.getNetEarnings()));
    final Text t1 = new Text(" total \t");
    final Text netEarningsDay = new Text(String.format("%3.2f", be.getNetEarnings() / be.getNumberOfNights()));
    final Text t2 = new Text(" /night");
    tf.getChildren().addAll(t0, netEarnings, t1, netEarningsDay, t2);
    box.getChildren().addAll(tf);
    if (be.getNetEarnings() <= 0) {
        box.getStyleClass().addAll("warning", "warning-bg");
    }
    content.getChildren().add(box);

}

From source file:at.ac.tuwien.qse.sepm.gui.control.ImageTile.java

public ImageTile() {
    getStyleClass().add("imageTile");

    Group overlay = new Group();
    HBox overlayBox = new HBox();
    overlayBox.getStyleClass().add("hoverlay");
    overlayBox.getChildren().addAll(overLayIcon, name);
    overlay.getChildren().add(overlayBox);

    StackPane.setAlignment(overlay, Pos.CENTER);

    placeHolder.setGlyphSize(ImageSize.LARGE.pixels() * 0.6);

    setMinHeight(0);/*from  ww  w  .java2 s.c o  m*/
    setMinWidth(0);
    imageView.setPreserveRatio(false);

    getChildren().add(placeHolder);
    getChildren().add(imageView);
    getChildren().add(overlay);

    setAlignment(overlay, Pos.CENTER);

    setOnMouseEntered((event) -> {
        if (photos.size() > 0) {
            setCursor(Cursor.HAND);
        }
    });

    setOnMouseExited((event -> setCursor(Cursor.DEFAULT)));

    imageView.visibleProperty().bind(photosProperty.emptyProperty().not());
    overlay.visibleProperty().bind(photosProperty.emptyProperty().not().and(name.textProperty().isNotEmpty()));
    placeHolder.visibleProperty().bind(photosProperty.emptyProperty());

    heightProperty().addListener(this::handleSizeChange);
    widthProperty().addListener(this::handleSizeChange);
}

From source file:org.pdfsam.ui.news.NewsStage.java

@Inject
public NewsStage(Collection<Image> logos, StylesConfig styles,
        @Named("newsDisplayPolicy") PreferenceComboBox<KeyStringValueItem<String>> newsDisplayPolicy) {
    BorderPane containerPane = new BorderPane();
    browser.setId("newsBrowser");
    containerPane.getStyleClass().addAll(Style.CONTAINER.css());
    containerPane.getStyleClass().add("-pdfsam-news-pane");
    containerPane.setCenter(browser);//from   ww  w  . j a va  2s  . com
    HBox bottom = new HBox();

    ClosePane closePane = new ClosePane();
    HBox.setHgrow(closePane, Priority.ALWAYS);
    HBox comboPanel = new HBox(new Label(DefaultI18nContext.getInstance().i18n("Show this:")),
            newsDisplayPolicy);
    comboPanel.getStyleClass().addAll(Style.CONTAINER.css());
    comboPanel.getStyleClass().add("-pdfsam-news-pane-bottom");
    bottom.getChildren().addAll(comboPanel, closePane);
    containerPane.setBottom(bottom);
    Scene scene = new Scene(containerPane);
    scene.getStylesheets().addAll(styles.styles());
    scene.setOnKeyReleased(new HideOnEscapeHandler(this));
    setScene(scene);
    setTitle(DefaultI18nContext.getInstance().i18n("What's new"));
    getIcons().addAll(logos);
    setMaximized(false);
}

From source file:org.pdfsam.ui.dialog.OverwriteConfirmationDialog.java

@Inject
public OverwriteConfirmationDialog(StylesConfig styles) {
    initModality(Modality.WINDOW_MODAL);
    initStyle(StageStyle.UTILITY);/*from   w  ww .jav  a 2 s.  c om*/
    setResizable(false);
    BorderPane containerPane = new BorderPane();
    containerPane.getStyleClass().addAll(Style.CONTAINER.css());
    containerPane.getStyleClass().addAll("-pdfsam-dialog", "-pdfsam-warning-dialog");
    containerPane.setCenter(dialogContent);
    HBox buttons = new HBox(buildButton(DefaultI18nContext.getInstance().i18n("Overwrite"), true),
            buildButton(DefaultI18nContext.getInstance().i18n("Cancel"), false));
    buttons.getStyleClass().add("-pdfsam-dialog-buttons");
    containerPane.setBottom(buttons);
    Scene scene = new Scene(containerPane);
    scene.getStylesheets().addAll(styles.styles());
    scene.setOnKeyReleased(new HideOnEscapeHandler(this));
    setScene(scene);
}

From source file:com.panemu.tiwulfx.form.BaseControl.java

private PopupControl getPopup() {
    if (popup == null) {
        errorLabel = new Label();
        errorLabel.textProperty().bind(getErrorMessage());
        popup = new PopupControl();
        final HBox pnl = new HBox();
        pnl.getChildren().add(errorLabel);
        pnl.getStyleClass().add("error-popup");
        popup.setSkin(new Skin() {
            @Override/*from   w  ww  . j  a  v  a 2  s.  c  o m*/
            public Skinnable getSkinnable() {
                return BaseControl.this.getInputComponent();
            }

            @Override
            public Node getNode() {
                return pnl;
            }

            @Override
            public void dispose() {
            }
        });
        popup.setHideOnEscape(true);
    }
    return popup;
}

From source file:com.panemu.tiwulfx.form.BaseListControl.java

private PopupControl getPopup() {
    if (popup == null) {
        errorLabel = new Label();
        errorLabel.textProperty().bind(getErrorMessage());
        popup = new PopupControl();
        final HBox pnl = new HBox();
        pnl.getChildren().add(errorLabel);
        pnl.getStyleClass().add("error-popup");
        popup.setSkin(new Skin() {
            @Override//from w  w  w. j a v  a  2  s . c  o  m
            public Skinnable getSkinnable() {
                return null;//BaseTableFormControl.this.getInputComponent();
            }

            @Override
            public Node getNode() {
                return pnl;
            }

            @Override
            public void dispose() {
            }
        });
        popup.setHideOnEscape(true);
    }
    return popup;
}

From source file:com.panemu.tiwulfx.table.BaseColumn.java

PopupControl getPopup(R record) {
    String msg = mapInvalid.get(record);
    if (popup == null) {
        popup = new PopupControl();
        final HBox pnl = new HBox();
        pnl.getChildren().add(errorLabel);
        pnl.getStyleClass().add("error-popup");
        popup.setSkin(new Skin() {
            @Override/*from w  w w  . j  a va2  s  .c  om*/
            public Skinnable getSkinnable() {
                return null;
            }

            @Override
            public Node getNode() {
                return pnl;
            }

            @Override
            public void dispose() {
            }
        });
        popup.setHideOnEscape(true);
    }
    errorLabel.setText(msg);
    return popup;
}