Example usage for javafx.scene.control Separator setMinHeight

List of usage examples for javafx.scene.control Separator setMinHeight

Introduction

In this page you can find the example usage for javafx.scene.control Separator setMinHeight.

Prototype

public final void setMinHeight(double value) 

Source Link

Usage

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param primaryStage/*www .  j av  a 2s  .co m*/
 * @param width
 * @param height
 * @throws Exception
 */
private void creeEnvironnement(Stage primaryStage, int width, int height) throws Exception {
    popUp = new PopUpDialogController();
    primaryStage.setMaximized(true);
    double largeurOutils = 380;

    hauteurInterface = height;
    largeurInterface = width;
    /**
     * Cration des lments constitutifs de l'cran
     */
    VBox root = new VBox();
    creeMenu(root, width);
    tabPaneEnvironnement = new TabPane();
    //        tabPaneEnvironnement.setTranslateZ(5);
    tabPaneEnvironnement.setMinHeight(height - 60);
    tabPaneEnvironnement.setMaxHeight(height - 60);
    Pane barreStatus = new Pane();
    barreStatus.setPrefSize(width + 20, 30);
    barreStatus.setTranslateY(25);
    barreStatus.setStyle("-fx-background-color:#c00;-fx-border-color:#aaa");
    tabVisite = new Tab();
    Pane visualiseur;
    Pane panneauPlan;
    tabInterface = new Tab();
    tabPlan = new Tab();
    gestionnaireInterface.creeInterface(width, height - 60);
    visualiseur = gestionnaireInterface.tabInterface;
    gestionnairePlan.creeInterface(width, height - 60);
    panneauPlan = gestionnairePlan.tabInterface;
    tabInterface.setContent(visualiseur);
    tabPlan.setContent(panneauPlan);

    HBox hbEnvironnement = new HBox();
    TextArea txtTitrePano;
    TextArea tfTitreVisite;
    RadioButton radSphere;
    RadioButton radCube;
    CheckBox chkAfficheTitre;
    CheckBox chkAfficheInfo;

    tabPaneEnvironnement.getTabs().addAll(tabVisite, tabInterface, tabPlan);
    //tabPaneEnvironnement.setTranslateY(80);
    tabPaneEnvironnement.setSide(Side.TOP);
    tabPaneEnvironnement.getSelectionModel().selectedItemProperty()
            .addListener((ObservableValue<? extends Tab> ov, Tab t, Tab t1) -> {
                gestionnaireInterface.rafraichit();
            });

    tabVisite.setText(rb.getString("main.creationVisite"));
    tabVisite.setClosable(false);
    tabInterface.setText(rb.getString("main.creationInterface"));
    tabInterface.setClosable(false);
    tabPlan.setText(rb.getString("main.tabPlan"));
    tabPlan.setClosable(false);
    tabPlan.setDisable(true);
    tabVisite.setContent(hbEnvironnement);
    double largeur;
    String labelStyle = "-fx-color : white;-fx-background-color : #fff;-fx-padding : 5px;  -fx-border : 1px solid #777;-fx-width : 100px;-fx-margin : 5px; ";

    scene = new Scene(root, width, height, Color.rgb(221, 221, 221));
    //        if (systemeExploitation.indexOf("inux") != -1) {
    //            root.setStyle("-fx-font-size : 7pt;-fx-font-family: sans-serif;");
    //        } else {
    root.setStyle("-fx-font-size : 9pt;-fx-font-family: Arial;");
    //        }
    panneauOutils = new ScrollPane();
    panneauOutils.setId("panOutils");
    //        panneauOutils.setStyle("-fx-background-color : #ccc;");
    outils = new VBox();
    paneChoixPanoramique = new VBox();
    paneChoixPanoramique.setTranslateX(10);
    paneChoixPanoramique.setId("choixPanoramique");
    Label lblTitreVisite = new Label(rb.getString("main.titreVisite"));
    lblTitreVisite.setStyle("-fx-font-size : 10pt;-fx-font-weight : bold;");
    lblTitreVisite.setPadding(new Insets(15, 5, 5, 0));
    lblTitreVisite.setMinWidth(largeurOutils - 20);
    lblTitreVisite.setAlignment(Pos.CENTER);

    tfTitreVisite = new TextArea();
    tfTitreVisite.setId("titreVisite");
    tfTitreVisite.setPrefSize(200, 25);
    tfTitreVisite.setMaxSize(340, 25);

    Separator sepTitre = new Separator(Orientation.HORIZONTAL);
    sepTitre.setMinHeight(10);

    Label lblChoixPanoramiqueEntree = new Label(rb.getString("main.panoEntree"));
    lblChoixPanoramiqueEntree.setStyle("-fx-font-size : 10pt;-fx-font-weight : bold;");
    lblChoixPanoramiqueEntree.setPadding(new Insets(15, 5, 5, 0));
    lblChoixPanoramiqueEntree.setMinWidth(largeurOutils - 20);
    lblChoixPanoramiqueEntree.setAlignment(Pos.CENTER);

    lblChoixPanoramique = new Label(rb.getString("main.panoAffiche"));
    lblChoixPanoramique.setStyle("-fx-font-size : 10pt;-fx-font-weight : bold;");
    lblChoixPanoramique.setPadding(new Insets(10, 5, 5, 0));
    lblChoixPanoramique.setMinWidth(largeurOutils - 20);
    lblChoixPanoramique.setAlignment(Pos.CENTER);

    Separator sepPano = new Separator(Orientation.HORIZONTAL);
    sepPano.setMinHeight(10);
    listeChoixPanoramique.setVisibleRowCount(10);
    listeChoixPanoramique.setTranslateX(60);
    Pane fond = new Pane();
    fond.setCursor(Cursor.HAND);
    ImageView ivSupprPanoramique = new ImageView(
            new Image("file:" + repertAppli + File.separator + "images/suppr.png", 30, 30, true, true));
    fond.setTranslateX(260);
    fond.setTranslateY(-40);
    Tooltip t = new Tooltip(rb.getString("main.supprimePano"));
    t.setStyle(tooltipStyle);
    Tooltip.install(fond, t);
    fond.getChildren().add(ivSupprPanoramique);
    fond.setOnMouseClicked((MouseEvent me) -> {
        retirePanoCourant();
    });

    listeChoixPanoramiqueEntree.setTranslateX(60);
    Separator sepInfo = new Separator(Orientation.HORIZONTAL);
    Label lblTitrePano = new Label(rb.getString("main.titrePano"));
    lblTitrePano.setStyle("-fx-font-size : 10pt;-fx-font-weight : bold;");
    lblTitrePano.setPadding(new Insets(5, 5, 5, 0));
    lblTitrePano.setMinWidth(largeurOutils - 20);
    lblTitrePano.setAlignment(Pos.CENTER);
    txtTitrePano = new TextArea();
    txtTitrePano.setId("txttitrepano");
    txtTitrePano.setPrefSize(200, 25);
    txtTitrePano.setMaxSize(340, 25);
    txtTitrePano.textProperty().addListener((final ObservableValue<? extends String> observable,
            final String oldValue, final String newValue) -> {
        clickBtnValidePano();
    });

    paneChoixPanoramique.getChildren().addAll(lblTitreVisite, tfTitreVisite, lblChoixPanoramiqueEntree,
            listeChoixPanoramiqueEntree, sepPano, lblChoixPanoramique, listeChoixPanoramique, fond,
            lblTitrePano, txtTitrePano, sepInfo);
    paneChoixPanoramique.setSpacing(10);
    /*
      modifier pour afficher le panneau des derniers fichiers;        
     */
    //outils.getChildren().addAll(lastFiles, paneChoixPanoramique);

    outils.getChildren().addAll(paneChoixPanoramique);

    paneChoixPanoramique.setVisible(false);
    /*
     Cration du panneau d'info du panoramique
     */

    vuePanoramique = new ScrollPane();

    coordonnees = new HBox();
    pano = new Pane();
    panneau2 = new AnchorPane();
    lblLong = new Label("");
    lblLat = new Label("");
    imagePanoramique = new ImageView();

    primaryStage.setScene(scene);
    //scene.getStylesheets().add("file:css/test.css");
    /**
     *
     */
    vuePanoramique.setPrefSize(width - largeurOutils - 20, height - 130);
    vuePanoramique.setMaxSize(width - largeurOutils - 20, height - 130);
    vuePanoramique.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    vuePanoramique.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    vuePanoramique.setTranslateY(5);

    //vuePanoramique.setStyle("-fx-background-color : #c00;");
    /**
     *
     */
    panneauOutils.setContent(outils);
    panneauOutils.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
    panneauOutils.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    panneauOutils.setPrefSize(largeurOutils, height - 240);
    panneauOutils.setMaxWidth(largeurOutils);
    panneauOutils.setMaxHeight(height - 240);
    panneauOutils.setTranslateY(15);
    panneauOutils.setTranslateX(20);
    //        panneauOutils.setStyle("-fx-background-color : #ccc;");
    /**
     *
     */
    pano.setCursor(Cursor.CROSSHAIR);
    outils.setPrefWidth(largeurOutils - 20);
    //        outils.setStyle("-fx-background-color : #ccc;");
    outils.minHeight(height - 130);
    outils.setLayoutX(10);
    //        lblLong.setStyle(labelStyle);
    //        lblLat.setStyle(labelStyle);
    lblLong.setPrefSize(100, 15);
    lblLat.setPrefSize(100, 15);
    lblLat.setTranslateX(50);
    //        panneau2.setStyle("-fx-background-color : #ddd;");
    panneau2.setPrefSize(width - largeurOutils - 20, height - 140);

    imagePanoramique.setCache(true);
    largeur = largeurMax - 60;
    imagePanoramique.setFitWidth(largeur);
    imagePanoramique.setFitHeight(largeur / 2.0d);
    imagePanoramique.setLayoutX((largeurMax - largeur) / 2.d);
    pano.getChildren().add(imagePanoramique);
    pano.setPrefSize(imagePanoramique.getFitWidth(), imagePanoramique.getFitHeight());
    pano.setMaxSize(imagePanoramique.getFitWidth(), imagePanoramique.getFitHeight());

    pano.setLayoutY(20);
    lblLong.setTranslateX(50);
    lblLat.setTranslateX(80);
    coordonnees.getChildren().setAll(lblLong, lblLat);
    vuePanoramique.setContent(panneau2);
    hbEnvironnement.getChildren().setAll(vuePanoramique, panneauOutils);
    AnchorPane paneEnv = new AnchorPane();
    paneAttends = new AnchorPane();
    paneAttends.setPrefHeight(250);
    paneAttends.setPrefWidth(400);
    paneAttends.setStyle("-fx-background-color : #ccc;" + "-fx-border-color: #666;" + "-fx-border-radius: 5px;"
            + "-fx-border-width: 1px;");
    paneAttends.setLayoutX((width - 400) / 2.d);
    paneAttends.setLayoutY((height - 250) / 2.d - 55);
    ProgressIndicator p1 = new ProgressIndicator();
    p1.setPrefSize(100, 100);
    p1.setLayoutX(150);
    p1.setLayoutY(50);
    Label lblAttends = new Label(rb.getString("main.attendsChargement"));
    lblAttends.setMinWidth(400);
    lblAttends.setAlignment(Pos.CENTER);
    lblAttends.setLayoutY(20);
    lblCharge = new Label();
    lblCharge.setMinWidth(400);
    lblCharge.setLayoutY(200);
    paneAttends.getChildren().addAll(lblAttends, p1, lblCharge);
    paneAttends.setVisible(false);
    paneEnv.getChildren().addAll(tabPaneEnvironnement, paneAttends);
    //        paneEnv.getChildren().addAll(tabPaneEnvironnement);
    root.getChildren().addAll(paneEnv);
    panneau2.getChildren().setAll(coordonnees, pano);
    primaryStage.show();
    popUp.affichePopup();
    lblDragDrop = new Label(rb.getString("main.dragDrop"));
    lblDragDrop.setMinHeight(vuePanoramique.getPrefHeight());
    lblDragDrop.setMaxHeight(vuePanoramique.getPrefHeight());
    lblDragDrop.setMinWidth(vuePanoramique.getPrefWidth());
    lblDragDrop.setMaxWidth(vuePanoramique.getPrefWidth());
    lblDragDrop.setAlignment(Pos.CENTER);
    lblDragDrop.setTextFill(Color.web("#c9c7c7"));
    lblDragDrop.setTextAlignment(TextAlignment.CENTER);
    lblDragDrop.setWrapText(true);
    lblDragDrop.setStyle("-fx-font-size:72px");
    lblDragDrop.setTranslateY(-100);
    panneau2.getChildren().addAll(lblDragDrop, afficheLegende());
}