Example usage for javafx.scene.control Button setLayoutX

List of usage examples for javafx.scene.control Button setLayoutX

Introduction

In this page you can find the example usage for javafx.scene.control Button setLayoutX.

Prototype

public final void setLayoutX(double value) 

Source Link

Usage

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Hello World");
    Group root = new Group();
    Scene scene = new Scene(root, 300, 250);
    Button btn = new Button("Hello World");
    btn.setLayoutX(100);
    btn.setLayoutY(80);// www  .j a v a 2s  .c  o  m
    btn.setOnAction(new EventHandler<ActionEvent>() {

        public void handle(ActionEvent event) {
            System.out.println("Hello World");
        }
    });
    root.getChildren().add(btn);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {

    Button btn = new Button();
    final Label lbl = new Label();

    primaryStage.setTitle("Hello World!");

    lbl.setLayoutX(70);/*from  w  ww .j a v  a  2  s.  co  m*/
    lbl.setLayoutY(150);

    btn.setLayoutX(100);
    btn.setLayoutY(100);
    btn.setText("Hello, World!");

    btn.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent event) {
            lbl.setText("Hello, World.");
        }
    });

    Group root = new Group();

    root.getChildren().add(btn);
    root.getChildren().add(lbl);
    primaryStage.setScene(new Scene(root, 300, 250));
    primaryStage.show();
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param iNumHS/*from ww  w  . j  a  v a  2 s .  c  om*/
 * @return
 */
private static AnchorPane apAfficherListePanosVignettes(int iNumHS) {
    NavigateurPanoramique navigateurPano2;
    AnchorPane apVisuPanoHS;
    iNumeroPanoChoisitHS = -1;
    if (!getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).getStrFichierXML().equals("")) {
        for (int ii1 = 0; ii1 < getiNombrePanoramiques(); ii1++) {
            String strFichPano = getPanoramiquesProjet()[ii1].getStrNomFichier();
            String strNomXMLFile = strFichPano
                    .substring(strFichPano.lastIndexOf(File.separator) + 1, strFichPano.length())
                    .split("\\.")[0] + ".xml";
            if (strNomXMLFile
                    .equals(getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).getStrFichierXML())) {
                iNumeroPanoChoisitHS = ii1;
                strNomPanoChoisitHS = getPanoramiquesProjet()[ii1].getStrNomFichier();
            }
        }
        navigateurPano2 = new NavigateurPanoramique(
                getPanoramiquesProjet()[iNumeroPanoChoisitHS].getImgVisuPanoramique(), 0, 0, 400, 200, true);
        if (getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).getRegardX() != -1000) {
            navigateurPano2.setChoixLongitude(
                    getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).getRegardX());
        } else {
            navigateurPano2.setChoixLongitude(0);
        }
        navigateurPano2.setLongitude(navigateurPano2.getChoixLongitude());
        if (getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).getRegardY() != -1000) {
            navigateurPano2.setChoixLatitude(
                    getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).getRegardY());
        } else {
            navigateurPano2.setChoixLatitude(0);
        }
        navigateurPano2.setLatitude(navigateurPano2.getChoixLatitude());
        if (getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).getChampVisuel() != 0) {
            navigateurPano2
                    .setChoixFov(getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).getChampVisuel());
        } else {
            navigateurPano2.setChoixFov(50);
        }
        navigateurPano2.setFov(navigateurPano2.getChoixFov());
        apVisuPanoHS = navigateurPano2.affichePano();
        apVisuPanoHS.setDisable(false);

    } else {
        navigateurPano2 = new NavigateurPanoramique(
                getPanoramiquesProjet()[getiPanoActuel()].getImgVisuPanoramique(), 0, 0, 400, 200, true);
        apVisuPanoHS = navigateurPano2.affichePano();
        apVisuPanoHS.setDisable(true);
    }
    AnchorPane aplistePano = new AnchorPane();
    aplistePano.setOpacity(1);
    Pane paneFond = new Pane();
    paneFond.setOnMouseClicked((mouseEvent) -> {
        mouseEvent.consume();
    });
    paneFond.setStyle("-fx-background-color : #bbb;");
    paneFond.setPrefWidth(540);
    paneFond.setPrefHeight(((getiNombrePanoramiques() - 2) / 4 + 1) * 65 + 10 + 320);
    paneFond.setMinWidth(540);
    paneFond.setMinHeight(70);
    aplistePano.getChildren().add(paneFond);
    aplistePano.setStyle("-fx-backgroung-color : #bbb;");
    int ij = 0;
    ImageView[] ivPano;
    ivPano = new ImageView[getiNombrePanoramiques()];
    double xPos;
    double yPos;
    int iRow = 0;
    Button btnValide = new Button("Ok");
    btnValide.setPrefWidth(80);
    btnValide.setLayoutX(paneFond.getPrefWidth() - 100);
    btnValide.setLayoutY(paneFond.getPrefHeight() - 30);
    paneFond.getChildren().add(btnValide);
    btnValide.setOnMouseClicked((mouseEvent) -> {
        if (iNumeroPanoChoisitHS != -1) {
            panePanoramique.setCursor(Cursor.CROSSHAIR);
            panePanoramique.setOnMouseClicked((me1) -> {
                gereSourisPanoramique(me1);
            });
            setStrPanoListeVignette(strNomPanoChoisitHS);
            if (getPanoramiquesProjet()[iNumeroPanoChoisitHS].getStrTitrePanoramique() != null) {
                String strTexteHS = getPanoramiquesProjet()[iNumeroPanoChoisitHS].getStrTitrePanoramique();
                TextField tfTxtHS = (TextField) vbOutils.lookup("#txtHS" + iNumHS);
                tfTxtHS.setText(strTexteHS);
            }
            double latitude = Math.round(navigateurPano2.getChoixLatitude() * 10) / 10.d;
            double longitude = Math.round(navigateurPano2.getChoixLongitude() * 10) / 10.d - 180;
            double fov = Math.round(navigateurPano2.getChoixFov() * 10) / 10.d;
            longitude = longitude % 360;
            longitude = longitude < 0 ? longitude + 360 : longitude;
            longitude = longitude > 180 ? longitude - 360 : longitude;
            getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).setNumeroPano(iNumeroPanoChoisitHS);
            getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).setRegardX(longitude - 180);
            getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).setRegardY(latitude);
            getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS).setChampVisuel(fov);
            getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumHS)
                    .setImgVueHs(navigateurPano2.getImgVignetteHS());
            ComboBox cbPanos = (ComboBox) vbOutils.lookup("#cbpano" + iNumHS);
            cbPanos.getSelectionModel().select(iNumeroPanoChoisitHS);
            aplistePano.setVisible(false);
        }
        mouseEvent.consume();

    });
    for (int i = 0; i < getiNombrePanoramiques(); i++) {
        int iNumeroPano1 = i;
        String strNomPano = getPanoramiquesProjet()[i].getStrNomFichier();
        ivPano[ij] = new ImageView(getPanoramiquesProjet()[i].getImgVignettePanoramique());
        ivPano[ij].setFitWidth(120);
        ivPano[ij].setFitHeight(60);
        ivPano[ij].setSmooth(true);
        int iCol = ij % 4;
        iRow = ij / 4;
        xPos = iCol * 130 + 25;
        yPos = iRow * 65 + 15;
        ivPano[ij].setLayoutX(xPos);
        ivPano[ij].setLayoutY(yPos);
        ivPano[ij].setCursor(Cursor.HAND);
        ivPano[ij].setStyle("-fx-background-color : #ccc;");
        Tooltip tltpPano = new Tooltip(
                strNomPano.substring(strNomPano.lastIndexOf(File.separator) + 1, strNomPano.lastIndexOf(".")));
        tltpPano.setStyle(getStrTooltipStyle());
        Tooltip.install(ivPano[ij], tltpPano);
        ivPano[ij].setOnMouseClicked((mouseEvent) -> {
            iNumeroPanoChoisitHS = iNumeroPano1;
            strNomPanoChoisitHS = getPanoramiquesProjet()[iNumeroPanoChoisitHS].getStrNomFichier();
            navigateurPano2.setImagePanoramique(
                    getPanoramiquesProjet()[iNumeroPanoChoisitHS].getStrNomFichier(),
                    getPanoramiquesProjet()[iNumeroPanoChoisitHS].getImgVisuPanoramique());
            navigateurPano2.setLongitude(getPanoramiquesProjet()[iNumeroPanoChoisitHS].getRegardX() - 180);
            navigateurPano2.setLatitude(getPanoramiquesProjet()[iNumeroPanoChoisitHS].getRegardY());
            navigateurPano2.setFov(getPanoramiquesProjet()[iNumeroPanoChoisitHS].getChampVisuel());
            navigateurPano2.affiche();
            apVisuPanoHS.setDisable(false);
        });
        aplistePano.getChildren().add(ivPano[ij]);
        ij++;

    }
    int iTaille = (iRow + 1) * 65 + 5;
    apVisuPanoHS.setLayoutY(iTaille + 10);
    iTaille += 320;
    apVisuPanoHS.setLayoutX((540 - apVisuPanoHS.getPrefWidth()) / 2.d);
    aplistePano.setPrefWidth(540);
    aplistePano.setPrefHeight(iTaille);
    aplistePano.setMinWidth(540);
    aplistePano.setMinHeight(iTaille);
    aplistePano.getChildren().add(apVisuPanoHS);
    ImageView ivClose = new ImageView(
            new Image("file:" + getStrRepertAppli() + File.separator + "images/ferme.png", 20, 20, true, true));
    ivClose.setLayoutX(2);
    ivClose.setLayoutY(5);
    ivClose.setCursor(Cursor.HAND);
    aplistePano.getChildren().add(ivClose);
    ivClose.setOnMouseClicked((mouseEvent) -> {
        panePanoramique.setCursor(Cursor.CROSSHAIR);
        panePanoramique.setOnMouseClicked((mouseEvent1) -> {
            gereSourisPanoramique(mouseEvent1);
        });

        setStrPanoListeVignette("");
        aplistePano.setVisible(false);
        mouseEvent.consume();
    });
    return aplistePano;
}

From source file:editeurpanovisu.EditeurPanovisu.java

