Package javafx.scene.layout

Examples of javafx.scene.layout.BorderPane


       
        setResizable(false);

    Insets insets = new Insets(5, 5, 5, 5);
   
    BorderPane border = new BorderPane();
   
    Label _questionLabel = new Label();
    _questionLabel.setText(question);
    border.setCenter(_questionLabel);
    BorderPane.setMargin(_questionLabel, insets);
   
    FlowPane flow = new FlowPane();
    flow.setAlignment(Pos.CENTER);
   
    _yesButton = new Button("Oui");
    _yesButton.setOnAction(this);
    FlowPane.setMargin(_yesButton, insets);
    flow.getChildren().add(_yesButton);
   
    _noButton = new Button("Non");
    _noButton.setOnAction(this);
    FlowPane.setMargin(_noButton, insets);
    flow.getChildren().add(_noButton);
       
    border.setBottom(flow);
   
    Scene scene = new Scene(border);
    setScene(scene);
  }
View Full Code Here


    _userInfo = infos;
   
    setTitle("BeloteTime");
    initStyle(StageStyle.DECORATED);

    _viewBorderPane = new BorderPane();

    MenuBar menuBar = new MenuBar();

    Menu fileMenu = new Menu("Fichier");
    _newLocalMenuItem = new MenuItem("Nouvelle partie (local)");
View Full Code Here

   * Renvoi le BorderPane du jeu
   *
   * @return Le BorderPane
   */
  private BorderPane getGameBorderPane() {
    BorderPane borderPane = new BorderPane();
    borderPane
        .setStyle("-fx-background-image: url(\"res\\ihm\\texture.jpg\");");
    return borderPane;
  }
View Full Code Here

    setTitle("Salon");
    initStyle(StageStyle.UTILITY);
    initModality(Modality.APPLICATION_MODAL);

    BorderPane borderPane = new BorderPane();

    FlowPane gamePane = new FlowPane(Orientation.VERTICAL);
   
    Label gameLabel = new Label("Liste des parties :");
   
    _gameListView = new ListView();
    _gameListView.getSelectionModel().selectedItemProperty()
        .addListener(new ChangeListener<String>() {
          public void changed(ObservableValue<? extends String> ov,
              String old_val, String new_val) {
            _controller.execute("roomDisconnect",
                new Object[] { _user });
            _action = "join";
            _game = new_val.split(" ")[0];
            _adresse = new_val.split(" ")[1];
            refreshTimeLine.stop();
            close();
          }
        });

    FlowPane playerPane = new FlowPane(Orientation.VERTICAL);
   
    Label playerLabel = new Label("Liste des joueurs connect�s");
    _playerListView = new ListView();

    gamePane.getChildren().addAll(gameLabel, _gameListView);
    borderPane.setCenter(gamePane);
   
    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);

    setMinWidth(520);
    setMinHeight(470);
   
    Scene scene = new Scene(borderPane, 500, 450);
View Full Code Here

  public AccountStage(){
    setTitle("Creation de compte");
    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);
   
    FlowPane flow = new FlowPane();
    flow.setAlignment(Pos.CENTER);
   
    _okButton = new Button("Valider");
    _okButton.setOnAction(this);
    _okButton.setDefaultButton(true);
    flow.getChildren().add(_okButton);
    FlowPane.setMargin(_okButton, insets);
   
    _exitButton = new Button("Quitter");
    _exitButton.setOnAction(this);
    _exitButton.setCancelButton(true);
    flow.getChildren().add(_exitButton);
    FlowPane.setMargin(_exitButton, insets);
   
    BorderPane.setAlignment(flow, Pos.CENTER);
    borderPane.setBottom(flow);
   
    Scene scene = new Scene(borderPane);
    setScene(scene);
    sizeToScene();
    centerOnScreen();
View Full Code Here

    setTitle("Creation de compte");
    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);

    FlowPane flow = new FlowPane();
    flow.setAlignment(Pos.CENTER);

    exitButton = new Button("Quitter");
    exitButton.setOnAction(new EventHandler() {

      @Override
      public void handle(Event arg0) {
        // TODO Auto-generated method stub
        close();
      }

    });
    exitButton.setCancelButton(true);
    flow.getChildren().add(exitButton);
    FlowPane.setMargin(exitButton, insets);

    BorderPane.setAlignment(flow, Pos.CENTER);
    borderPane.setBottom(flow);

    Scene scene = new Scene(borderPane);
    setScene(scene);
    sizeToScene();
    centerOnScreen();
View Full Code Here

    initStyle(StageStyle.DECORATED);
    initModality(Modality.APPLICATION_MODAL);
   
    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);
   
    FlowPane flow = new FlowPane();
    flow.setAlignment(Pos.CENTER);
   
    _okButton = new Button("Valider");
    _okButton.setOnAction(this);
    flow.getChildren().add(_okButton);
    FlowPane.setMargin(_okButton, insets);
   
    _exitButton = new Button("Quitter");
    _exitButton.setOnAction(this);
    flow.getChildren().add(_exitButton);
    FlowPane.setMargin(_exitButton, insets);
   
    BorderPane.setAlignment(flow, Pos.CENTER);
    borderPane.setBottom(flow);
   
    Scene scene = new Scene(borderPane);
    setScene(scene);
    _userTextField.requestFocus();
  }
