Package javafx.scene.layout

Examples of javafx.scene.layout.BorderPane


  /**
   * 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


    idS = id + "";
    setTitle("Creation de compte");
    initStyle(StageStyle.DECORATED);

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

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

    Label teamLabel = new Label("Nom de l'�quipe");
    teamTextField = new TextField("");
    gridPane.add(teamLabel, 0, 1);
    gridPane.add(teamTextField, 1, 1);
    GridPane.setMargin(teamTextField, insets);

    // May be SelectionMode can be better
    Label teammateLabel = new Label("Nom du coequipier");
    teammateTextField = new TextField("");
    gridPane.add(teammateLabel, 0, 3);
    gridPane.add(teammateTextField, 1, 3);
    GridPane.setMargin(teammateTextField, insets);

    BorderPane.setAlignment(gridPane, Pos.CENTER);
    borderPane.setCenter(gridPane);

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

    okButton = new Button("Valider");
    okButton.setOnAction(new EventHandler() {
      @Override
      public void handle(Event arg0) {
        // TODO Auto-generated method stub
        try {
          if (sql.getInstance().insertTeam(
              CreationTeamStage.this.teamTextField.getText(),
              CreationTeamStage.this.teammateTextField.getText(),
              CreationTeamStage.this.idS)) {
            MessageBox message = new MessageBox("Equipe Cr��",
                "F�licitation, l'�quipe "
                    + CreationTeamStage.this.teamTextField
                        .getText() + " a �t� cr�e.");
            message.showDialog();

          } else {
            MessageBox message = new MessageBox("Echec",
                "Creation Impossible");
            message.showDialog();
          }
        } catch (SQLException e) {
          MessageBox message = new MessageBox("Echec", e.getMessage());
          message.showDialog();
        }
      }
    });
    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

      }
    });

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

    BorderPane border = new BorderPane();

    Label _messageLabel = new Label();
    _messageLabel.setText(message);
    BorderPane.setMargin(_messageLabel, insets);
    border.setTop(_messageLabel);
   
    _inputTextField = new TextField();
    BorderPane.setMargin(_inputTextField, insets);
    border.setCenter(_inputTextField);

    _validateButton = new Button("OK");
    _validateButton.setOnAction(this);
    BorderPane.setMargin(_validateButton, insets);
    BorderPane.setAlignment(_validateButton, Pos.CENTER);
    border.setBottom(_validateButton);

    Scene scene = new Scene(border);
    setScene(scene);
  }
View Full Code Here

  }
 
  //Initialisation des composants
  private void initComponents()
  {
    borderPane = new BorderPane();
    Insets margin = new Insets(5, 5, 5, 5);
   
    posSouth = new JoinButton("Joueur 1", 0, this);
    posWest = new JoinButton("Joueur 2", 1, this);
    posNorth = new JoinButton("Joueur 3", 2, this)
View Full Code Here

       
        setResizable(false);

    Insets insets = new Insets(5, 5, 5, 5);
   
    BorderPane border = new BorderPane();
   
    Label _messageLabel = new Label();
    _messageLabel.setText(message);
    border.setCenter(_messageLabel);
    BorderPane.setMargin(_messageLabel, insets);
   
    _okButton = new Button("OK");
    _okButton.setOnAction(this);
    BorderPane.setAlignment(_okButton, Pos.TOP_CENTER);
    BorderPane.setMargin(_okButton, insets);
    border.setBottom(_okButton);

    Scene scene = new Scene(border);
    setScene(scene);
  }
View Full Code Here

        /*
         * top part of the dialog contains short informative message, and either
         * an icon, or the text is displayed over a watermark image
         */
        private Pane createMasthead() {
            mastheadPanel = new BorderPane();
            mastheadPanel.getStyleClass().add("top-panel");

            // Create panel with text area and icon or just a background image:
            // Create topPanel's components.  UITextArea determines
            // the size of the dialog by defining the number of columns
View Full Code Here

        private Pane createCenterPanel() {
            centerPanel = new VBox();
            centerPanel.getStyleClass().add("center-panel");

            BorderPane contentPanel = new BorderPane();
            contentPanel.getStyleClass().add("center-content-panel");
            VBox.setVgrow(contentPanel, Priority.ALWAYS);

            Node content = createCenterContent();
            if (content != null) {
                contentPanel.setCenter(content);
                contentPanel.setPadding(new Insets(0, 0, 12, 0));
            }

            FlowPane buttonsPanel = new FlowPane(6, 0) {
                @Override protected void layoutChildren() {
                    /*
                    * According to UI guidelines, all buttons should have the same length.
                    * This function is to define the longest button in the array of buttons
                    * and set all buttons in array to be the length of the longest button.
                    */
                    // Find out the longest button...
                    double widest = 50;
                    for (int i = 0; i < buttons.size(); i++) {
                        Button btn = buttons.get(i);
                        if (btn == null) continue;
                        widest = Math.max(widest, btn.prefWidth(-1));
                    }

                    // ...and set all buttons to be this width
                    for (int i = 0; i < buttons.size(); i++) {
                        Button btn = buttons.get(i);
                        if (btn == null) continue;
                        btn.setPrefWidth(btn.isVisible() ? widest : 0);
                    }
                   
                    super.layoutChildren();
                }
            };
            buttonsPanel.getStyleClass().add("button-bar");

            // Create buttons from okBtnStr and cancelBtnStr strings.
            buttonsPanel.getChildren().addAll(createButtons());

            if (contentPanel.getChildren().size() > 0) {
                centerPanel.getChildren().add(contentPanel);
            }

            BorderPane bottomPanel = new BorderPane();
            bottomPanel.getStyleClass().add("center-bottom-panel");
            bottomPanel.setRight(buttonsPanel);
            centerPanel.getChildren().add(bottomPanel);

            return centerPanel;
        }
View Full Code Here

                        windowBtns.getChildren().remove(maxButton);
                    }
                }
            });

            root = new BorderPane();

            Scene scene;
            if (stageStyle == StageStyle.DECORATED) {
                scene = new Scene(root);
                // !CHANGE START!
View Full Code Here

            contentPanel.getStyleClass().add("more-info-dialog");

            contentPanel.setPrefSize(800, 600);

            if (throwable != null) {
                BorderPane labelPanel = new BorderPane();

                Label label = new Label(getString("exception.dialog.label"));
                labelPanel.setLeft(label);

                contentPanel.getChildren().add(labelPanel);

                StringWriter sw = new StringWriter();
                PrintWriter pw = new PrintWriter(sw);
View Full Code Here

        /*
         * top part of the dialog contains short informative message, and either
         * an icon, or the text is displayed over a watermark image
         */
        private Pane createMasthead() {
            mastheadPanel = new BorderPane();
            mastheadPanel.getStyleClass().add("top-panel");

            // Create panel with text area and icon or just a background image:
            // Create topPanel's components.  UITextArea determines
            // the size of the dialog by defining the number of columns
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.