Example usage for javafx.scene.layout StackPane StackPane

List of usage examples for javafx.scene.layout StackPane StackPane

Introduction

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

Prototype

public StackPane(Node... children) 

Source Link

Document

Creates a StackPane layout with default CENTER alignment.

Usage

From source file:net.thirdy.blackmarket.controls.ModSelectionPane.java

public ModSelectionPane() {
    setHgap(5.0);/*from   w w  w . j  av  a  2s  .  c  om*/
    setMaxHeight(Double.MAX_VALUE);
    setMinHeight(560);
    setAlignment(Pos.CENTER);
    setupModListView();
    accept(Collections.emptyList());
    setupModMappingTable();
    setupFilterTextField();
    tfMinShouldMatch = new DoubleTextField("Minimum number of OR modifiers to match");
    tfMinShouldMatch.setMinWidth(350);

    Button add = addButton();
    add.setPrefWidth(150);
    HBox hBox = new HBox(5, new Label("Filter: "), filterField, add);
    hBox.setAlignment(Pos.CENTER);

    VBox.setVgrow(modMappingTable, Priority.ALWAYS);
    VBox left = new VBox(10, hBox, modMappingTable);
    VBox.setVgrow(modsListView, Priority.ALWAYS);
    Label modifiersLbl = new Label("Modifiers");
    modifiersLbl.setFont(Font.font("Verdana", FontWeight.MEDIUM, 14));
    modifiersLbl.setPadding(new Insets(4));
    HBox minShouldMatchHBox = new HBox(3, new Label("Minimum OR Matches:"), tfMinShouldMatch);
    minShouldMatchHBox.setAlignment(Pos.CENTER);
    VBox right = new VBox(3, new StackPane(modifiersLbl), minShouldMatchHBox, modsListView);

    setupGridPaneColumns();

    GridPane.setVgrow(left, Priority.ALWAYS);
    GridPane.setVgrow(right, Priority.ALWAYS);
    add(left, 0, 0);
    add(right, 1, 0);
}

From source file:de.ks.text.AsciiDocEditor.java

@FXML
void showPreviewPopup() {
    if (previewPopupStage == null) {
        String title = Localized.get("adoc.preview");

        previewPopupStage = new Stage();
        previewPopupStage.setTitle(title);
        Scene scene = new Scene(new StackPane(popupPreviewNode));
        scene.setOnKeyReleased(e -> {
            if (e.getCode() == KeyCode.ESCAPE) {
                previewPopupStage.close();
            }/* w  w w .  j  ava 2s . c  om*/
        });
        previewPopupStage.setScene(scene);

        Rectangle2D bounds = new ScreenResolver().getScreenToShow().getBounds();
        previewPopupStage.setX(bounds.getMinX());
        previewPopupStage.setY(bounds.getMinY());
        previewPopupStage.setWidth(bounds.getWidth());
        previewPopupStage.setHeight(bounds.getHeight());

        previewPopupStage.initModality(Modality.NONE);
        previewPopupStage.setOnShowing(e -> {
            popupPreview.showDirect(getText());
        });
        previewPopupStage.setOnCloseRequest(e -> this.previewPopupStage = null);
        previewPopupStage.show();
    }
}