public static void creerEditerDiaporama(String strDiaporama) {
    apCreationDiaporama.getChildren().clear();
    apCreationDiaporama.setStyle("-fx-background-color : -fx-base;" + "-fx-border-color: derive(-fx-base,10%);"
            + "-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.5) , 8, 0.0 , 0 , 8 );"
            + "-fx-border-width: 1px;");
    mbarPrincipal.setDisable(true);//w  ww . ja  v  a  2s .c o m
    bbarPrincipal.setDisable(true);
    hbBarreBouton.setDisable(true);
    tpEnvironnement.setDisable(true);

    Rectangle2D tailleEcran = Screen.getPrimary().getBounds();
    int iLargeurEcran = (int) tailleEcran.getWidth();
    int iHauteurEcran = (int) tailleEcran.getHeight() - 100;
    final int iLargeur = 800;
    final int iHauteur = 630;
    Label lblNomDiapo = new Label(rbLocalisation.getString("main.nomDiapo"));
    lblNomDiapo.setLayoutX(30);
    lblNomDiapo.setLayoutY(45);

    ComboBox cbListeDiapo = new ComboBox();
    cbListeDiapo.setLayoutX(150);
    cbListeDiapo.setLayoutY(40);
    cbListeDiapo.setValue("");
    for (int i = 0; i < getiNombreDiapo(); i++) {
        cbListeDiapo.getItems().add(diaporamas[i].getStrNomDiaporama());
    }

    Button btnNouveauDiapo = new Button(rbLocalisation.getString("diapo.nouveau"));
    btnNouveauDiapo.setLayoutX(iLargeur - 330);
    btnNouveauDiapo.setLayoutY(20);
    btnNouveauDiapo.setPrefSize(140, 60);

    Button btnEffaceDiapo = new Button(rbLocalisation.getString("diapo.efface"));
    btnEffaceDiapo.setLayoutX(iLargeur - 170);
    btnEffaceDiapo.setLayoutY(20);
    btnEffaceDiapo.setPrefSize(140, 60);

    gestDiapo = new GestionnaireDiaporamaController();
    gestDiapo.initDiaporama();
    apCreationDiaporama.getChildren().addAll(lblNomDiapo, cbListeDiapo, btnEffaceDiapo, btnNouveauDiapo,
            gestDiapo.apDiaporama);

    apCreationDiaporama.setPrefWidth(iLargeur);
    apCreationDiaporama.setMinWidth(iLargeur);
    apCreationDiaporama.setMaxWidth(iLargeur);
    apCreationDiaporama.setPrefHeight(iHauteur);
    apCreationDiaporama.setMinHeight(iHauteur);
    apCreationDiaporama.setMaxHeight(iHauteur);
    apCreationDiaporama.setLayoutX((iLargeurEcran - iLargeur) / 2);
    apCreationDiaporama.setLayoutY((iHauteurEcran - iHauteur) / 2);
    apCreationDiaporama.setVisible(true);

    gestDiapo.addPropertyChangeListener("valideDiapo", (e) -> {
        mbarPrincipal.setDisable(false);
        bbarPrincipal.setDisable(false);
        hbBarreBouton.setDisable(false);
        tpEnvironnement.setDisable(false);
        apCreationDiaporama.setVisible(false);
        gestDiapo.diapoSauve = true;
        boolean bTrouve = false;
        int iTrouve = -1;
        for (int i = 0; i < getiNombreDiapo(); i++) {
            if (diaporamas[i].getStrNomDiaporama().equals(cbListeDiapo.getValue())) {
                bTrouve = true;
                iTrouve = i;
            }
        }
        if (bTrouve) {
            diaporamas[iTrouve] = gestDiapo.getDiaporama();
            try {
                creeDiaporamaHTML(diaporamas[iTrouve], iTrouve);
            } catch (IOException ex) {
                Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        gestDiapo.reInit(new Diaporama());
    });

    gestDiapo.addPropertyChangeListener("visualiseDiapo", (e) -> {
        try {
            creeDiaporamaHTML(gestDiapo.getDiaporama(), -1);
        } catch (IOException ex) {
            Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
        }
        String strNomFichier = getStrRepertTemp() + File.separator + "diaporama" + File.separator
                + "diapo-1.html";
        webEngine.load("file:///" + strNomFichier);
        apWebview.getChildren().clear();
        browser.setPrefSize(apWebview.getPrefWidth() - 20, apWebview.getPrefHeight() - 50);
        browser.setTranslateX(10);
        browser.setTranslateY(10);
        apWebview.getChildren().add(browser);
        Button btnOk = new Button("Ok");
        btnOk.setPrefSize(100, 20);
        btnOk.setLayoutX(apWebview.getPrefWidth() - 110);
        btnOk.setLayoutY(apWebview.getPrefHeight() - 30);
        apWebview.getChildren().add(btnOk);
        apWebview.setVisible(true);
        btnOk.setOnMouseClicked((me) -> {
            apWebview.setVisible(false);
            apWebview.getChildren().clear();
        });
    });

    gestDiapo.addPropertyChangeListener("annuleDiapo", (e) -> {
        mbarPrincipal.setDisable(false);
        bbarPrincipal.setDisable(false);
        hbBarreBouton.setDisable(false);
        tpEnvironnement.setDisable(false);
        apCreationDiaporama.setVisible(false);
        gestDiapo.diapoSauve = true;
        gestDiapo.reInit(new Diaporama());
    });

    cbListeDiapo.valueProperty().addListener((ov, old_val, new_val) -> {
        if (new_val != null) {
            ButtonType reponse = null;
            ButtonType buttonTypeOui = new ButtonType(rbLocalisation.getString("main.oui"));
            ButtonType buttonTypeNon = new ButtonType(rbLocalisation.getString("main.non"));
            if (!gestDiapo.diapoSauve) {
                Alert alert = new Alert(AlertType.CONFIRMATION);
                alert.setTitle(rbLocalisation.getString("diapo.sauver"));
                alert.setHeaderText(null);
                alert.setContentText(rbLocalisation.getString("diapo.sauverTexte"));
                alert.getButtonTypes().clear();
                alert.getButtonTypes().setAll(buttonTypeOui, buttonTypeNon);
                Optional<ButtonType> actReponse = alert.showAndWait();
                reponse = actReponse.get();
            }
            if (reponse == buttonTypeOui) {

                boolean bTrouve = false;
                int iTrouve = -1;
                for (int i = 0; i < getiNombreDiapo(); i++) {
                    if (diaporamas[i].getStrNomDiaporama().equals(old_val)) {
                        bTrouve = true;
                        iTrouve = i;
                    }
                }
                if (bTrouve) {
                    diaporamas[iTrouve] = gestDiapo.getDiaporama();
                    try {
                        creeDiaporamaHTML(diaporamas[iTrouve], iTrouve);
                    } catch (IOException ex) {
                        Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }

            }
            gestDiapo.diapoSauve = true;
            boolean bTrouve = false;
            int iTrouve = -1;
            for (int i = 0; i < getiNombreDiapo(); i++) {
                if (diaporamas[i].getStrNomDiaporama().equals(new_val)) {
                    bTrouve = true;
                    iTrouve = i;
                }
            }
            if (bTrouve) {
                gestDiapo.setbDisabled(false);
                gestDiapo.reInit(diaporamas[iTrouve]);

            }

        }
    });

    btnNouveauDiapo.setOnMouseClicked((me) -> {
        ButtonType reponse = null;
        ButtonType buttonTypeOui = new ButtonType(rbLocalisation.getString("main.oui"));
        ButtonType buttonTypeNon = new ButtonType(rbLocalisation.getString("main.non"));
        if (!gestDiapo.diapoSauve) {
            Alert alert = new Alert(AlertType.CONFIRMATION);
            alert.setTitle(rbLocalisation.getString("diapo.sauver"));
            alert.setHeaderText(null);
            alert.setContentText(rbLocalisation.getString("diapo.sauverTexte"));
            alert.getButtonTypes().clear();
            alert.getButtonTypes().setAll(buttonTypeOui, buttonTypeNon);
            Optional<ButtonType> actReponse = alert.showAndWait();
            reponse = actReponse.get();
        }
        if (reponse == buttonTypeOui) {
            gestDiapo.diapoSauve = true;
            boolean bTrouve = false;
            int iTrouve = -1;
            for (int i = 0; i < getiNombreDiapo(); i++) {
                if (diaporamas[i].getStrNomDiaporama().equals(cbListeDiapo.getValue())) {
                    bTrouve = true;
                    iTrouve = i;
                }
            }
            if (bTrouve) {
                diaporamas[iTrouve] = gestDiapo.getDiaporama();
                try {
                    creeDiaporamaHTML(diaporamas[iTrouve], iTrouve);
                } catch (IOException ex) {
                    Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
                }
            }

        }

        TextInputDialog dialog = new TextInputDialog("");
        dialog.setTitle(rbLocalisation.getString("main.nomDiapo"));
        dialog.setHeaderText(null);
        dialog.setContentText(rbLocalisation.getString("diapo.entrerNom"));

        Optional<String> resultat = dialog.showAndWait();
        if (resultat.isPresent()) {
            String nomDiapo = resultat.get();
            boolean bTrouve = false;
            for (int i = 0; i < getiNombreDiapo(); i++) {
                if (diaporamas[i].getStrNomDiaporama().equals(nomDiapo)) {
                    bTrouve = true;
                }
            }
            if (!bTrouve) {
                diaporamas[getiNombreDiapo()] = new Diaporama();
                diaporamas[getiNombreDiapo()].setStrNomDiaporama(nomDiapo);
                cbListeDiapo.getItems().add(nomDiapo);
                cbListeDiapo.setValue(nomDiapo);
                gestDiapo.setbDisabled(false);
                gestDiapo.reInit(diaporamas[getiNombreDiapo()]);
                setiNombreDiapo(getiNombreDiapo() + 1);

            } else {
                Alert alert = new Alert(AlertType.ERROR);
                alert.setTitle(rbLocalisation.getString("diapo.erreur"));
                alert.setHeaderText(null);
                alert.setContentText(rbLocalisation.getString("diapo.erreurNom"));
                alert.showAndWait();

            }
        }
    });

}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param iLargeur/*from   w  ww .j ava  2s  . co m*/
 * @param iHauteur
 * @param bMasqueZones
 */
private static void ajouterZone(int iLargeur, int iHauteur, boolean bMasqueZones) {
    if (iNombreZones == -1) {
        iNombreZones = 0;
    }
    final ZoneTelecommande zone = new ZoneTelecommande();
    strTypeZone = "poly";
    zone.setStrTypeZone(strTypeZone);
    iNombrePointsZone = 0;
    bRecommenceZone = false;
    apZoneBarrePersonnalisee.getChildren().clear();
    Button btnAnnuler = new Button(rbLocalisation.getString("main.annuler"),
            new ImageView(new Image("file:" + getStrRepertAppli() + "/images/annule.png")));
    Button btnValider = new Button(rbLocalisation.getString("main.valider"),
            new ImageView(new Image("file:" + getStrRepertAppli() + "/images/valide.png")));
    btnValider.setLayoutX(180);
    btnValider.setLayoutY(170);
    btnAnnuler.setLayoutX(80);
    btnAnnuler.setLayoutY(170);
    ToggleGroup tgTypeZone = new ToggleGroup();
    Label lblTypeZone = new Label(rbLocalisation.getString("main.typeZone"));
    lblTypeZone.setLayoutX(20);
    lblTypeZone.setLayoutY(10);

    RadioButton rbCercleZone = new RadioButton(rbLocalisation.getString("main.cercle"));
    rbCercleZone.setLayoutX(20);
    rbCercleZone.setLayoutY(40);
    rbCercleZone.setUserData("circle");
    rbCercleZone.setToggleGroup(tgTypeZone);
    RadioButton rbRectZone = new RadioButton(rbLocalisation.getString("main.rectangle"));
    rbRectZone.setLayoutX(120);
    rbRectZone.setLayoutY(40);
    rbRectZone.setUserData("rect");
    rbRectZone.setToggleGroup(tgTypeZone);
    RadioButton rbPolyZone = new RadioButton(rbLocalisation.getString("main.polygone"));
    rbPolyZone.setLayoutX(220);
    rbPolyZone.setLayoutY(40);
    rbPolyZone.setUserData("poly");
    rbPolyZone.setToggleGroup(tgTypeZone);
    rbPolyZone.setSelected(true);
    ComboBox cbTouchesBarre = new ComboBox();
    cbTouchesBarre.getItems().clear();
    for (int i = 0; i < strTouchesBarre.length; i++) {
        cbTouchesBarre.getItems().add(i, strTouchesBarre[i]);
    }
    cbTouchesBarre.setLayoutX(50);
    cbTouchesBarre.setLayoutY(110);

    afficheBarrePersonnalisee(iLargeur, iHauteur, bMasqueZones);
    AnchorPane apCreeZone = new AnchorPane();
    apCreeZone.setStyle("-fx-background-color : rgba(0,0,0,0.1)");
    apCreeZone.setPrefWidth(imgBarrePersonnalisee.getWidth());
    apCreeZone.setPrefHeight(imgBarrePersonnalisee.getHeight());
    apCreeZone.setCursor(Cursor.CROSSHAIR);
    apImgBarrePersonnalisee.getChildren().add(apCreeZone);
    apZoneBarrePersonnalisee.getChildren().addAll(lblTypeZone, rbCercleZone, rbRectZone, rbPolyZone,
            cbTouchesBarre, btnAnnuler, btnValider);
    apCreeZone.setOnMouseClicked((t) -> {
        rbCercleZone.setDisable(true);
        rbRectZone.setDisable(true);
        rbPolyZone.setDisable(true);
        iNombrePointsZone++;
        switch (strTypeZone) {
        case "rect":
            if (iNombrePointsZone == 1) {
                apCreeZone.getChildren().clear();
                x1Zone = t.getX();
                y1Zone = t.getY();
                Circle cercle = new Circle(t.getX(), t.getY(), 4);
                cercle.setFill(Color.rgb(255, 0, 0, 0.5));
                cercle.setStroke(Color.YELLOW);
                apCreeZone.getChildren().add(cercle);
            }
            if (iNombrePointsZone == 2) {
                apCreeZone.getChildren().clear();
                Rectangle rect = new Rectangle(x1Zone, y1Zone, t.getX() - x1Zone, t.getY() - y1Zone);
                rect.setFill(Color.rgb(255, 0, 0, 0.5));
                rect.setStroke(Color.YELLOW);
                apCreeZone.getChildren().add(rect);
                String chaine = Math.round(x1Zone * 10) / 10 + "," + Math.round(y1Zone * 10) / 10 + ","
                        + Math.round(t.getX() * 10) / 10 + "," + Math.round(t.getY() * 10) / 10;
                zone.setStrCoordonneesZone(chaine);
                iNombrePointsZone = 0;
            }
            break;
        case "circle":
            if (iNombrePointsZone == 1) {
                apCreeZone.getChildren().clear();
                x1Zone = t.getX();
                y1Zone = t.getY();
                Circle cercle = new Circle(t.getX(), t.getY(), 4);
                cercle.setFill(Color.rgb(255, 0, 0, 0.5));
                cercle.setStroke(Color.YELLOW);
                apCreeZone.getChildren().add(cercle);
            }
            if (iNombrePointsZone == 2) {
                apCreeZone.getChildren().clear();
                double rayon = Math.sqrt(Math.pow(x1Zone - t.getX(), 2.d) + Math.pow(y1Zone - t.getY(), 2.d));
                Circle cercle = new Circle(x1Zone, y1Zone, rayon);
                cercle.setFill(Color.rgb(255, 0, 0, 0.5));
                cercle.setStroke(Color.YELLOW);
                apCreeZone.getChildren().add(cercle);
                String chaine = Math.round(x1Zone * 10) / 10 + "," + Math.round(y1Zone * 10) / 10 + ","
                        + Math.round(rayon * 10) / 10;
                zone.setStrCoordonneesZone(chaine);
                iNombrePointsZone = 0;
            }
            break;
        case "poly":
            if (bRecommenceZone) {
                bRecommenceZone = false;
                iNombrePointsZone = 1;
            }
            if (iNombrePointsZone == 1) {
                apCreeZone.getChildren().clear();
                x1Zone = t.getX();
                y1Zone = t.getY();
                Circle cercle = new Circle(t.getX(), t.getY(), 4);
                cercle.setFill(Color.rgb(255, 0, 0, 0.5));
                cercle.setStroke(Color.YELLOW);
                apCreeZone.getChildren().add(cercle);
                pointsPolyZone[(iNombrePointsZone - 1) * 2] = t.getX();
                pointsPolyZone[(iNombrePointsZone - 1) * 2 + 1] = t.getY();
            }
            if (iNombrePointsZone == 2) {
                apCreeZone.getChildren().clear();
                Line ligne = new Line(x1Zone, y1Zone, t.getX(), t.getY());
                ligne.setStroke(Color.YELLOW);
                apCreeZone.getChildren().add(ligne);
                pointsPolyZone[(iNombrePointsZone - 1) * 2] = t.getX();
                pointsPolyZone[(iNombrePointsZone - 1) * 2 + 1] = t.getY();
            }
            if (iNombrePointsZone > 2) {
                pointsPolyZone[(iNombrePointsZone - 1) * 2] = t.getX();
                pointsPolyZone[(iNombrePointsZone - 1) * 2 + 1] = t.getY();
                apCreeZone.getChildren().clear();
                Polygon poly = new Polygon();
                for (int i = 0; i < iNombrePointsZone; i++) {
                    poly.getPoints().addAll(pointsPolyZone[i * 2], pointsPolyZone[i * 2 + 1]);
                }
                poly.setFill(Color.rgb(255, 0, 0, 0.5));
                poly.setStroke(Color.YELLOW);
                apCreeZone.getChildren().add(poly);
            }
            if (t.getClickCount() == 2) {
                String chaine = "";
                for (int i = 0; i < iNombrePointsZone; i++) {
                    if (i != 0) {
                        chaine += ",";
                    }
                    chaine += Math.round(pointsPolyZone[i * 2] * 10) / 10 + ","
                            + Math.round(pointsPolyZone[i * 2 + 1] * 10) / 10;
                }
                zone.setStrCoordonneesZone(chaine);
                bRecommenceZone = true;
            }
            break;
        }
    });

    apCreeZone.setOnMouseMoved((t) -> {
        switch (strTypeZone) {
        case "rect":
            if (iNombrePointsZone == 1) {
                apCreeZone.getChildren().clear();
                Rectangle rect = new Rectangle(x1Zone, y1Zone, t.getX() - x1Zone, t.getY() - y1Zone);
                rect.setFill(Color.rgb(255, 0, 0, 0.5));
                rect.setStroke(Color.YELLOW);
                apCreeZone.getChildren().add(rect);
            }
            break;
        case "circle":
            if (iNombrePointsZone == 1) {
                apCreeZone.getChildren().clear();
                double rayon = Math.sqrt(Math.pow(x1Zone - t.getX(), 2.d) + Math.pow(y1Zone - t.getY(), 2.d));
                Circle cercle = new Circle(x1Zone, y1Zone, rayon);
                cercle.setFill(Color.rgb(255, 0, 0, 0.5));
                cercle.setStroke(Color.YELLOW);
                apCreeZone.getChildren().add(cercle);
            }
            break;
        case "poly":
            if (!bRecommenceZone) {
                if (iNombrePointsZone == 1) {
                    apCreeZone.getChildren().clear();
                    Line ligne = new Line(x1Zone, y1Zone, t.getX(), t.getY());
                    ligne.setStroke(Color.YELLOW);
                    apCreeZone.getChildren().add(ligne);
                }
                if (iNombrePointsZone > 1) {
                    apCreeZone.getChildren().clear();
                    Polygon poly = new Polygon();
                    for (int i = 0; i < iNombrePointsZone; i++) {
                        poly.getPoints().addAll(pointsPolyZone[i * 2], pointsPolyZone[i * 2 + 1]);
                    }
                    poly.getPoints().addAll(t.getX(), t.getY());
                    poly.setFill(Color.rgb(255, 0, 0, 0.5));
                    poly.setStroke(Color.YELLOW);
                    apCreeZone.getChildren().add(poly);
                }
            }
            break;
        }
    });

    btnValider.setOnMouseClicked((t) -> {
        if (strTypeZone.equals("poly")) {
            String strChaine = "";
            for (int i = 0; i < iNombrePointsZone; i++) {
                if (i != 0) {
                    strChaine += ",";
                }
                strChaine += Math.round(pointsPolyZone[i * 2] * 10) / 10 + ","
                        + Math.round(pointsPolyZone[i * 2 + 1] * 10) / 10;
            }
            zone.setStrCoordonneesZone(strChaine);

        }
        zones[iNombreZones] = zone;
        iNombreZones++;
        afficheBarrePersonnalisee(iLargeur, iHauteur, bMasqueZones);
        btnAjouteZone.setDisable(false);
    });

    btnAnnuler.setOnMouseClicked((t) -> {
        afficheBarrePersonnalisee(iLargeur, iHauteur, bMasqueZones);
        btnAjouteZone.setDisable(false);
    });

    cbTouchesBarre.valueProperty().addListener((ov, strAncienneValeur, strNouvelleValeur) -> {
        if (strNouvelleValeur != null) {
            String strId = strCodeBarre[cbTouchesBarre.getSelectionModel().getSelectedIndex()];
            zone.setStrIdZone(strId);
        }
    });

    tgTypeZone.selectedToggleProperty()
            .addListener((ObservableValue<? extends Toggle> ov, Toggle old_toggle, Toggle new_toggle) -> {
                if (tgTypeZone.getSelectedToggle() != null) {
                    strTypeZone = tgTypeZone.getSelectedToggle().getUserData().toString();
                    zone.setStrTypeZone(strTypeZone);
                }
            });

}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param stPrimaryStage//w  w  w  .ja v  a  2 s.co  m
 * @param iLargeur
 * @param iHauteur
 * @throws Exception Exceptions
 */
private static void creeEnvironnement(Stage stPrimaryStage, int iLargeur, int iHauteur) throws Exception {
    popUp = new PopUpDialogController();
    stPrimaryStage.setMaximized(true);
    stPrimaryStage.setMinWidth(1280);
    stPrimaryStage.setMinHeight(720);

    iHauteurInterface = iHauteur;
    iLargeurInterface = iLargeur;
    /**
     * Cration des lments constitutifs de l'cran
     */
    vbRacine = new VBox();
    AnchorPane panePrincipale = new AnchorPane(vbRacine);
    setScnPrincipale(new Scene(panePrincipale, iLargeur, iHauteur, Color.rgb(221, 221, 221)));
    if (!fileRepertConfig.exists()) {
        fileRepertConfig.mkdirs();
        setLocale(new Locale("fr", "FR"));
        File f = new File("css/clair.css");
        getScnPrincipale().getStylesheets().add("file:///" + f.getAbsolutePath().replace("\\", "/"));
        setStrRepertoireProjet(getStrRepertAppli());
    } else {
        lisFichierConfig();
    }

    creeMenu(vbRacine);
    tpEnvironnement = new TabPane();
    tpEnvironnement.setMinHeight(iHauteur - 60);
    tpEnvironnement.setMaxHeight(iHauteur - 60);
    tpEnvironnement.setMinWidth(iLargeur);
    tpEnvironnement.setMaxWidth(iLargeur);
    Pane paneBarreStatus = new Pane();
    paneBarreStatus.setPrefSize(iLargeur + 20, 30);
    paneBarreStatus.setTranslateY(25);
    paneBarreStatus.setStyle("-fx-background-color:#c00;-fx-border-color:#aaa");
    tabVisite = new Tab();
    Pane paneVisualiseur;
    Pane panePlan;
    setTabInterface(new Tab());
    setTabPlan(new Tab());
    getGestionnaireInterface().creeInterface(iLargeur, iHauteur - 78);
    paneVisualiseur = getGestionnaireInterface().paneTabInterface;
    getGestionnairePlan().creeInterface(iLargeur, iHauteur - 78);
    panePlan = getGestionnairePlan().getPaneInterface();
    getTabInterface().setContent(paneVisualiseur);
    getTabPlan().setContent(panePlan);

    HBox hbEnvironnement = new HBox();
    TextField tfTitrePano;
    TextField tfTitreVisite;

    tpEnvironnement.getTabs().addAll(tabVisite, getTabInterface(), getTabPlan());
    tpEnvironnement.setSide(Side.TOP);
    tpEnvironnement.getSelectionModel().selectedItemProperty()
            .addListener((ObservableValue<? extends Tab> ov, Tab t, Tab t1) -> {
                if (getGestionnaireInterface().navigateurCarteOL == null && isbInternet()) {
                    getGestionnaireInterface().navigateurCarteOL = new NavigateurOpenLayersSeul();
                    getGestionnaireInterface().apNavigateurCarte = getGestionnaireInterface().navigateurCarteOL
                            .afficheNavigateurOpenLayer();
                }
                getGestionnaireInterface().rafraichit();
            });
    tabInterface.disableProperty().addListener((ov, av, nv) -> {
        if (!nv && getGestionnaireInterface().navigateurCarteOL == null && isbInternet()) {
            getGestionnaireInterface().navigateurCarteOL = new NavigateurOpenLayersSeul();
            getGestionnaireInterface().navigateurCarteOL.setBingApiKey(getStrBingAPIKey());
            getGestionnaireInterface().apNavigateurCarte = getGestionnaireInterface().navigateurCarteOL
                    .afficheNavigateurOpenLayer();
        }
    });

    tabVisite.setText(rbLocalisation.getString("main.creationVisite"));
    tabVisite.setClosable(false);
    getTabInterface().setText(rbLocalisation.getString("main.creationInterface"));
    getTabInterface().setClosable(false);
    getTabPlan().setText(rbLocalisation.getString("main.tabPlan"));
    getTabPlan().setClosable(false);
    getTabPlan().setDisable(true);
    if (isbInternet()) {
        getTabInterface().setDisable(true);
    }
    tabVisite.setContent(hbEnvironnement);
    double largeur;
    String strLabelStyle = "-fx-color : white;-fx-background-color : #fff;-fx-padding : 5px;  -fx-border : 1px solid #777;-fx-width : 100px;-fx-margin : 5px; ";
    vbRacine.setStyle("-fx-font-size : 9pt;-fx-font-family: Arial;");
    vbRacine.setTranslateY(15);
    spPanneauOutils = new ScrollPane();
    spPanneauOutils.setId("panOutils");
    vbOutils = new VBox(-5);
    vbOutils.setPrefWidth(largeurOutils - 20);
    setVbChoixPanoramique(new VBox());
    getVbChoixPanoramique().setId("choixPanoramique");
    double largeurOutil = vbOutils.getPrefWidth();

    apPanovisu = new AnchorPane();
    apPanovisu.setPrefHeight(50);
    apPanovisu.setMinHeight(50);
    apPanovisu.setMaxHeight(50);

    apPanovisu.setMaxWidth(380);
    apPanovisu.setPrefWidth(380);
    apPanovisu.setMinWidth(380);
    apPanovisu.setLayoutX(iLargeur - 380);
    if (isMac()) {
        apPanovisu.setLayoutY(0);

    } else {
        apPanovisu.setLayoutY(45);
    }
    apPanovisu.setStyle("-fx-background-color : derive(-fx-base,20%);");

    ImageView ivPanoVisu = new ImageView(new Image(
            "file:" + getStrRepertAppli() + File.separator + "images/panovisu.png", 48, 48, true, true));
    ivPanoVisu.setLayoutX(40);
    ivPanoVisu.setLayoutY(1);
    Label lblPanoVisu = new Label("panoVisu Vers. : " + strNumVersion);
    lblPanoVisu.setStyle(
            "-fx-font-weight : bold;-fx-font-family : Verdana,Arial,sans-serif;-fx-font-size : 1.2em;");
    lblPanoVisu.setLayoutX(108);
    lblPanoVisu.setLayoutY(5);
    Label lblPanoVisu2 = new Label("Laurent LANG (2014-2015)");
    lblPanoVisu2.setLayoutX(108);
    lblPanoVisu2.setLayoutY(35);
    lblPanoVisu2.setStyle("-fx-font-family : Verdana,Arial,sans-serif;-fx-font-size : 0.8em;");
    apPanovisu.getChildren().addAll(ivPanoVisu, lblPanoVisu, lblPanoVisu2);
    panePrincipale.getChildren().add(apPanovisu);
    panePrincipale.getChildren().add(apWebview);
    apWebview.setVisible(false);
    apWebview.setStyle("-fx-background-color : #333;");
    apWebview.setPrefSize(iLargeur - 75, iHauteur - 80);
    apWebview.setMinSize(iLargeur - 75, iHauteur - 80);
    apWebview.setMaxSize(iLargeur - 75, iHauteur - 80);
    apWebview.setTranslateX(25);
    apWebview.setTranslateY(5);
    /*
     Paramtres de la visite
     */
    apParametresVisite = new AnchorPane();
    apParametresVisite.setLayoutY(40);
    Label lblTitreVisite = new Label(rbLocalisation.getString("main.titreVisite"));
    lblTitreVisite.setStyle("-fx-font-size : 10pt;-fx-font-weight : bold;");
    lblTitreVisite.setLayoutX(10);
    lblTitreVisite.setLayoutY(5);

    tfTitreVisite = new TextField();
    tfTitreVisite.setId("titreVisite");
    tfTitreVisite.setPrefSize(200, 25);
    tfTitreVisite.setMaxSize(250, 25);
    tfTitreVisite.setLayoutX(60);
    tfTitreVisite.setLayoutY(25);
    cbIntroPetitePlanete = new CheckBox(rbLocalisation.getString("main.introPetitePlanete"));
    cbIntroPetitePlanete.setSelected(false);
    cbIntroPetitePlanete.setLayoutX(10);
    cbIntroPetitePlanete.setLayoutY(60);

    Label lblChoixPanoramiqueEntree = new Label(rbLocalisation.getString("main.panoEntree"));
    lblChoixPanoramiqueEntree.setStyle("-fx-font-size : 1em;");
    lblChoixPanoramiqueEntree.setLayoutX(10);
    lblChoixPanoramiqueEntree.setLayoutY(90);
    lblChoixPanoramiqueEntree.setMaxWidth(largeurOutils - 40);
    lblChoixPanoramiqueEntree.setPrefHeight(35);
    lblChoixPanoramiqueEntree.setWrapText(true);

    apParametresVisite.setPrefHeight(120);
    apParametresVisite.getChildren().addAll(lblTitreVisite, tfTitreVisite, cbIntroPetitePlanete,
            lblChoixPanoramiqueEntree);
    PaneOutil poParametresVisite = new PaneOutil(rbLocalisation.getString("main.parametresVisite"),
            apParametresVisite, largeurOutil);
    setApPVIS(new AnchorPane(poParametresVisite.getApPaneOutil()));
    poParametresVisite.setbValide(isbIntroPetitePlanete());
    AnchorPane apAutoRotation = new AnchorPane();
    apAutoRotation.setPrefHeight(270);
    apAutoRotation.setLayoutY(40);
    PaneOutil poAutoRotation = new PaneOutil(rbLocalisation.getString("main.autoTourRotation"), apAutoRotation,
            largeurOutil);
    setApAR(new AnchorPane(poAutoRotation.getApPaneOutil()));
    poAutoRotation.setbValide(isbAutoRotationDemarre() || isbAutoTourDemarre());

    cbAutoRotationDemarrage = new CheckBox(rbLocalisation.getString("main.autoRotationDemarrage"));
    cbAutoRotationDemarrage.setSelected(false);
    cbAutoRotationDemarrage.setLayoutX(10);
    cbAutoRotationDemarrage.setLayoutY(10);

    Label lblVitesse = new Label(rbLocalisation.getString("main.autoRotationVitesse"));
    lblVitesse.setLayoutX(10);
    lblVitesse.setLayoutY(40);
    cbAutoRotationVitesse = new ComboBox();
    cbAutoRotationVitesse.getItems().add(0, "10 " + rbLocalisation.getString("main.parTour"));
    cbAutoRotationVitesse.getItems().add(1, "20 " + rbLocalisation.getString("main.parTour"));
    cbAutoRotationVitesse.getItems().add(2, "30 " + rbLocalisation.getString("main.parTour"));
    cbAutoRotationVitesse.getItems().add(3, "Autre n " + rbLocalisation.getString("main.parTour"));
    cbAutoRotationVitesse.getSelectionModel().select(2);
    cbAutoRotationVitesse.setLayoutX(30);
    cbAutoRotationVitesse.setLayoutY(70);
    cbAutoRotationVitesse.setMaxWidth(170);
    bdfAutoRotationVitesse = new BigDecimalField(new BigDecimal(40));
    bdfAutoRotationVitesse.setDisable(true);
    bdfAutoRotationVitesse.setLayoutX(210);
    bdfAutoRotationVitesse.setLayoutY(70);
    bdfAutoRotationVitesse.setMaxWidth(70);
    lblVitesse.disableProperty().bind(cbAutoRotationDemarrage.selectedProperty().not());
    cbAutoRotationVitesse.disableProperty().bind(cbAutoRotationDemarrage.selectedProperty().not());
    Label lblUnites = new Label(rbLocalisation.getString("main.parTour"));
    lblUnites.setLayoutX(290);
    lblUnites.setLayoutY(75);
    Separator spAutotour = new Separator(Orientation.HORIZONTAL);
    spAutotour.setLayoutX(0);
    spAutotour.setLayoutY(100);
    spAutotour.setMinWidth(380);

    cbAutoTourDemarrage = new CheckBox(rbLocalisation.getString("main.autoTour"));
    cbAutoTourDemarrage.setSelected(false);
    cbAutoTourDemarrage.setLayoutX(10);
    cbAutoTourDemarrage.setLayoutY(120);
    Label lblDemarrageAutoTour = new Label(rbLocalisation.getString("main.autoTourDemarrage"));
    lblDemarrageAutoTour.setLayoutX(10);
    lblDemarrageAutoTour.setLayoutY(150);
    bdfAutoTourDemarrage = new BigDecimalField(new BigDecimal(1));
    bdfAutoTourDemarrage.setLayoutX(240);
    bdfAutoTourDemarrage.setLayoutY(180);
    bdfAutoTourDemarrage.setMaxWidth(70);

    Label lblVitesseAutoTour = new Label(rbLocalisation.getString("main.autoTourChange"));
    lblVitesseAutoTour.setLayoutX(10);
    lblVitesseAutoTour.setLayoutY(210);

    cbAutoTourType = new ComboBox();
    cbAutoTourType.getItems().add(rbLocalisation.getString("main.nTours"));
    cbAutoTourType.getItems().add(rbLocalisation.getString("main.nSecondes"));
    cbAutoTourType.getSelectionModel().select(1);
    cbAutoTourType.setLayoutX(30);
    cbAutoTourType.setLayoutY(240);
    cbAutoTourType.setMaxWidth(140);
    bdfAutoTourLimite = new BigDecimalField(new BigDecimal(1));
    bdfAutoTourLimite.setLayoutX(240);
    bdfAutoTourLimite.setLayoutY(240);
    bdfAutoTourLimite.setMaxWidth(70);
    Label lblN = new Label("n=");
    lblN.setLayoutX(210);
    lblN.setLayoutY(245);
    cbAutoTourType.disableProperty().bind(cbAutoTourDemarrage.selectedProperty().not());
    bdfAutoTourLimite.disableProperty().bind(cbAutoTourDemarrage.selectedProperty().not());

    cbAutoRotationVitesse.getSelectionModel().selectedIndexProperty().addListener((ov, av, nv) -> {
        if (cbAutoRotationVitesse.getSelectionModel().getSelectedIndex() == 3) {
            bdfAutoRotationVitesse.setDisable(false);
            setiAutoRotationVitesse(bdfAutoRotationVitesse.getNumber().toBigInteger().intValue());
        } else {
            bdfAutoRotationVitesse.setDisable(true);
            setiAutoRotationVitesse(10 * (cbAutoRotationVitesse.getSelectionModel().getSelectedIndex() + 1));
        }
    });
    cbIntroPetitePlanete.selectedProperty().addListener((ov, av, nv) -> {
        setbIntroPetitePlanete(nv);
        poParametresVisite.setbValide(isbIntroPetitePlanete());
    });
    cbAutoRotationDemarrage.selectedProperty().addListener((ov, av, nv) -> {
        setbAutoRotationDemarre(nv);
        poAutoRotation.setbValide(isbAutoRotationDemarre() || isbAutoTourDemarre());
    });
    bdfAutoRotationVitesse.numberProperty().addListener((ov, av, nv) -> {
        setiAutoRotationVitesse(nv.toBigInteger().intValue());
    });

    cbAutoTourType.getSelectionModel().selectedIndexProperty().addListener((ov, av, nv) -> {
        if (cbAutoTourType.getSelectionModel().getSelectedIndex() == 0) {
            setStrAutoTourType("tours");
        } else {
            setStrAutoTourType("secondes");
        }
    });
    cbAutoTourDemarrage.selectedProperty().addListener((ov, av, nv) -> {
        setbAutoTourDemarre(nv);
        poAutoRotation.setbValide(isbAutoRotationDemarre() || isbAutoTourDemarre());
        getGestionnaireInterface().getApBtnVA().setDisable(!nv);
    });
    bdfAutoTourLimite.numberProperty().addListener((ov, av, nv) -> {
        setiAutoTourLimite(nv.toBigInteger().intValue());
    });
    bdfAutoTourDemarrage.numberProperty().addListener((ov, av, nv) -> {
        setiAutoTourDemarrage(nv.toBigInteger().intValue());
    });

    apAutoRotation.getChildren().addAll(cbAutoRotationDemarrage, lblVitesse, cbAutoRotationVitesse,
            bdfAutoRotationVitesse, lblUnites, spAutotour, cbAutoTourDemarrage, lblDemarrageAutoTour,
            bdfAutoTourDemarrage, lblVitesseAutoTour, cbAutoTourType, lblN, bdfAutoTourLimite);

    AnchorPane apParametresPano = new AnchorPane();
    apParametresPano.setPrefHeight(340);
    apParametresPano.setLayoutY(40);
    ImageView ivSupprPanoramique = new ImageView(
            new Image("file:" + getStrRepertAppli() + File.separator + "images/suppr.png", 48, 48, true, true));
    ImageView ivModifPanoramique = new ImageView(new Image(
            "file:" + getStrRepertAppli() + File.separator + "images/modifie.png", 48, 48, true, true));
    Button btnSupprimePano = new Button(rbLocalisation.getString("main.supprimePanoCourant"),
            ivSupprPanoramique);
    btnSupprimePano.setLayoutX(190);
    btnSupprimePano.setLayoutY(70);
    btnSupprimePano.setPrefSize(160, 60);
    btnSupprimePano.setMinSize(160, 60);
    btnSupprimePano.setMaxSize(160, 60);
    btnSupprimePano.setWrapText(true);
    btnSupprimePano.setOnAction((e) -> {
        retirePanoCourant();
    });
    Button btnModifiePano = new Button(rbLocalisation.getString("main.modifiePanoCourant"), ivModifPanoramique);
    btnModifiePano.setLayoutX(20);
    btnModifiePano.setLayoutY(70);
    btnModifiePano.setPrefSize(160, 60);
    btnModifiePano.setMinSize(160, 60);
    btnModifiePano.setMaxSize(160, 60);
    btnModifiePano.setWrapText(true);
    btnModifiePano.setOnAction((e) -> {
        String strRepertPano = getPanoramiquesProjet()[getiPanoActuel()].getStrNomFichier().substring(0,
                getPanoramiquesProjet()[getiPanoActuel()].getStrNomFichier().lastIndexOf(File.separator));
        FileChooser fileChooser = new FileChooser();
        FileChooser.ExtensionFilter extFilterImage = new FileChooser.ExtensionFilter(
                "Fichiers Image (JPG,BMP,TIFF)", "*.jpg", "*.bmp", "*.tif");
        FileChooser.ExtensionFilter extFilterJpeg = new FileChooser.ExtensionFilter("Fichiers JPEG (*.jpg)",
                "*.jpg");
        FileChooser.ExtensionFilter extFilterBmp = new FileChooser.ExtensionFilter("Fichiers BMP (*.bmp)",
                "*.bmp");
        FileChooser.ExtensionFilter extFilterTiff = new FileChooser.ExtensionFilter("Fichiers TIFF (*.tif)",
                "*.tif");
        File fileRepert = new File(strRepertPano + File.separator);
        fileChooser.setInitialDirectory(fileRepert);
        fileChooser.getExtensionFilters().addAll(extFilterJpeg, extFilterTiff, extFilterBmp, extFilterImage);

        File filePano = fileChooser.showOpenDialog(null);
        if (filePano != null) {
            setbDejaSauve(false);
            getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
            String strFilePano = filePano.getAbsolutePath();
            String strExtension = strFilePano.substring(strFilePano.length() - 3, strFilePano.length());
            Image imgPano = null;
            if ("tif".equals(strExtension)) {
                try {
                    imgPano = ReadWriteImage.readTiff(strFilePano);

                } catch (IOException | ImageReadException ex) {
                    Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
                }
            } else {
                imgPano = new Image("file:" + strFilePano);
            }
            if (imgPano != null) {
                if (imgPano.getWidth() == imgPano.getHeight()) {
                    try {
                        rechargePanoramiqueProjet(strFilePano, Panoramique.CUBE);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
                    }

                } else {
                    try {
                        rechargePanoramiqueProjet(strFilePano, Panoramique.SPHERE);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
                affichePanoChoisit(getiPanoActuel());
                if (apListePanoTriable != null) {
                    apParametresVisite.getChildren().remove(apListePanoTriable);
                }
                ordPano.rafraichitListe();
                ordPano.ajouteNouveauxPanos();
                apListePanoTriable = ordPano.getApListePanoramiques();
                apListePanoTriable.setMaxHeight(apListePanoTriable.getPrefHeight());
                apListePanoTriable.setMinHeight(apListePanoTriable.getPrefHeight());
                apListePanoTriable.setVisible(true);
                apParametresVisite.getChildren().remove(apListePanoTriable);
                apParametresVisite.getChildren().add(apListePanoTriable);
                apListePanoTriable.setLayoutX(40);
                apListePanoTriable.setLayoutY(130);
                apParametresVisite.setPrefHeight(120 + apListePanoTriable.getPrefHeight() + 20);
                if (apParametresVisite.isVisible()) {
                    apParametresVisite.setMinHeight(120 + apListePanoTriable.getPrefHeight() + 20);
                    apParametresVisite.setMaxHeight(120 + apListePanoTriable.getPrefHeight() + 20);
                }

                rafraichitListePano();

            }

        }

    });
    Label lblTitrePano = new Label(rbLocalisation.getString("main.titrePano"));
    lblTitrePano.setStyle("-fx-font-size : 1em;");
    lblTitrePano.setPadding(new Insets(5, 5, 5, 0));
    lblTitrePano.setLayoutX(10);
    lblTitrePano.setLayoutY(10);
    tfTitrePano = new TextField();
    tfTitrePano.setId("txttitrepano");
    tfTitrePano.setPrefSize(220, 25);
    tfTitrePano.setMaxSize(250, 25);
    tfTitrePano.setLayoutX(60);
    tfTitrePano.setLayoutY(40);

    tfTitrePano.textProperty().addListener((final ObservableValue<? extends String> observable,
            final String oldValue, final String newValue) -> {
        clickBtnValidePano();
    });

    slMinLat = new Slider(-90, -45, -90);
    slMinLat.setDisable(true);
    slMaxLat = new Slider(45, 90, 90);
    slMaxLat.setDisable(true);
    cbMinLat = new CheckBox(rbLocalisation.getString("main.blocageNadir"));
    cbMaxLat = new CheckBox(rbLocalisation.getString("main.blocageZenith"));
    slMinFov = new Slider(5, 70, 12);
    slMaxFov = new Slider(5, 70, 70);
    Label lblMinFov = new Label("min. hFOV : 12");
    Label lblMaxFov = new Label("max. hFOV : 70");
    slMinLat.disableProperty().bind(cbMinLat.selectedProperty().not());
    slMaxLat.disableProperty().bind(cbMaxLat.selectedProperty().not());
    slMinLat.setLayoutX(10);
    slMinLat.setLayoutY(160);
    cbMinLat.setLayoutX(190);
    cbMinLat.setLayoutY(160);
    slMaxLat.setLayoutX(10);
    slMaxLat.setLayoutY(190);
    cbMaxLat.setLayoutX(190);
    cbMaxLat.setLayoutY(190);
    slMinFov.setLayoutX(10);
    slMinFov.setLayoutY(220);
    lblMinFov.setLayoutX(190);
    lblMinFov.setLayoutY(220);
    slMaxFov.setLayoutX(10);
    slMaxFov.setLayoutY(250);
    lblMaxFov.setLayoutX(190);
    lblMaxFov.setLayoutY(250);
    Button btnBlocage = new Button(rbLocalisation.getString("main.blocage"));
    btnBlocage.setLayoutX(190);
    btnBlocage.setLayoutY(300);
    ligNadir = new Line();
    ligNadir.setVisible(false);
    ligNadir.setStroke(Color.YELLOW);
    ligNadir.setStrokeWidth(2);
    ligZenith = new Line();
    ligZenith.setVisible(false);
    ligZenith.setStroke(Color.YELLOW);
    ligZenith.setStrokeWidth(2);
    ligNadir.visibleProperty().bind(cbMinLat.selectedProperty());
    ligZenith.visibleProperty().bind(cbMaxLat.selectedProperty());

    slMinFov.valueProperty().addListener((observableValue, oldValue, newValue) -> {
        setbDejaSauve(false);
        getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");

        getPanoramiquesProjet()[iPanoActuel].setFovMin((double) newValue);
        double val1 = Math.round((double) newValue * 10) / 10;
        lblMinFov.setText("min. FOV : " + val1 + "");
        slMaxFov.setMin(val1);
        navigateurPanoramique.setMinFov(val1);
        if (navigateurPanoramique.getFov() < val1) {
            navigateurPanoramique.setFov(val1);

        }
        if (navigateurPanoramique.getChoixFov() < val1) {
            navigateurPanoramique.setChoixFov(val1);
        }
    });

    slMaxFov.valueProperty().addListener((observableValue, oldValue, newValue) -> {
        setbDejaSauve(false);
        getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");

        getPanoramiquesProjet()[iPanoActuel].setFovMax((double) newValue);
        double val1 = Math.round((double) newValue * 10) / 10;
        lblMaxFov.setText("max. FOV : " + val1 + "");
        slMinFov.setMax(val1);
        navigateurPanoramique.setMaxFov(val1);
        if (navigateurPanoramique.getFov() > val1) {
            navigateurPanoramique.setFov(val1);
        }
        if (navigateurPanoramique.getChoixFov() > val1) {
            navigateurPanoramique.setChoixFov(val1);
        }
    });

    slMinLat.valueProperty().addListener((observableValue, oldValue, newValue) -> {
        setbDejaSauve(false);
        getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");

        double largeurImage1 = panePanoramique.getPrefWidth();
        double X11 = ivImagePanoramique.getLayoutX();
        double Y1 = (90.0d - (double) newValue) * largeurImage1 / 360.0d;
        ligNadir.setStartX(X11);
        ligNadir.setStartY(Y1);
        ligNadir.setEndX(X11 + largeurImage1);
        ligNadir.setEndY(Y1);
        getPanoramiquesProjet()[iPanoActuel].setMinLat((double) newValue);
    });

    slMaxLat.valueProperty().addListener((observableValue, oldValue, newValue) -> {
        setbDejaSauve(false);
        getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");

        double largeurImage1 = panePanoramique.getPrefWidth();
        double X11 = ivImagePanoramique.getLayoutX();
        double Y1 = (90.0d - (double) newValue) * largeurImage1 / 360.0d;
        ligZenith.setStartX(X11);
        ligZenith.setStartY(Y1);
        ligZenith.setEndX(X11 + largeurImage1);
        ligZenith.setEndY(Y1);
        getPanoramiquesProjet()[iPanoActuel].setMaxLat((double) newValue);
    });

    cbMinLat.selectedProperty().addListener((ov, av, nv) -> {
        setbDejaSauve(false);
        getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");

        double largeurImage1 = panePanoramique.getPrefWidth();
        double X11 = ivImagePanoramique.getLayoutX();
        double Y1 = (90.0d - (double) slMinLat.getValue()) * largeurImage1 / 360.0d;
        ligNadir.setStartX(X11);
        ligNadir.setStartY(Y1);
        ligNadir.setEndX(X11 + largeurImage1);
        ligNadir.setEndY(Y1);
        getPanoramiquesProjet()[iPanoActuel].setbMinLat(nv);
    });

    cbMaxLat.selectedProperty().addListener((ov, av, nv) -> {
        setbDejaSauve(false);
        getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");

        double largeurImage1 = panePanoramique.getPrefWidth();
        double X11 = ivImagePanoramique.getLayoutX();
        double Y1 = (90.0d - (double) (double) slMaxLat.getValue()) * largeurImage1 / 360.0d;
        ligZenith.setStartX(X11);
        ligZenith.setStartY(Y1);
        ligZenith.setEndX(X11 + largeurImage1);
        ligZenith.setEndY(Y1);
        getPanoramiquesProjet()[iPanoActuel].setbMaxLat(nv);
    });

    btnBlocage.setOnAction((e) -> {
        setbDejaSauve(false);
        getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");

        for (int i = 0; i < iNombrePanoramiques; i++) {
            getPanoramiquesProjet()[i].setbMaxLat(getPanoramiquesProjet()[iPanoActuel].isbMaxLat());
            getPanoramiquesProjet()[i].setbMinLat(getPanoramiquesProjet()[iPanoActuel].isbMinLat());
            getPanoramiquesProjet()[i].setMaxLat(getPanoramiquesProjet()[iPanoActuel].getMaxLat());
            getPanoramiquesProjet()[i].setMinLat(getPanoramiquesProjet()[iPanoActuel].getMinLat());
            getPanoramiquesProjet()[i].setFovMax(getPanoramiquesProjet()[iPanoActuel].getFovMax());
            getPanoramiquesProjet()[i].setFovMin(getPanoramiquesProjet()[iPanoActuel].getFovMin());
        }
    });

    apParametresPano.getChildren().addAll(btnModifiePano, btnSupprimePano, lblTitrePano, tfTitrePano, slMaxLat,
            cbMaxLat, slMinLat, cbMinLat, slMinFov, lblMinFov, slMaxFov, lblMaxFov, btnBlocage);

    setApPPAN(new AnchorPane(
            new PaneOutil(true, rbLocalisation.getString("main.parametresPano"), apParametresPano, largeurOutil)
                    .getApPaneOutil()));

    setApGEO(new AnchorPane());
    apOpenLayers = new AnchorPane();
    apOpenLayers.setVisible(false);
    if (isbInternet()) {
        navigateurOpenLayers = new NavigateurOpenLayers();
        navigateurOpenLayers.setBingApiKey(getStrBingAPIKey());
        tfLongitude = new TextField();
        tfLatitude = new TextField();
        apOpenLayers = navigateurOpenLayers.afficheNavigateurOpenLayer(tfLongitude, tfLatitude, true);
        apOpenLayers.setPrefSize(800, 600);
        Button btnGeolocalise = new Button(rbLocalisation.getString("main.geolocalisation"));

        btnGeolocalise.setLayoutX(10);
        btnGeolocalise.setLayoutY(25);
        btnGeolocalise.setPrefWidth(120);
        btnGeolocalise.setOnAction((e) -> {
            navigateurOpenLayers.retireMarqueur(0);
            if (navigateurOpenLayers.getBingApiKey().equals("")) {
                navigateurOpenLayers.afficheCartesOpenlayer();
            } else {
                navigateurOpenLayers.valideBingApiKey(navigateurOpenLayers.getBingApiKey());
            }
            if (panoramiquesProjet[getiPanoActuel()].getMarqueurGeolocatisation() != null) {
                navigateurOpenLayers.allerCoordonnees(
                        panoramiquesProjet[getiPanoActuel()].getMarqueurGeolocatisation(), 17);
                navigateurOpenLayers
                        .setMarqueur(panoramiquesProjet[getiPanoActuel()].getMarqueurGeolocatisation());
                String strFichierPano = getPanoramiquesProjet()[getiPanoActuel()].getStrNomFichier()
                        .substring(
                                getPanoramiquesProjet()[getiPanoActuel()].getStrNomFichier()
                                        .lastIndexOf(File.separator) + 1,
                                getPanoramiquesProjet()[getiPanoActuel()].getStrNomFichier().length())
                        .split("\\.")[0];
                String strHTML = "<span style='font-family : Verdana,Arial,sans-serif;font-weight:bold;font-size : 12px;'>"
                        + getPanoramiquesProjet()[getiPanoActuel()].getStrTitrePanoramique() + "</span><br/>"
                        + "<span style='font-family : Verdana,Arial,sans-serif;bold;font-size : 10px;'>"
                        + strFichierPano + "</span>";
                strHTML = strHTML.replace("\\", "/");
                navigateurOpenLayers.ajouteMarqueur(0,
                        panoramiquesProjet[getiPanoActuel()].getMarqueurGeolocatisation(), strHTML);
            }
            apOpenLayers.setVisible(true);
        });
        tfLatitude.setLayoutX(140);
        tfLatitude.setLayoutY(10);
        tfLongitude.setLayoutX(140);
        tfLongitude.setLayoutY(40);
        apOpenLayers.setLayoutX(200);
        apOpenLayers.setLayoutY(150);
        apOpenLayers.setVisible(false);
        AnchorPane apGeolocalise = new AnchorPane();
        apGeolocalise.setPrefHeight(75);
        apGeolocalise.getChildren().addAll(btnGeolocalise, tfLatitude, tfLongitude);
        apGeolocalise.setLayoutX(10);
        apGeolocalise.setLayoutY(40);
        setPoGeolocalisation(
                new PaneOutil(rbLocalisation.getString("main.geolocalisation"), apGeolocalise, largeurOutil));
        setApGEO(new AnchorPane(getPoGeolocalisation().getApPaneOutil()));

        apOpenLayers.setLayoutX((iLargeur - apOpenLayers.getPrefWidth()) / 2);
        apOpenLayers.setLayoutY((iHauteur - apOpenLayers.getPrefHeight()) / 2);
        apOpenLayers.visibleProperty().addListener((ov, av, nv) -> {
            mbarPrincipal.setDisable(nv);
            hbBarreBouton.setDisable(nv);
            tpEnvironnement.setDisable(nv);

        });
    }
    apVisuPanoramique.setLayoutY(40);
    apVisuPanoramique.setPrefWidth(340);
    apVisuPanoramique.setPrefHeight(295);

    setApVISU(new AnchorPane(
            new PaneOutil(true, rbLocalisation.getString("main.visualisation"), apVisuPanoramique, largeurOutil)
                    .getApPaneOutil()));

    vbVisuHotspots = new VBox();
    apVisuHS = new AnchorPane(vbVisuHotspots);
    apVisuHS.setLayoutY(40);
    apHS1 = new PaneOutil(true, "Hotspots", apVisuHS, largeurOutil);

    setApHS(new AnchorPane(apHS1.getApPaneOutil()));

    getVbChoixPanoramique().getChildren().addAll(getApPVIS(), getApAR(), getApPPAN(), getApGEO(), getApVISU(),
            getApHS());
    getVbChoixPanoramique().setSpacing(-5);
    vbOutils.getChildren().addAll(getVbChoixPanoramique());
    getVbChoixPanoramique().setVisible(false);
    /*
     Cration du panneau d'info du panoramique
     */

    spVuePanoramique = new ScrollPane();

    hbCoordonnees = new HBox();
    panePanoramique = new Pane();
    apPanneauPrincipal = new AnchorPane();
    lblLong = new Label("");
    lblLat = new Label("");
    ivImagePanoramique = new ImageView();

    stPrimaryStage.setScene(getScnPrincipale());

    /**
     *
     */
    spVuePanoramique.setPrefSize(iLargeur - largeurOutils - 20, iHauteur - 110);
    spVuePanoramique.setMaxSize(iLargeur - largeurOutils - 20, iHauteur - 110);
    spVuePanoramique.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    spVuePanoramique.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    spVuePanoramique.setTranslateY(5);
    /**
     *
     */
    AnchorPane apPanneauOutils = new AnchorPane();
    apPanneauOutils.getChildren().addAll(spPanneauOutils);
    apPanneauOutils.setTranslateY(3);
    apPanneauOutils.setTranslateX(20);
    spPanneauOutils.setContent(vbOutils);
    spPanneauOutils.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
    spPanneauOutils.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    spPanneauOutils.setPrefSize(largeurOutils, iHauteur - 112);
    spPanneauOutils.setMaxWidth(largeurOutils);
    spPanneauOutils.setMaxHeight(iHauteur - 112);
    spPanneauOutils.setLayoutY(0);
    spPanneauOutils.setLayoutX(0);
    /**
     *
     */
    panePanoramique.setCursor(Cursor.CROSSHAIR);
    vbOutils.setPrefWidth(largeurOutils - 20);
    vbOutils.minHeight(iHauteur - 110);
    vbOutils.setLayoutX(3);
    lblLong.setPrefSize(100, 15);
    lblLat.setPrefSize(100, 15);
    lblLat.setTranslateX(50);
    apPanneauPrincipal.setPrefSize(iLargeur - largeurOutils - 20, iHauteur - 110);
    apListeImagesPanoramiques = new AnchorPane();
    apListeImagesPanoramiques.setPrefWidth(iLargeurVignettes + 40);
    apListeImagesPanoramiques.setMinWidth(iLargeurVignettes + 40);
    apListeImagesPanoramiques.setMaxWidth(iLargeurVignettes + 40);
    apListeImagesPanoramiques.setPrefHeight(iHauteur - 140);
    apListeImagesPanoramiques.setLayoutX(-iLargeurVignettes - 30);
    apListeImagesPanoramiques.setLayoutY(0);
    apListeImagesPanoramiques.setStyle("-fx-background-color :rgba(0,0,0,0);");
    apListeImagesPanoramiques.setOnMouseEntered((e) -> {
        apListeImagesPanoramiques.setLayoutX(0);
    });
    apListeImagesPanoramiques.setOnMouseExited((e) -> {
        apListeImagesPanoramiques.setLayoutX(-iLargeurVignettes - 30);
    });
    Label lblVignettes = new Label(rbLocalisation.getString("main.vignettes"));
    lblVignettes.setPrefSize(70, 20);
    lblVignettes.setTextAlignment(TextAlignment.CENTER);
    lblVignettes.setStyle("-fx-background-color:-fx-base;" + "-fx-border-color: derive(-fx-base,10%);"
            + "-fx-border-width: 1px;");
    lblVignettes.setTranslateX(-lblVignettes.getPrefWidth() / 2 + lblVignettes.getPrefHeight() / 2);
    lblVignettes.setTranslateY(lblVignettes.getPrefWidth() / 2 - lblVignettes.getPrefHeight() / 2);
    lblVignettes.setRotate(270);
    lblVignettes.setLayoutX(iLargeurVignettes + 30);
    apVignettesPano = new AnchorPane();
    apVignettesPano.setPrefWidth(iLargeurVignettes + 10);
    apVignettesPano.setMinHeight(iHauteur - 140);
    apVignettesPano.setStyle("-fx-background-color:-fx-base;");
    rectVignettePano = new Rectangle(0, 0, iLargeurVignettes, iLargeurVignettes / 2.d);
    rectVignettePano.setLayoutX(5);
    rectVignettePano.setLayoutY(10);
    rectVignettePano.setFill(Color.web("#fff", 0.5));
    rectVignettePano.setStroke(Color.WHITE);
    rectVignettePano.setStrokeWidth(2.0);
    rectVignettePano.setVisible(false);
    apVignettesPano.getChildren().add(rectVignettePano);
    ScrollPane spListeImagesPanoramiques = new ScrollPane(apVignettesPano);
    spListeImagesPanoramiques.setPrefWidth(iLargeurVignettes + 30);
    spListeImagesPanoramiques.setPrefHeight(iHauteur - 130);
    spListeImagesPanoramiques.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
    spListeImagesPanoramiques
            .setStyle("-fx-background-color:-fx-base;" + "-fx-border-color: derive(-fx-base,10%);"
                    + "-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.2) , 8, 0.0 , 0 , 8 );"
                    + "-fx-border-width: 1px;");
    apListeImagesPanoramiques.getChildren().addAll(spListeImagesPanoramiques, lblVignettes);

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

    panePanoramique.setLayoutY(20);
    lblLong.setTranslateX(50);
    lblLat.setTranslateX(80);
    hbCoordonnees.getChildren().setAll(lblLong, lblLat);
    spVuePanoramique.setContent(apPanneauPrincipal);
    hbEnvironnement.getChildren().setAll(spVuePanoramique, apPanneauOutils);
    apEnvironnement = new AnchorPane();
    setApAttends(new AnchorPane());
    getApAttends().setPrefHeight(250);
    getApAttends().setPrefWidth(600);
    getApAttends().setMaxWidth(600);
    getApAttends().setStyle("-fx-background-color : -fx-base;" + "-fx-border-color: derive(-fx-base,10%);"
            + "-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.5) , 8, 0.0 , 0 , 8 );"
            + "-fx-border-width: 1px;");
    getApAttends().setLayoutX((iLargeur - getApAttends().getPrefWidth()) / 2.d);
    getApAttends().setLayoutY((iHauteur - getApAttends().getPrefHeight()) / 2.d - 55);
    pbarAvanceChargement = new ProgressBar();
    pbarAvanceChargement.setPrefSize(400, 30);
    pbarAvanceChargement.setLayoutX((getApAttends().getPrefWidth() - pbarAvanceChargement.getPrefWidth()) / 2);
    pbarAvanceChargement.setLayoutY(70);
    Label lblAttends = new Label(rbLocalisation.getString("main.attendsChargement"));
    lblAttends.setMinWidth(600);
    lblAttends.setAlignment(Pos.CENTER);
    lblAttends.setStyle("-fx-background-color : #777;");
    lblAttends.setTextFill(Color.WHITE);
    lblAttends.setLayoutY(5);
    lblAttends.setFont(Font.font(14));
    lblCharge = new Label();
    lblCharge.setMinWidth(600);
    lblCharge.setLayoutY(150);
    lblCharge.setAlignment(Pos.CENTER);
    lblNiveaux = new Label();
    lblNiveaux.setMinWidth(600);
    lblNiveaux.setLayoutY(180);
    lblNiveaux.setAlignment(Pos.CENTER);
    getApAttends().getChildren().addAll(lblAttends, pbarAvanceChargement, lblCharge, lblNiveaux);
    getApAttends().setVisible(false);
    apEnvironnement.getChildren().addAll(tpEnvironnement, getApAttends());
    if (isMac()) {
        apEnvironnement.setTranslateY(-30);
    }
    vbRacine.getChildren().addAll(apEnvironnement);
    apPanneauPrincipal.getChildren().setAll(hbCoordonnees, panePanoramique);
    stPrimaryStage.show();
    popUp.affichePopup();
    lblDragDrop = new Label(rbLocalisation.getString("main.dragDrop"));
    lblDragDrop.setMinHeight(spVuePanoramique.getPrefHeight());
    lblDragDrop.setMaxHeight(spVuePanoramique.getPrefHeight());
    lblDragDrop.setMinWidth(spVuePanoramique.getPrefWidth());
    lblDragDrop.setMaxWidth(spVuePanoramique.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);

    apLoupe.setLayoutX(35);
    apLoupe.setLayoutY(35);
    apLoupe.setVisible(false);

    apPanneauPrincipal.getChildren().addAll(lblDragDrop, spAfficheLegende(), apLoupe,
            apListeImagesPanoramiques);

    apCreationBarre = new AnchorPane();
    apCreationBarre.setVisible(false);
    apCreationDiaporama = new AnchorPane();
    apCreationDiaporama.setVisible(false);
    apEnvironnement.getChildren().addAll(apCreationBarre, apCreationDiaporama, apOpenLayers);
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param strNomFichierBarre//ww w.ja va  2s. co  m
 */
public static void creerEditerBarre(String strNomFichierBarre) {
    apCreationBarre.getChildren().clear();
    apCreationBarre.setStyle("-fx-background-color : -fx-base;" + "-fx-border-color: derive(-fx-base,10%);"
            + "-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.5) , 8, 0.0 , 0 , 8 );"
            + "-fx-border-width: 1px;");

    AnchorPane apOutilsBarre = new AnchorPane();
    Button btnAnnulerBarre = new Button(rbLocalisation.getString("main.quitter"),
            new ImageView(new Image("file:" + getStrRepertAppli() + "/images/annule.png")));
    final Button btnSauverBarre = new Button(rbLocalisation.getString("main.sauver"), new ImageView(
            new Image("file:" + getStrRepertAppli() + "/images/sauveProjet.png", 24, 24, true, true, true)));
    Rectangle2D tailleEcran = Screen.getPrimary().getBounds();
    btnAjouteZone = new Button(rbLocalisation.getString("main.ajouteZone"), new ImageView(
            new Image("file:" + getStrRepertAppli() + "/images/btn+.png", 24, 24, true, true, true)));
    apImgBarrePersonnalisee = new AnchorPane();
    apImgBarrePersonnalisee.getChildren().clear();
    apZoneBarrePersonnalisee = new AnchorPane();
    apZoneBarrePersonnalisee.getChildren().clear();
    apZoneBarrePersonnalisee.setLayoutX(0);
    apZoneBarrePersonnalisee.setLayoutY(150);
    apZoneBarrePersonnalisee.setPrefWidth(300);
    apZoneBarrePersonnalisee.setPrefHeight(200);

    int iLargeurEcran = (int) tailleEcran.getWidth();
    int iHauteurEcran = (int) tailleEcran.getHeight() - 100;
    final int iLargeur = 1200;
    final int iHauteur = 600;
    mbarPrincipal.setDisable(true);
    bbarPrincipal.setDisable(true);
    hbBarreBouton.setDisable(true);
    tpEnvironnement.setDisable(true);
    apCreationBarre.setPrefWidth(iLargeur);
    apCreationBarre.setMinWidth(iLargeur);
    apCreationBarre.setMaxWidth(iLargeur);
    apCreationBarre.setPrefHeight(iHauteur);
    apCreationBarre.setMinHeight(iHauteur);
    apCreationBarre.setMaxHeight(iHauteur);
    apCreationBarre.setLayoutX((iLargeurEcran - iLargeur) / 2);
    apCreationBarre.setLayoutY((iHauteurEcran - iHauteur) / 2);
    apCreationBarre.setVisible(true);
    Label lblBarrePersonnalisee = new Label(rbLocalisation.getString("main.creeBarrePersonnalisee"));
    lblBarrePersonnalisee.setMinWidth(iLargeur - 10);
    lblBarrePersonnalisee.setAlignment(Pos.CENTER);
    lblBarrePersonnalisee.setStyle("-fx-background-color : #777;");
    lblBarrePersonnalisee.setTextFill(Color.WHITE);
    lblBarrePersonnalisee.setLayoutX(5);
    lblBarrePersonnalisee.setLayoutY(10);
    lblBarrePersonnalisee.setFont(Font.font(14));
    apCreationBarre.getChildren().add(lblBarrePersonnalisee);
    apOutilsBarre.setPrefWidth(300);
    apOutilsBarre.setMinWidth(300);
    apOutilsBarre.setMaxWidth(300);
    apOutilsBarre.setPrefHeight(iHauteur - 50);
    apOutilsBarre.setMinHeight(iHauteur - 50);
    apOutilsBarre.setMaxHeight(iHauteur - 50);
    apOutilsBarre.setLayoutX(iLargeur - 302);
    apOutilsBarre.setLayoutY(50);

    apOutilsBarre.setStyle(
            "-fx-background-color : -fx-background;-fx-border-width : 1px;-fx-border-color : transparent transparent transparent -fx-outer-border;");
    btnAnnulerBarre.setPrefWidth(120);
    btnAnnulerBarre.setLayoutX(30);
    btnAnnulerBarre.setLayoutY(iHauteur - 90);
    btnSauverBarre.setPrefWidth(120);
    btnSauverBarre.setLayoutX(160);
    btnSauverBarre.setLayoutY(iHauteur - 90);
    btnSauverBarre.setDisable(true);
    Label lblChargeImage = new Label(rbLocalisation.getString("main.chargeImage"));
    lblChargeImage.setLayoutX(20);
    lblChargeImage.setLayoutY(10);
    TextField tfChargeImage = new TextField("");
    tfChargeImage.setDisable(true);
    tfChargeImage.setPrefWidth(200);
    tfChargeImage.setLayoutX(50);
    tfChargeImage.setLayoutY(40);
    Button btnChargeImage = new Button("...");
    btnChargeImage.setLayoutX(260);
    btnChargeImage.setLayoutY(40);
    final CheckBox cbMasqueZones = new CheckBox(rbLocalisation.getString("main.masqueZones"));
    cbMasqueZones.setDisable(true);
    cbMasqueZones.setLayoutX(20);
    cbMasqueZones.setLayoutY(70);
    btnAjouteZone.setLayoutX(130);
    btnAjouteZone.setLayoutY(110);
    btnAjouteZone.setDisable(true);
    apOutilsBarre.getChildren().addAll(lblChargeImage, tfChargeImage, btnChargeImage, cbMasqueZones,
            btnAjouteZone, apZoneBarrePersonnalisee, btnAnnulerBarre, btnSauverBarre);

    apCreationBarre.getChildren().addAll(apImgBarrePersonnalisee, apOutilsBarre);
    if (!strNomFichierBarre.equals("")) {
        lblChargeImage.setVisible(false);
        tfChargeImage.setVisible(false);
        btnChargeImage.setVisible(false);
        String strNomFichier = strNomFichierBarre;
        strNomFichier = strNomFichier.substring(0, strNomFichier.length() - 4);
        strNomFichierShp = strNomFichier + ".shp";
        String strNomFichierPng = strNomFichier + ".png";
        File fichPng = new File(strNomFichierPng);
        if (fichPng.exists()) {
            try {
                btnAjouteZone.setDisable(false);
                imgBarrePersonnalisee = new Image("file:" + fichPng);
                iNombreZones = getGestionnaireInterface().lisFichierShp(strNomFichierShp, zones);
                btnSauverBarre.setDisable(false);
                if (iNombreZones > 0) {
                    cbMasqueZones.setDisable(false);
                }
                afficheBarrePersonnalisee(iLargeur, iHauteur, false);

            } catch (IOException ex) {
                Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
            }

        }
    }

    btnAnnulerBarre.setOnMouseClicked((t) -> {
        mbarPrincipal.setDisable(false);
        bbarPrincipal.setDisable(false);
        hbBarreBouton.setDisable(false);
        tpEnvironnement.setDisable(false);
        apCreationBarre.setVisible(false);
    });

    btnAjouteZone.setOnMouseClicked((t) -> {
        btnAjouteZone.setDisable(true);
        ajouterZone(iLargeur, iHauteur, false);
    });
    btnChargeImage.setOnMouseClicked((t) -> {
        strRepertBarrePersonnalisee = getStrRepertAppli() + "/theme/telecommandes";
        File fileRepert;
        fileRepert = new File(strRepertBarrePersonnalisee);
        FileChooser fileChooser = new FileChooser();
        FileChooser.ExtensionFilter efShpFilter = new FileChooser.ExtensionFilter(
                "Fichiers barre personnalise (SHP)", "*.shp", "*.png");

        fileChooser.setInitialDirectory(fileRepert);
        fileChooser.getExtensionFilters().addAll(efShpFilter);

        File fileFichierImage = fileChooser.showOpenDialog(null);
        if (fileFichierImage != null) {
            String strNomFichier = fileFichierImage.getAbsolutePath();
            strNomFichier = strNomFichier.substring(0, strNomFichier.length() - 4);
            strNomFichierShp = strNomFichier + ".shp";
            String strNomFichierPng = strNomFichier + ".png";
            File fileFichierPng = new File(strNomFichierPng);
            if (fileFichierPng.exists()) {
                try {
                    btnAjouteZone.setDisable(false);
                    imgBarrePersonnalisee = new Image("file:" + fileFichierPng);
                    iNombreZones = getGestionnaireInterface().lisFichierShp(strNomFichierShp, zones);
                    btnSauverBarre.setDisable(false);
                    if (iNombreZones > 0) {
                        cbMasqueZones.setDisable(false);
                    }
                    afficheBarrePersonnalisee(iLargeur, iHauteur, false);

                } catch (IOException ex) {
                    Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
    });

    btnSauverBarre.setOnMouseClicked((t) -> {
        try {
            sauverBarre(strNomFichierShp);
            getGestionnaireInterface().chargeBarrePersonnalisee(strNomFichierBarre);

        } catch (IOException ex) {
            Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
        }
    });
    cbMasqueZones.selectedProperty()
            .addListener((ObservableValue<? extends Boolean> ov, Boolean old_val, Boolean new_val) -> {
                afficheBarrePersonnalisee(iLargeur, iHauteur, new_val);
            });

}

From source file:photobooth.views.EmailPane.java

private void addXButton() {
    Button button = new Button();
    try {//from  www.  ja  va2s. com
        button.setGraphic(
                new ImageView(new Image(getClass().getResource("/photobooth/images/exit.png").openStream())));
    } catch (IOException ex) {
        Logger.getLogger(EmailPane.class.getName()).log(Level.SEVERE, null, ex);
    }
    button.setStyle("-fx-background-color: transparent;");
    button.setLayoutX(730);
    button.setLayoutY(10);
    button.setMaxSize(50, 50);
    button.setMinSize(50, 50);
    button.getStyleClass().add("blueButton");
    this.getChildren().add(button);
    button.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
            t.cancel();
            t.purge();
            Global.getInstance().setSceneRoot(HomePane.getInstance());
        }
    });
}

From source file:photobooth.views.ExplorerPane.java

private void addXButton() throws IOException {
    Button button = new Button();
    button.setGraphic(/*from ww w  .j a  v  a2s.c o m*/
            new ImageView(new Image(getClass().getResource("/photobooth/images/exit.png").openStream())));
    button.setStyle("-fx-background-color: transparent;");
    button.setLayoutX(730);
    button.setLayoutY(10);
    button.setMaxSize(50, 50);
    button.setMinSize(50, 50);
    button.getStyleClass().add("blueButton");
    this.getChildren().add(button);
    button.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
            Global.getInstance().setSceneRoot(HomePane.getInstance());
        }
    });
}

From source file:photobooth.views.ExplorerPane.java

private void addUpButton() throws IOException {
    Button button = new Button();
    button.setGraphic(//w  w w  . ja v  a2s.  c  o m
            new ImageView(new Image(getClass().getResource("/photobooth/images/up.png").openStream())));
    button.setStyle("-fx-background-color: transparent;");
    button.setMaxSize(50, 50);
    button.setMinSize(50, 50);
    button.setLayoutX(120);
    button.setLayoutY(10);
    this.getChildren().add(button);
    button.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
            Global.getInstance().setSceneRoot(LoadingPane.getInstance());

            Platform.runLater(() -> {
                new Thread(new Runnable() {

                    @Override
                    public void run() {
                        ExplorerPane.getInstance().setDir(new File(dir).getParentFile().getAbsolutePath(), 0,
                                limit, directoryLevel - 1);
                        Global.getInstance().setSceneRoot(ExplorerPane.getInstance());
                    }
                }).start();
            });

        }
    });

}