Package javafx.scene.layout

Examples of javafx.scene.layout.GridPane


   * Lance une partie
   */
  public void startGame() {
    MessageBox.Show("Information", "D�but d'une partie.");

    _northGrid = new GridPane();
    _northCard = new ArrayList<ImageView>();
    _northGrid.setAlignment(Pos.CENTER);
    BorderPane.setMargin(_northGrid, new Insets(20, 0, 0, 0));
    _gameBorderPane.setTop(_northGrid);

    _eastGrid = new GridPane();
    _eastCard = new ArrayList<ImageView>();
    _eastGrid.setAlignment(Pos.CENTER);
    BorderPane.setAlignment(_eastGrid, Pos.CENTER);
    BorderPane.setMargin(_eastGrid, new Insets(0, 20, 0, 0));
    _gameBorderPane.setRight(_eastGrid);

    _southGrid = new GridPane();
    _southCard = new ArrayList<ImageView>();
    _southGrid.setAlignment(Pos.CENTER);
    BorderPane.setMargin(_southGrid, new Insets(0, 0, 20, 0));
    _gameBorderPane.setBottom(_southGrid);

    _westGrid = new GridPane();
    _westCard = new ArrayList<ImageView>();
    _westGrid.setAlignment(Pos.CENTER);
    BorderPane.setAlignment(_westGrid, Pos.CENTER);
    BorderPane.setMargin(_westGrid, new Insets(0, 0, 0, 20));
    _gameBorderPane.setLeft(_westGrid);

    _gridCenter = new GridPane();
    BorderPane.setMargin(_gridCenter, new Insets(100, 100, 100, 100));
    _gameBorderPane.setCenter(_gridCenter);

    firstDistribution();
    takeAtout("res\\cartes\\as_carreau.png");
View Full Code Here


   * @param pos
   *            Position de l'autre joueur
   */
  public void removeCard(Position pos) {
    ArrayList<ImageView> cards = new ArrayList<ImageView>();
    GridPane grid = new GridPane();
    int index = 0;
    switch (pos) {
    case EST:
      cards = _eastCard;
      grid = _eastGrid;
      break;
    case NORD:
      cards = _northCard;
      grid = _northGrid;
      if (cards.size() > 1)
        index = cards.size() - 1;
      break;
    case OUEST:
      cards = _westCard;
      grid = _westGrid;
      if (cards.size() > 1)
        index = cards.size() - 1;
      break;
    default:
      break;
    }
    cards.remove(index);
    grid.getChildren().remove(index);
  }
View Full Code Here

   
    playerPane.getChildren().addAll(playerLabel, _playerListView);
   
    borderPane.setRight(playerPane);

    GridPane buttonPane = new GridPane();
    buttonPane.setAlignment(Pos.CENTER);
    buttonPane.setHgap(25);
    buttonPane.setVgap(25);
   
    _addButton = new Button("Cr�er une partie");
    _addButton.setOnAction(this);
   
    _refreshButton = new Button("Actualiser");
    _refreshButton.setOnAction(this);

    _exitButton = new Button("Quitter le salon");
    _exitButton.setOnAction(this);

    buttonPane.add(_addButton, 0, 0);
    buttonPane.add(_refreshButton, 1, 0);
    buttonPane.add(_exitButton, 2, 0);

    BorderPane.setAlignment(buttonPane, Pos.CENTER);
    BorderPane.setMargin(buttonPane, new Insets(25, 0, 25, 0));
    borderPane.setBottom(buttonPane);
View Full Code Here

    initStyle(StageStyle.DECORATED);
   
    Insets insets = new Insets(15, 15, 15, 15);
    BorderPane borderPane = new BorderPane();
   
    GridPane gridPane = new GridPane();
    gridPane.setAlignment(Pos.CENTER);
   
    Label userLabel = new Label("Nom d'utilisateur");
    _userTextField = new TextField();
    gridPane.add(userLabel, 0, 1);
    gridPane.add(_userTextField, 1, 1);
    GridPane.setMargin(_userTextField, insets);
   
    Label nameLabel = new Label("Nom");
    _nameTextField = new TextField();
    gridPane.add(nameLabel, 0, 3);
    gridPane.add(_nameTextField, 1, 3);
    GridPane.setMargin(_nameTextField, insets);
   
    Label surnameLabel = new Label("Prenom");
    _surnameTextField = new TextField();
    gridPane.add(surnameLabel, 0, 6);
    gridPane.add(_surnameTextField, 1, 6);
    GridPane.setMargin(_surnameTextField, insets);
   
    Label passwordLabel = new Label("Mot de passe");
    _passwordTextField = new PasswordField();
    gridPane.add(passwordLabel, 0, 9);
    gridPane.add(_passwordTextField, 1, 9);
    GridPane.setMargin(_passwordTextField, insets);
   
    Label confirmPasswordLabel = new Label("Confirmation Mot de Passe");
    _confirmPasswordTextField = new PasswordField();
    gridPane.add(confirmPasswordLabel, 0, 12);
    gridPane.add(_confirmPasswordTextField, 1, 12);
    GridPane.setMargin(_confirmPasswordTextField, insets);
   
    BorderPane.setAlignment(gridPane, Pos.CENTER);
    borderPane.setCenter(gridPane);
   
View Full Code Here

    initStyle(StageStyle.DECORATED);

    Insets insets = new Insets(12, 10, 12, 10);
    BorderPane borderPane = new BorderPane();

    GridPane gridPane = new GridPane();
    gridPane.setAlignment(Pos.CENTER);

    nameLabelRef = new Label("Pseudonyme");
    TotalNbGameLabelRef = new Label("Total Parties Jou�es");
    TotalNbGameLostRef = new Label("Total Parties Perdues");
    TotalNbGameWonRef = new Label("Total Parties Gagn�es");
    TotalPointLabelRef = new Label("Total des Points");
    averageLabelRef = new Label("Score Moyen");

    nameLabel = new Label();
    TotalNbGameLabel = new Label();
    TotalNbGameLost = new Label();
    TotalNbGameWon = new Label();
    TotalPointLabel = new Label();
    averageLabel = new Label();
   
    try {
      nameLabel.setText(u.getName());
      TotalNbGameLabel.setText(stat.getNbPartie() + "");
      TotalNbGameLost.setText(stat.getNbPartieLose() + "");
      TotalNbGameWon.setText(stat.getNbPartieWon() + "");
      TotalPointLabel.setText(stat.getNbPoints() + "");
      averageLabel.setText(stat.getAverage() + "");

    } catch (Exception e) {
      MessageBox m = new MessageBox("Echec", e.getMessage());
      e.printStackTrace();
      m.show();
    }

    gridPane.add(nameLabelRef, 0, 1);
    gridPane.add(nameLabel, 1, 1);
    GridPane.setMargin(nameLabel, insets);

    gridPane.add(TotalNbGameLabelRef, 0, 2);
    gridPane.add(TotalNbGameLabel, 1, 2);
    GridPane.setMargin(TotalNbGameLabel, insets);

    gridPane.add(TotalNbGameLostRef, 0, 3);
    gridPane.add(TotalNbGameLost, 1, 3);
    GridPane.setMargin(TotalNbGameLost, insets);

    gridPane.add(TotalNbGameWonRef, 0, 4);
    gridPane.add(TotalNbGameWon, 1, 4);
    GridPane.setMargin(TotalNbGameWon, insets);

    gridPane.add(TotalPointLabelRef, 0, 5);
    gridPane.add(TotalPointLabel, 1, 5);
    GridPane.setMargin(TotalPointLabel, insets);

    gridPane.add(averageLabelRef, 0, 6);
    gridPane.add(averageLabel, 1, 6);
    GridPane.setMargin(averageLabel, insets);

    BorderPane.setAlignment(gridPane, Pos.CENTER);
    borderPane.setCenter(gridPane);
View Full Code Here

   
    Insets insets = new Insets(5, 5, 5, 5);
   
    BorderPane borderPane = new BorderPane();

    GridPane gridPane = new GridPane();
    gridPane.setAlignment(Pos.CENTER);
       
    Label userLabel = new Label("Nom d'utilisateur");
    _userTextField = new TextField();
    gridPane.add(userLabel, 0, 1);
    gridPane.add(_userTextField, 1, 1);
    GridPane.setMargin(_userTextField, insets);
   
    Label passwordLabel = new Label("Mot de passe");
    _passwordTextField = new PasswordField();
    _passwordTextField.setOnAction(this);
    gridPane.add(passwordLabel, 0, 3);
    gridPane.add(_passwordTextField, 1, 3);
    GridPane.setMargin(_passwordTextField, insets);
       
    BorderPane.setAlignment(gridPane, Pos.CENTER);
    borderPane.setCenter(gridPane);
   
View Full Code Here

      Insets insets = new Insets(5, 5, 5, 5);

      BorderPane borderPane = new BorderPane();

      GridPane gridPane = new GridPane();
      gridPane.setAlignment(Pos.CENTER);

      Label userLabel = new Label("Nom d'utilisateur");
      gridPane.add(userLabel, 0, 1);
      _userComboBox.setMinWidth(150);
      gridPane.add(_userComboBox, 1, 1);
      GridPane.setMargin(_userComboBox, insets);
      _userComboBox.valueProperty().addListener(
          new ChangeListener<User>() {

            @Override
            public void changed(
                ObservableValue<? extends User> arg0,
                User arg1, User arg2) {
              _controller.execute("permissions",
                  new Object[] { arg2.get_id() });
            }
          });
      Label droitLabel = new Label("Droits");
      gridPane.add(droitLabel, 0, 3);
      _permissionComboBox.setMinWidth(150);
      gridPane.add(_permissionComboBox, 1, 3);
      GridPane.setMargin(_permissionComboBox, insets);

      _addButton = new Button("Ajouter");
      _addButton.setOnAction(this);
      _addPermissionComboBox.setMinWidth(150);
      gridPane.add(_addPermissionComboBox, 0, 5);
      gridPane.add(_addButton, 1, 5);
      GridPane.setMargin(_addPermissionComboBox, insets);

      _removeButton = new Button("Supprimer");
      _removeButton.setOnAction(this);
      _removePermissionComboBox.setMinWidth(150);
      gridPane.add(_removePermissionComboBox, 0, 7);
      gridPane.add(_removeButton, 1, 7);
      GridPane.setMargin(_removePermissionComboBox, insets);

      BorderPane.setAlignment(gridPane, Pos.CENTER);
      borderPane.setCenter(gridPane);
View Full Code Here

    initStyle(StageStyle.DECORATED);

    Insets insets = new Insets(12, 10, 12, 10);
    BorderPane borderPane = new BorderPane();

    GridPane gridPane = new GridPane();
    gridPane.setAlignment(Pos.CENTER);

    userLabel = new Label("Pseudonyme");
    passwordLabel = new Label("Mot de Passe");
    nameLabel = new Label("Nom");
    surnameLabel = new Label("Prenom");

    userTextField = new TextField("");
    passwordTextField = new TextField("");
    nameTextField = new TextField("");
    surnameTextField = new TextField("");

    gridPane.add(userLabel, 0, 1);
    gridPane.add(userTextField, 1, 1);
    GridPane.setMargin(userTextField, insets);

    gridPane.add(passwordLabel, 0, 2);
    gridPane.add(passwordTextField, 1, 2);
    GridPane.setMargin(passwordTextField, insets);

    gridPane.add(nameLabel, 0, 3);
    gridPane.add(nameTextField, 1, 3);
    GridPane.setMargin(nameTextField, insets);

    gridPane.add(surnameLabel, 0, 4);
    gridPane.add(surnameTextField, 1, 4);
    GridPane.setMargin(surnameTextField, insets);

    BorderPane.setAlignment(gridPane, Pos.CENTER);
    borderPane.setCenter(gridPane);
View Full Code Here

       
    beloteCheck = new CheckBox(" Belote");
    beloteCheck.setVisible(false);
    FlowPane.setMargin(beloteCheck, in);

    foldGrid = new GridPane();
    FlowPane.setMargin(foldGrid, in);
   
    infosPane.getChildren().addAll(roundScoreLabel, trumpLabel, gameScoreLabel, tchatListView, tchatTextField, beloteCheck, foldGrid);
   
   
View Full Code Here

  /**
   * D�but du tour d'un joueur
   */
  private void start()
  {   
    southGrid = new GridPane();
    northGrid = new GridPane();
    eastGrid = new GridPane();
    westGrid = new GridPane();
    centerGrid = new GridPane();
   
    northGrid.setAlignment(Pos.CENTER);
    eastGrid.setAlignment(Pos.CENTER);
    southGrid.setAlignment(Pos.CENTER);
    westGrid.setAlignment(Pos.CENTER);
View Full Code Here

TOP

Related Classes of javafx.scene.layout.GridPane

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.