View Full Code Here

      setTitle("Gestion des droits");
      initStyle(StageStyle.DECORATED);

      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);

      FlowPane flow = new FlowPane();
      flow.setAlignment(Pos.CENTER);

      _exitButton = new Button("Quitter");
      _exitButton.setOnAction(this);
      flow.getChildren().add(_exitButton);
      FlowPane.setMargin(_exitButton, insets);

      BorderPane.setAlignment(flow, Pos.CENTER);
      borderPane.setBottom(flow);

      Scene scene = new Scene(borderPane);
      setScene(scene);
      sizeToScene();
      centerOnScreen();
View Full Code Here

    dataControl = new DataController();
    setTitle("Creation de compte");
    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);

    FlowPane flow = new FlowPane();
    flow.setAlignment(Pos.CENTER);

    okButton = new Button("Valider");
    okButton.setOnAction(new DisplayConfirm());
    okButton.setDefaultButton(true);
    flow.getChildren().add(okButton);
    FlowPane.setMargin(okButton, insets);

    exitButton = new Button("Quitter");
    exitButton.setOnAction(new EventHandler() {

      @Override
      public void handle(Event arg0) {
        // TODO Auto-generated method stub
        close();
      }

    });
    exitButton.setCancelButton(true);
    flow.getChildren().add(exitButton);
    FlowPane.setMargin(exitButton, insets);

    BorderPane.setAlignment(flow, Pos.CENTER);
    borderPane.setBottom(flow);

    Scene scene = new Scene(borderPane);
    setScene(scene);
    sizeToScene();
    centerOnScreen();
View Full Code Here

  /**
   * Initialise les composants graphiques
   */
  private void initComponents()
  {
    borderPane = new BorderPane();
   
    //Menus
    menuBar = new MenuBar();
    fileMenu = new Menu("Fichier");
    singlePlayerGame = new MenuItem("Cr�er partie solo");
    singlePlayerGame.setOnAction(new StartGameHandler());
    multiPlayerGame = new MenuItem("Cr�er partie en ligne");
    multiPlayerGame.setOnAction(new StartOnlineGameHandler());
    joinGame = new MenuItem("Rejoindre une partie");
    joinGame.setOnAction(new JoinOnlineGameHandler());
    MenuItem logonMenuItem = new MenuItem("Connexion");
    logonMenuItem.setOnAction(new LogonHandler());
    accountCreation = new MenuItem("Creer un Compte");
    accountCreation.setOnAction(new DisplayAccountCreation());

    fileMenu.getItems().add(accountCreation);
    fileMenu.getItems().add(logonMenuItem);
    fileMenu.getItems().add(singlePlayerGame);

    Menu accountMenu = new Menu("Compte");
    MenuItem infoMenuItem = new MenuItem("Mes infos");
    infoMenuItem.setOnAction(new DisplayUserInfoHandler());
    MenuItem rightMenuItem = new MenuItem("Mes droits");
    rightMenuItem.setOnAction(new DisplayPermissionHandler());
    MenuItem editRightMenuItem = new MenuItem("Gerer les droits");
    editRightMenuItem.setOnAction(new EditPermissionHandler());
   
    accountMenu.getItems().addAll(infoMenuItem, rightMenuItem, editRightMenuItem);
   
    team = new Menu("Equipe");
    teamCreation = new MenuItem("Cr�er une �quipe");
    teamCreation.setOnAction(new DisplayTeamHandler());
   
    team.getItems().add(teamCreation);
   
    stat = new Menu("Statistique");
    yourStat = new MenuItem("Vos Statistiques");
    yourStat.setOnAction(new DisplayStatistics());
   
    stat.getItems().add(yourStat);
    Menu roomMenu = new Menu("Salon");
   
    roomJoin = new MenuItem("Rejoindre un salon");
    roomJoin.setOnAction(new RoomHandler());
   
    roomRemove = new MenuItem("Supprimer un salon");
    roomRemove.setOnAction(new RemoveRoomHandler());
   
    roomMenu.getItems().addAll(roomJoin, roomRemove);
   
    menuBar.getMenus().addAll(fileMenu, accountMenu, team, roomMenu, stat);
    borderPane.setTop(menuBar);
    gameBorderPane = new BorderPane();
    gameBorderPane.setStyle("-fx-background-image: url(\"res\\ihm\\texture.jpg\");");

    borderPane.setCenter(gameBorderPane);

    scene = new Scene(borderPane, 750, 612);   
View Full Code Here

TOP

Related Classes of javafx.scene.layout.BorderPane

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.