private void drawPanelForTopHeader() {
   Pane panel = new Pane();
   panel.setId("panelForTopheader");
   panel.setPrefSize(722, 382);
   panel.setLayoutX(-1);
   panel.setLayoutY(63);
   this.addToStep(panel);
   this.contentPanel = panel;
 }
  public void createWallLine(int y) {
    PositionButton button;
    Pane wallRec;

    for (int x = 0; x < 8; x++) {
      wallRec = new Pane();
      wallRec.setPrefSize(30, 10);
      wallRec.setId("wallRec");

      horizontalWalls[x][y] = wallRec;
      gameGrid.setConstraints(horizontalWalls[x][y], column, row);
      gameGrid.getChildren().add(horizontalWalls[x][y]);

      column++;

      button = new WallPositionButton(new Position(x, y));
      button.setPrefSize(10, 10);
      button.setId("wallPosBtn");

      wallPositionButtons[x][y] = button;

      gameGrid.setConstraints(wallPositionButtons[x][y], column, row);
      gameGrid.getChildren().addAll(wallPositionButtons[x][y]);

      column++;
    }

    wallRec = new Pane();
    wallRec.setPrefSize(30, 10);
    wallRec.setId("wallRec");

    horizontalWalls[8][y] = wallRec;
    gameGrid.setConstraints(horizontalWalls[8][y], column, row);
    gameGrid.getChildren().add(horizontalWalls[8][y]);

    column = 0;
    row++;
  }
  /** Draw the header at the top of the window */
  private void drawHeader() {
    final String title =
        this.getParentWizardTitle(); // FIXME: use this variable to draw the title of the window
    Pane header = new Pane();
    header.setId("header");
    header.setPrefSize(722, 65);
    header.setLayoutX(-1);
    header.setLayoutY(-1);
    header.setBackground(
        new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY)));

    ImageView topImage = new ImageView(this.createTopImage());
    topImage.setLayoutX(626);

    header.getChildren().add(topImage);
    this.addToStep(header);
  }
示例#4
0
 public void changeLayout(Layout layout) {
     // destruindo o layout anterior
     if (currentLayout != null) {
         currentLayout.destroy();
     }
     currentLayout = layout;
     Pane root = currentLayout.create();
     root.setOnMouseClicked(new EventHandler<MouseEvent>() {
         @Override
         public void handle(MouseEvent t) {
             if (t.isMiddleButtonDown() || t.getButton().ordinal() == 2) {
                 self.hide();
             }
         }
     });
     root.setId("root");
     currentLayout.applyTheme();
     Scene scene = new Scene(root, display.getWidth(), display.getHeight());
     scene.getStylesheets().add(PainelFx.class.getResource("style.css").toExternalForm());
     stage.setScene(scene);
     update();
 }
  public void createMoveLine(int y) {
    PositionButton button;
    Pane wallRec;

    button = new PlayerPositionButton(new Position(0, y));
    button.setPrefSize(60, 60);
    button.setId("board");

    playerPositionButtons[0][y] = button;
    gameGrid.setConstraints(button, column, row);
    gameGrid.getChildren().addAll(playerPositionButtons[0][y]);

    for (int x = 1; x < 9; x++) {
      column++;

      wallRec = new Pane();
      wallRec.setPrefSize(10, 30);
      wallRec.setId("wallRec");

      verticalWalls[x][y] = wallRec;
      gameGrid.setConstraints(wallRec, column, row);
      gameGrid.getChildren().add(verticalWalls[x][y]);

      column++;

      button = new PlayerPositionButton(new Position(x, y));
      button.setPrefSize(60, 60);

      button.setId("board");

      playerPositionButtons[x][y] = button;
      gameGrid.setConstraints(button, column, row);
      gameGrid.getChildren().addAll(playerPositionButtons[x][y]);
    }
    column = 0;
    row++;
  }