Beispiel #1
2
  public static void message(String msg, StackPane pane) {

    Label warningL = new Label(msg);
    Labels.setLabelStyle(warningL, Custom.TEXT_SIZE_LARGER, true);
    warningL.setTextAlignment(TextAlignment.CENTER);

    StackPane warningPane = new StackPane();
    warningPane.getChildren().add(warningL);
    warningPane.setStyle(Custom.WINDOW_STYLING);
    warningPane.setMinWidth(Custom.SCREEN_WIDTH * 95 / 100);
    warningPane.setMaxWidth(Custom.SCREEN_WIDTH * 95 / 100);
    warningPane.setMinHeight(Custom.SCREEN_HEIGHT * 2 / 5);
    warningPane.setMaxHeight(Custom.SCREEN_HEIGHT * 2 / 5);
    warningPane.setBorder(
        new Border(
            new BorderStroke(
                Paint.valueOf("#000000"),
                BorderStrokeStyle.SOLID,
                new CornerRadii(30),
                new BorderWidths(5))));

    pane.getChildren().add(warningPane);

    PauseTransition pause = new PauseTransition(Duration.millis(1500));
    pause.setOnFinished(
        (f) -> {
          pane.getChildren().remove(warningPane);
          goBack();
        });
    pause.play();
  }
Beispiel #2
1
  public static void setPayPane(int amount) {

    message = new Label(Custom.PAY_PTS_MESSAGE);
    Labels.setLabelStyle(message, Custom.TEXT_SIZE_LARGER, true);
    StackPane.setAlignment(message, Pos.CENTER);

    payBtn = new Button(Custom.YES);
    Buttons.setStoreLargerButtons(payBtn, true);
    StackPane.setAlignment(payBtn, Pos.BOTTOM_LEFT);
    payBtn.setOnAction((ae) -> PayPoints.buy(amount));

    backBtn = new Button(Custom.NO);
    Buttons.setStoreLargerButtons(backBtn, true);
    StackPane.setAlignment(backBtn, Pos.BOTTOM_RIGHT);
    backBtn.setOnAction((ae) -> PayPoints.goBack());

    mainPane = new StackPane();
    mainPane.setStyle(Custom.WINDOW_STYLING);
    mainPane.setMinWidth(Custom.SCREEN_WIDTH * 95 / 100);
    mainPane.setMaxWidth(Custom.SCREEN_WIDTH * 95 / 100);
    mainPane.setMinHeight(Custom.SCREEN_HEIGHT * 2 / 5);
    mainPane.setMaxHeight(Custom.SCREEN_HEIGHT * 2 / 5);
    mainPane.setBorder(
        new Border(
            new BorderStroke(
                Paint.valueOf("#000000"),
                BorderStrokeStyle.SOLID,
                new CornerRadii(30),
                new BorderWidths(5))));
    mainPane.getChildren().addAll(message, payBtn, backBtn);
    mainPane.setPadding(new Insets(10, 10, 10, 10));
    StackPane.setAlignment(mainPane, Pos.CENTER);

    backPane = new StackPane();
    backPane.getChildren().add(mainPane);
    backPane.setStyle(Custom.MENU_BACKGROUND);

    getRoot().getChildren().add(backPane);
  }