Java 类javafx.scene.layout.BorderPaneBuilder 实例源码

项目:xpanderfx    文件:GameOver.java   
/**
 * shows game-over pop-up.
 * @param controller 
 */
private void showGameOverPopup(MainFXMLDocumentController controller) {
    @SuppressWarnings("deprecation")
    BorderPane content =BorderPaneBuilder.create()
         .minWidth(230).minHeight(130)
         .bottom(getBottomBox(controller))
         .center(getCenterBox())
         .style(              "-fx-background-color:linear-gradient(darkslategrey, wheat, white);"
              + "-fx-background-radius:7;"
              + "-fx-border-radius:7")
         .build();
    pp = new Popup();
    pp.setAutoHide(true);
    pp.getContent().add(content);
    pp.show(controller.DOWN.getScene().getWindow());
}
项目:xpanderfx    文件:Completion.java   
/**
 * 
 * @return root-node
 */
@SuppressWarnings("deprecation")
private BorderPane getBody() {
    return BorderPaneBuilder.create().minHeight(200).minWidth(440).center(
            VBoxBuilder.create().alignment(Pos.CENTER).children(
                    LabelBuilder.create()
                            .minHeight(10).build(),
                    LabelBuilder.create().text("Congratulation !! You won the game.")
                        .font(Font.font("", FontWeight.BOLD, FontPosture.ITALIC, 20))
                            .textFill(Color.WHITE).build(),
                    LabelBuilder.create()
                            .minHeight(30).build(),
                    HBoxBuilder.create().alignment(Pos.CENTER).spacing(20).children(
                            ButtonBuilder.create().text("Continue").font(Font.font("", FontWeight.SEMI_BOLD, FontPosture.REGULAR, 18))
                                    .minWidth(140).textFill(Color.WHITE).style("-fx-base:darkslategrey")
                                    .onAction(e -> this.close()).build(),
                            ButtonBuilder.create().text("Try Again").font(Font.font("", FontWeight.SEMI_BOLD, FontPosture.REGULAR, 18))
                                    .minWidth(140).textFill(Color.WHITE).style("-fx-base:darkslategrey")
                                    .onAction(e -> {
                                        controller.restart();   
                                        this.close();
                                    }).build()
                    ).build()
            )
            .build()
    ).style("-fx-background-color: linear-gradient(#000000cc, darkslategrey); -fx-background-radius: 15; -fx-border-radius:15;"
            + "-fx-border-width:1; -fx-border-color:lightgrey").build();
}
项目:JacpFX-misc    文件:ApplicationPreloader.java   
private Scene createPreloaderScene() {
    bar = new ProgressBar();
    final BorderPane p = BorderPaneBuilder
            .create()
            .center(new ImageView(new Image(this.getClass()
                    .getResourceAsStream("/images/jacp-splash.png"))))
            .bottom(bar).build();
    return new Scene(p, 412, 279);
}
项目:LJGM    文件:LJGM.java   
@Override
public void start(Stage primaryStage) throws Exception {
    if (false) {
        new GalleryCreator(galleryManager.getGalleries().get(0)).show();
        return;
    }
    logger.info("Setting up main stage...");
    this.ljgmStage = primaryStage;
    ljgmStage.setTitle(LJGMUtils.generateStageTitle("Starting..."));
    ljgmStage.getIcons().add(new Image("file:res/favicon.png"));

    // Create the scroll pane for the viewing area
    ScrollPane sp = ScrollPaneBuilder.create().content(view).hbarPolicy(ScrollBarPolicy.AS_NEEDED)
            .vbarPolicy(ScrollBarPolicy.AS_NEEDED).build();

    // Create the main border pane to host all the components
    // Center: viewing area, left: sidebar, bottom: status bar, top: menu
    // items
    // @formatter:off
    BorderPane bp = BorderPaneBuilder.create().center(sp).left(gallerySidebar).bottom(statusBar).top(createMenuBar()).build();
    // @formatter:on
    ljgmStage.setScene(new Scene(bp, 1000, 500));

    // Select the first gallery
    if (gallerySidebar.getListView().getItems().size() != 0) {
        view.setFocus(galleryManager.getGallery(gallerySidebar.removeImageCount(gallerySidebar.getListView().getItems()
                .get(0))));
        gallerySidebar.getListView().getSelectionModel().select(0);
    } else {
        view.setFocus(null);
    }

    logger.info("Main stage set up.");
    ljgmStage.show();
    logger.info("Done!");
}