/**
  * Creates a FlowPane layout with the specified orientation and hgap/vgap.
  *
  * @param orientation the direction the tiles should flow & wrap
  * @param hgap the amount of horizontal space between each tile
  * @param vgap the amount of vertical space between each tile
  * @param children The initial set of children for this pane.
  * @since JavaFX 8.0
  */
 public FlowPane(Orientation orientation, double hgap, double vgap, Node... children) {
   this();
   setOrientation(orientation);
   setHgap(hgap);
   setVgap(vgap);
   getChildren().addAll(children);
 }
Exemple #2
0
  public CreditView() {
    this.setUpTop();
    this.setUpCreditDescription();

    FlowPane botContainer = new FlowPane();
    botContainer.setOrientation(Orientation.HORIZONTAL);
    botContainer.setAlignment(Pos.CENTER_RIGHT);
    botContainer.setPadding(new Insets(5, 5, 5, 5));
    Button getBtn = new Button("Оформить заявку");
    botContainer.getChildren().add(getBtn);
    this.setBottom(botContainer);

    this.getStyleClass().add("credit-view");
  }
 /**
  * Creates a FlowPane layout with the specified orientation and hgap/vgap = 0.
  *
  * @param orientation the direction the tiles should flow & wrap
  * @param children The initial set of children for this pane.
  * @since JavaFX 8.0
  */
 public FlowPane(Orientation orientation, Node... children) {
   this();
   setOrientation(orientation);
   getChildren().addAll(children);
 }
 /**
  * Creates a FlowPane layout with the specified orientation and hgap/vgap.
  *
  * @param orientation the direction the tiles should flow & wrap
  * @param hgap the amount of horizontal space between each tile
  * @param vgap the amount of vertical space between each tile
  */
 public FlowPane(Orientation orientation, double hgap, double vgap) {
   this();
   setOrientation(orientation);
   setHgap(hgap);
   setVgap(vgap);
 }
 /**
  * Creates a FlowPane layout with the specified orientation and hgap/vgap = 0.
  *
  * @param orientation the direction the tiles should flow & wrap
  */
 public FlowPane(Orientation orientation) {
   this();
   setOrientation(orientation);
 }
  public BoardView(int noPlayers, final Stage primaryStage) {

    window = primaryStage;
    window.setTitle("Quoridor");
    window.setMaxHeight(1280);
    window.setMaxWidth(1280);
    window.setResizable(false);

    BorderPane border = new BorderPane();

    infoPane = new FlowPane();
    infoPane.setPadding(new Insets(10));
    infoPane.setHgap(40);
    infoPane.setVgap(10);
    infoPane.setOrientation(Orientation.HORIZONTAL);

    bottomPane = new HBox();
    bottomPane.setSpacing(345);

    gameGrid = new GridPane();
    gameGrid.setPadding(new Insets(4));
    gameGrid.setId("gamegrid");

    border.setTop(infoPane);
    border.setCenter(gameGrid);

    playerPositionButtons = new PlayerPositionButton[9][9];
    wallPositionButtons = new WallPositionButton[9][8];
    horizontalWalls = new Pane[9][9];
    verticalWalls = new Pane[9][9];

    column = 0;
    row = 0;

    chooseVertical = new Button();
    chooseVertical.setPrefSize(100, 100);
    chooseVertical.setId("vWallBtn");

    Button home = new Button();
    home.setPrefSize(100, 100);
    home.setId("home");
    home.setOnAction(e -> confirmBox());

    bottomPane.getChildren().addAll(chooseVertical, home);

    border.setBottom(bottomPane);
    border.setMargin(bottomPane, new Insets(40, 40, 20, 20));

    for (int y = 0; y < 8; y++) {
      createMoveLine(y);
      createWallLine(y);
    }

    createMoveLine(8);

    main = new Scene(border, 600, 768);
    main.getStylesheets().add("gameplay/viewJFX/" + stylesheet);
    buildPlayerLabels(noPlayers);
    window.setScene(main);
    window.show();
  }