Example usage for javafx.scene.layout Pane setId

List of usage examples for javafx.scene.layout Pane setId

Introduction

In this page you can find the example usage for javafx.scene.layout Pane setId.

Prototype

public final void setId(String value) 

Source Link

Usage

From source file:net.rptools.layercontrol.LayerStackLayer.java

/**
 * Add a layer./*from  w ww .j  a va  2s .  c om*/
 * @param i index to add at
 * @param layer layer to add
 */
@ThreadPolicy(ThreadPolicy.ThreadId.ANY)
public synchronized void addLayer(final int i, final Layer layer) {
    if (!Platform.isFxApplicationThread()) {
        Platform.runLater(new Runnable() {
            @Override
            public void run() {
                addLayer(i, layer);
            }
        });
    }
    // Now on JFX thread
    Pane pane = new Pane();
    final String resource = "layer" + layer.getName() + ".fxml";
    try {
        pane = component.getFramework().getFXMLLoader(layer.getClass().getResource(resource)).load();
    } catch (final Exception e) {
        LOGGER.warn("no layer pane found resource={}", resource);
    }
    pane.getStyleClass().add(layer.getName().toLowerCase());
    pane.setId(StringUtils.uncapitalize(layer.getName()));
    pane.minWidthProperty().bind(getDrawable().widthProperty());
    pane.minHeightProperty().bind(getDrawable().heightProperty());
    final int size = getDrawable().getChildren().size();
    getDrawable().getChildren().add(size - i, pane);
    layer.setDrawable(pane);
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 *///from  www. j  a  va  2s .c o  m
private void ajouteAffichageHotspots() {
    Pane lbl = affichageHS(listePano(panoActuel), panoActuel);
    lbl.setId("labels");
    outils.getChildren().add(lbl);
    numPoints = panoramiquesProjet[panoActuel].getNombreHotspots();
    numImages = panoramiquesProjet[panoActuel].getNombreHotspotImage();
    numHTML = panoramiquesProjet[panoActuel].getNombreHotspotHTML();
}

From source file:editeurpanovisu.EditeurPanovisu.java

private void panoAjouteImage(double X, double Y) {
    if (X > 0 && X < imagePanoramique.getFitWidth()) {

        valideHS();//from   w  w  w.  j av a 2  s. c o  m
        dejaSauve = false;
        stPrincipal.setTitle(stPrincipal.getTitle().replace(" *", "") + " *");
        double mouseX = X;
        double mouseY = Y - pano.getLayoutY() - 115;
        double longitude, latitude;
        double largeur = imagePanoramique.getFitWidth();
        String chLong, chLat;
        longitude = 360.0f * mouseX / largeur - 180;
        latitude = 90.0d - 2.0f * mouseY / largeur * 180.0f;
        Circle point = new Circle(mouseX, mouseY, 5);
        point.setFill(Color.BLUE);
        point.setStroke(Color.YELLOW);
        point.setId("img" + numImages);
        point.setCursor(Cursor.DEFAULT);
        pano.getChildren().add(point);
        Tooltip t = new Tooltip("image n " + (numImages + 1));
        t.setStyle(tooltipStyle);
        Tooltip.install(point, t);

        //
        File repert;
        if (repertHSImages.equals("")) {
            repert = new File(currentDir + File.separator);
        } else {
            repert = new File(repertHSImages);
        }
        FileChooser fileChooser = new FileChooser();
        FileChooser.ExtensionFilter extFilterImages = new FileChooser.ExtensionFilter(
                "Fichiers Images (jpg, bmp, png)", "*.jpg", "*.bmp", "*.png");

        fileChooser.setInitialDirectory(repert);
        fileChooser.getExtensionFilters().addAll(extFilterImages);

        File fichierImage = fileChooser.showOpenDialog(null);
        if (fichierImage != null) {
            repertHSImages = fichierImage.getParent();
            numImages++;
            HotspotImage HS = new HotspotImage();
            HS.setLongitude(longitude);
            HS.setLatitude(latitude);
            HS.setUrlImage(fichierImage.getAbsolutePath());
            HS.setLienImg(fichierImage.getName());
            HS.setInfo(fichierImage.getName().split("\\.")[0]);
            File repertImage = new File(repertTemp + File.separator + "images");
            if (!repertImage.exists()) {
                repertImage.mkdirs();
            }
            try {
                copieFichierRepertoire(fichierImage.getAbsolutePath(), repertImage.getAbsolutePath());
            } catch (IOException ex) {
                Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
            }
            panoramiquesProjet[panoActuel].addHotspotImage(HS);
            retireAffichageHotSpots();
            Pane affHS1 = affichageHS(listePano(panoActuel), panoActuel);
            affHS1.setId("labels");
            outils.getChildren().add(affHS1);

        } else {
            String chPoint = point.getId();
            chPoint = chPoint.substring(3, chPoint.length());
            Node pt = (Node) pano.lookup("#img" + chPoint);
            pano.getChildren().remove(pt);
        }
        valideHS();
        point.setOnDragDetected((MouseEvent me1) -> {
            point.setFill(Color.YELLOW);
            point.setStroke(Color.BLUE);
            dragDrop = true;
            me1.consume();

        });
        point.setOnMouseDragged((MouseEvent me1) -> {
            double XX = me1.getX() - imagePanoramique.getLayoutX();
            if (XX < 0) {
                XX = 0;
            }
            if (XX > imagePanoramique.getFitWidth()) {
                XX = imagePanoramique.getFitWidth();
            }
            point.setCenterX(XX + imagePanoramique.getLayoutX());
            double YY = me1.getY();
            if (YY < 0) {
                YY = 0;
            }
            if (YY > imagePanoramique.getFitHeight()) {
                YY = imagePanoramique.getFitHeight();
            }
            point.setCenterY(YY);

            me1.consume();

        });
        point.setOnMouseReleased((MouseEvent me1) -> {
            String chPoint = point.getId();
            chPoint = chPoint.substring(3, chPoint.length());
            int numeroPoint = Integer.parseInt(chPoint);
            double X1 = me1.getSceneX();
            double Y1 = me1.getSceneY();
            double mouseX1 = X1 - imagePanoramique.getLayoutX();
            if (mouseX1 < 0) {
                mouseX1 = 0;
            }
            if (mouseX1 > imagePanoramique.getFitWidth()) {
                mouseX1 = imagePanoramique.getFitWidth();
            }

            double mouseY1 = Y1 - pano.getLayoutY() - 109;
            if (mouseY1 < 0) {
                mouseY1 = 0;
            }
            if (mouseY1 > imagePanoramique.getFitHeight()) {
                mouseY1 = imagePanoramique.getFitHeight();
            }

            double longit, lat;
            double larg = imagePanoramique.getFitWidth();
            longit = 360.0f * mouseX1 / larg - 180;
            lat = 90.0d - 2.0f * mouseY1 / larg * 180.0f;
            panoramiquesProjet[panoActuel].getHotspotImage(numeroPoint).setLatitude(lat);
            panoramiquesProjet[panoActuel].getHotspotImage(numeroPoint).setLongitude(longit);
            point.setFill(Color.BLUE);
            point.setStroke(Color.YELLOW);
            me1.consume();

        });

        point.setOnMouseClicked((MouseEvent me1) -> {
            if (me1.isControlDown()) {
                dejaSauve = false;
                stPrincipal.setTitle(stPrincipal.getTitle().replace(" *", "") + " *");
                String chPoint = point.getId();
                chPoint = chPoint.substring(3, chPoint.length());
                int numeroPoint = Integer.parseInt(chPoint);
                Node pt;
                pt = (Node) pano.lookup("#img" + chPoint);
                pano.getChildren().remove(pt);

                for (int o = numeroPoint + 1; o < numImages; o++) {
                    pt = (Node) pano.lookup("#img" + Integer.toString(o));
                    pt.setId("img" + Integer.toString(o - 1));
                }
                /**
                 * on retire les anciennes indication de HS
                 */
                retireAffichageHotSpots();
                numImages--;
                panoramiquesProjet[panoActuel].removeHotspotImage(numeroPoint);
                /**
                 * On les cre les nouvelles
                 */
                ajouteAffichageHotspots();
            }
            valideHS();
            me1.consume();
        });

    }
}

From source file:editeurpanovisu.EditeurPanovisu.java

private void panoMouseClic(double X, double Y) {

    if (nombrePanoramiques > 1) {
        valideHS();/*w w  w . ja  v  a2 s  . c o m*/
        dejaSauve = false;
        stPrincipal.setTitle(stPrincipal.getTitle().replace(" *", "") + " *");
        double mouseX = X;
        double mouseY = Y - pano.getLayoutY() - 109;
        if (X > 0 && X < imagePanoramique.getFitWidth()) {
            double longitude, latitude;
            double largeur = imagePanoramique.getFitWidth();
            String chLong, chLat;
            longitude = 360.0f * mouseX / largeur - 180;
            latitude = 90.0d - 2.0f * mouseY / largeur * 180.0f;
            Circle point = new Circle(mouseX + imagePanoramique.getLayoutX(), mouseY, 5);
            point.setFill(Color.YELLOW);
            point.setStroke(Color.RED);
            point.setId("point" + numPoints);
            point.setCursor(Cursor.DEFAULT);
            pano.getChildren().add(point);
            Tooltip t = new Tooltip("point n" + (numPoints + 1));
            t.setStyle(tooltipStyle);
            Tooltip.install(point, t);
            HotSpot HS = new HotSpot();
            HS.setLongitude(longitude);
            HS.setLatitude(latitude);
            panoramiquesProjet[panoActuel].addHotspot(HS);
            retireAffichageHotSpots();
            Pane affHS1 = affichageHS(listePano(panoActuel), panoActuel);
            affHS1.setId("labels");
            outils.getChildren().add(affHS1);

            numPoints++;
            if (nombrePanoramiques > 1) {

                AnchorPane listePanoVig = afficherListePanosVignettes(
                        panoramiquesProjet[panoActuel].getNombreHotspots() - 1);
                int largeurVignettes = 4;
                if (nombrePanoramiques < 4) {
                    largeurVignettes = nombrePanoramiques;
                }
                if (mouseX + largeurVignettes * 130 > pano.getWidth()) {
                    listePanoVig.setLayoutX(pano.getWidth() - largeurVignettes * 130);
                } else {
                    listePanoVig.setLayoutX(mouseX);
                }
                listePanoVig.setLayoutY(mouseY);
                pano.getChildren().add(listePanoVig);
                valideHS();
            }
            point.setOnDragDetected((MouseEvent me1) -> {
                String chPoint = point.getId();
                chPoint = chPoint.substring(5, chPoint.length());
                int numeroPoint = Integer.parseInt(chPoint);
                Node pt;
                pt = (Node) pano.lookup("#point" + chPoint);
                point.setFill(Color.RED);
                point.setStroke(Color.YELLOW);
                dragDrop = true;
                me1.consume();

            });
            point.setOnMouseDragged((MouseEvent me1) -> {
                double XX = me1.getX() - imagePanoramique.getLayoutX();
                if (XX < 0) {
                    XX = 0;
                }
                if (XX > imagePanoramique.getFitWidth()) {
                    XX = imagePanoramique.getFitWidth();
                }
                point.setCenterX(XX + imagePanoramique.getLayoutX());
                double YY = me1.getY();
                if (YY < 0) {
                    YY = 0;
                }
                if (YY > imagePanoramique.getFitHeight()) {
                    YY = imagePanoramique.getFitHeight();
                }
                point.setCenterY(YY);

                me1.consume();

            });
            point.setOnMouseReleased((MouseEvent me1) -> {
                String chPoint = point.getId();
                chPoint = chPoint.substring(5, chPoint.length());
                int numeroPoint = Integer.parseInt(chPoint);
                double X1 = me1.getSceneX();
                double Y1 = me1.getSceneY();
                double mouseX1 = X1 - imagePanoramique.getLayoutX();
                if (mouseX1 < 0) {
                    mouseX1 = 0;
                }
                if (mouseX1 > imagePanoramique.getFitWidth()) {
                    mouseX1 = imagePanoramique.getFitWidth();
                }
                double mouseY1 = Y1 - pano.getLayoutY() - 109;
                if (mouseY1 < 0) {
                    mouseY1 = 0;
                }
                if (mouseY1 > imagePanoramique.getFitHeight()) {
                    mouseY1 = imagePanoramique.getFitHeight();
                }
                double longit, lat;
                double larg = imagePanoramique.getFitWidth();
                longit = 360.0f * mouseX1 / larg - 180;
                lat = 90.0d - 2.0f * mouseY1 / larg * 180.0f;
                panoramiquesProjet[panoActuel].getHotspot(numeroPoint).setLatitude(lat);
                panoramiquesProjet[panoActuel].getHotspot(numeroPoint).setLongitude(longit);
                point.setFill(Color.YELLOW);
                point.setStroke(Color.RED);
                me1.consume();

            });

            point.setOnMouseClicked((MouseEvent me1) -> {
                if (me1.isControlDown()) {
                    dejaSauve = false;
                    stPrincipal.setTitle(stPrincipal.getTitle().replace(" *", "") + " *");
                    String chPoint = point.getId();
                    chPoint = chPoint.substring(5, chPoint.length());
                    int numeroPoint = Integer.parseInt(chPoint);
                    Node pt;
                    pt = (Node) pano.lookup("#point" + chPoint);
                    pano.getChildren().remove(pt);

                    for (int o = numeroPoint + 1; o < numPoints; o++) {
                        pt = (Node) pano.lookup("#point" + Integer.toString(o));
                        pt.setId("point" + Integer.toString(o - 1));
                    }
                    /**
                     * on retire les anciennes indication de HS
                     */
                    retireAffichageHotSpots();
                    numPoints--;
                    panoramiquesProjet[panoActuel].removeHotspot(numeroPoint);
                    /**
                     * On les cre les nouvelles
                     */
                    ajouteAffichageHotspots();
                    valideHS();
                    me1.consume();
                } else {
                    if (!dragDrop) {
                        String chPoint = point.getId();
                        chPoint = chPoint.substring(5, chPoint.length());
                        int numeroPoint = Integer.parseInt(chPoint);
                        if (nombrePanoramiques > 1) {
                            AnchorPane listePanoVig = afficherListePanosVignettes(numeroPoint);
                            int largeurVignettes = 4;
                            if (nombrePanoramiques < 4) {
                                largeurVignettes = nombrePanoramiques;
                            }
                            if (mouseX + largeurVignettes * 130 > pano.getWidth()) {
                                listePanoVig.setLayoutX(pano.getWidth() - largeurVignettes * 130);
                            } else {
                                listePanoVig.setLayoutX(mouseX);
                            }
                            listePanoVig.setLayoutY(mouseY);
                            pano.getChildren().add(listePanoVig);
                        }
                    } else {
                        dragDrop = false;
                    }
                    valideHS();
                    me1.consume();

                }
            });
        }
    }
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param lstPano/*www.  ja v  a  2  s.co m*/
 * @param numPano
 * @return
 */
public Pane affichageHS(String lstPano, int numPano) {

    Pane panneauHotSpots = new Pane();
    panneauHotSpots.setTranslateY(10);
    panneauHotSpots.setTranslateX(30);
    VBox vb1 = new VBox(5);
    panneauHotSpots.getChildren().add(vb1);
    Label lblPoint;
    Label sep = new Label(" ");
    Label sep1 = new Label(" ");
    int o;
    for (o = 0; o < panoramiquesProjet[numPano].getNombreHotspots(); o++) {
        VBox vbPanneauHS = new VBox();
        double deplacement = 20;
        vbPanneauHS.setLayoutX(deplacement);
        Pane pannneauHS = new Pane(vbPanneauHS);
        pannneauHS.setStyle("-fx-border-color : #777777;-fx-border-width : 1px;-fx-border-radius : 3;");
        panneauHotSpots.setId("HS" + o);
        lblPoint = new Label("Point n" + (o + 1));
        lblPoint.setPadding(new Insets(5, 10, 5, 5));
        lblPoint.setTranslateX(-deplacement);
        lblPoint.setStyle("-fx-background-color : #333;");
        lblPoint.setTextFill(Color.WHITE);
        Separator sp = new Separator(Orientation.HORIZONTAL);
        sp.setTranslateX(-deplacement);
        sp.setPrefWidth(300);

        pannneauHS.setPrefWidth(300);
        pannneauHS.setTranslateX(5);
        vbPanneauHS.getChildren().addAll(lblPoint, sp);
        if (lstPano != null) {
            Label lblLien = new Label("Panoramique de destination");
            ComboBox cbDestPano = new ComboBox();
            String[] liste = lstPano.split(";");
            cbDestPano.getItems().addAll(Arrays.asList(liste));
            cbDestPano.valueProperty().addListener(new ChangeListener<String>() {
                @Override
                public void changed(ObservableValue ov, String t, String t1) {
                    valideHS();
                }
            });
            cbDestPano.setTranslateX(60);
            cbDestPano.setId("cbpano" + o);

            String f1XML = panoramiquesProjet[numPano].getHotspot(o).getFichierXML();
            if (f1XML != null) {
                cbDestPano.setValue(f1XML.split("\\.")[0]);
            }
            int num = cbDestPano.getSelectionModel().getSelectedIndex();
            vbPanneauHS.getChildren().addAll(lblLien, cbDestPano, sep);
        }
        Label lblTexteHS = new Label("Texte du Hotspot");
        TextArea txtTexteHS = new TextArea();
        if (panoramiquesProjet[numPano].getHotspot(o).getInfo() != null) {
            txtTexteHS.setText(panoramiquesProjet[numPano].getHotspot(o).getInfo());
        }
        txtTexteHS.textProperty().addListener((final ObservableValue<? extends String> observable,
                final String oldValue, final String newValue) -> {
            valideHS();
        });

        txtTexteHS.setId("txtHS" + o);
        txtTexteHS.setPrefSize(200, 25);
        txtTexteHS.setMaxSize(200, 20);
        txtTexteHS.setTranslateX(60);
        CheckBox cbAnime = new CheckBox("HostSpot Anim");
        cbAnime.setId("anime" + o);
        cbAnime.selectedProperty().addListener((final ObservableValue<? extends Boolean> observable,
                final Boolean oldValue, final Boolean newValue) -> {
            valideHS();
        });
        if (panoramiquesProjet[numPano].getHotspot(o).isAnime()) {
            cbAnime.setSelected(true);
        }
        cbAnime.setPadding(new Insets(5));
        cbAnime.setTranslateX(60);
        vbPanneauHS.getChildren().addAll(lblTexteHS, txtTexteHS, cbAnime, sep1);
        vb1.getChildren().addAll(pannneauHS, sep);
    }
    int nbHS = o;
    for (o = 0; o < panoramiquesProjet[numPano].getNombreHotspotImage(); o++) {
        VBox vbPanneauHS = new VBox();
        Pane pannneauHS = new Pane(vbPanneauHS);
        pannneauHS.setStyle("-fx-border-color : #777777;-fx-border-width : 1px;-fx-border-radius : 3;");
        panneauHotSpots.setId("HSImg" + o);
        lblPoint = new Label("Image n" + (o + 1));
        lblPoint.setPadding(new Insets(5, 10, 5, 5));
        lblPoint.setStyle("-fx-background-color : #666;");
        lblPoint.setTextFill(Color.WHITE);
        Separator sp = new Separator(Orientation.HORIZONTAL);
        sp.setPrefWidth(300);

        pannneauHS.setPrefWidth(300);
        pannneauHS.setTranslateX(5);
        vbPanneauHS.getChildren().addAll(lblPoint, sp);
        Label lblLien = new Label("Image choisie :");
        String f1XML = panoramiquesProjet[numPano].getHotspotImage(o).getLienImg();
        ImageView IMChoisie = new ImageView(
                new Image("file:" + repertTemp + File.separator + "images" + File.separator + f1XML, 100, -1,
                        true, true));
        IMChoisie.setTranslateX(100);
        vbPanneauHS.getChildren().addAll(lblLien, IMChoisie, sep);
        Label lblTexteHS = new Label("Texte du Hotspot");
        TextArea txtTexteHS = new TextArea();
        if (panoramiquesProjet[numPano].getHotspotImage(o).getInfo() != null) {
            txtTexteHS.setText(panoramiquesProjet[numPano].getHotspotImage(o).getInfo());
        }
        txtTexteHS.textProperty().addListener((final ObservableValue<? extends String> observable,
                final String oldValue, final String newValue) -> {
            valideHS();
        });

        txtTexteHS.setId("txtHSImage" + o);
        txtTexteHS.setPrefSize(200, 25);
        txtTexteHS.setMaxSize(200, 20);
        txtTexteHS.setTranslateX(60);
        CheckBox cbAnime = new CheckBox("HostSpot Anim");
        cbAnime.setId("animeImage" + o);
        cbAnime.selectedProperty().addListener((final ObservableValue<? extends Boolean> observable,
                final Boolean oldValue, final Boolean newValue) -> {
            valideHS();
        });
        if (panoramiquesProjet[numPano].getHotspotImage(o).isAnime()) {
            cbAnime.setSelected(true);
        }
        cbAnime.setPadding(new Insets(5));
        cbAnime.setTranslateX(60);
        vbPanneauHS.getChildren().addAll(lblTexteHS, txtTexteHS, cbAnime, sep1);
        vb1.getChildren().addAll(pannneauHS, sep);
    }
    valideHS();
    nbHS += o;
    //        if (nbHS == 0) {
    //        } else {
    //            btnValider.setVisible(true);
    //        }
    return panneauHotSpots;
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param i//from   w  w  w . j a  v  a  2 s.  co  m
 * @param longitude
 * @param latitude
 */
private static void afficheHSHTML(int i, double longitude, double latitude) {
    double largeur = ivImagePanoramique.getFitWidth();
    double X = (longitude + 180.0d) * largeur / 360.0d + ivImagePanoramique.getLayoutX();
    double Y = (90.0d - latitude) * largeur / 360.0d;
    Circle circPoint = new Circle(X, Y, 5);
    circPoint.setFill(Color.DARKGREEN);
    circPoint.setStroke(Color.YELLOWGREEN);
    circPoint.setId("html" + i);
    circPoint.setCursor(Cursor.DEFAULT);
    panePanoramique.getChildren().add(circPoint);
    Tooltip tltpHSImage = new Tooltip("HTML #" + (i + 1));
    tltpHSImage.setStyle(getStrTooltipStyle());
    Tooltip.install(circPoint, tltpHSImage);
    circPoint.setOnDragDetected((mouseEvent1) -> {
        circPoint.setFill(Color.YELLOWGREEN);
        circPoint.setStroke(Color.DARKGREEN);
        bDragDrop = true;
        mouseEvent1.consume();

    });
    circPoint.setOnMouseDragged((mouseEvent1) -> {
        double XX = mouseEvent1.getX() - ivImagePanoramique.getLayoutX();
        if (XX < 0) {
            XX = 0;
        }
        if (XX > ivImagePanoramique.getFitWidth()) {
            XX = ivImagePanoramique.getFitWidth();
        }
        circPoint.setCenterX(XX + ivImagePanoramique.getLayoutX());
        double YY = mouseEvent1.getY();
        if (YY < 0) {
            YY = 0;
        }
        if (YY > ivImagePanoramique.getFitHeight()) {
            YY = ivImagePanoramique.getFitHeight();
        }
        circPoint.setCenterY(YY);
        afficheLoupe(XX, YY);
        mouseEvent1.consume();

    });
    circPoint.setOnMouseReleased((mouseEvent1) -> {
        String strPoint = circPoint.getId();
        strPoint = strPoint.substring(4, strPoint.length());
        int iNumeroPoint = Integer.parseInt(strPoint);
        double X1 = mouseEvent1.getSceneX();
        double Y1 = mouseEvent1.getSceneY();
        double mouseX = X1 - ivImagePanoramique.getLayoutX();
        if (mouseX < 0) {
            mouseX = 0;
        }
        if (mouseX > ivImagePanoramique.getFitWidth()) {
            mouseX = ivImagePanoramique.getFitWidth();
        }
        double mouseY = Y1 - panePanoramique.getLayoutY() - 130 - getiDecalageMac();
        if (mouseY < 0) {
            mouseY = 0;
        }
        if (mouseY > ivImagePanoramique.getFitHeight()) {
            mouseY = ivImagePanoramique.getFitHeight();
        }

        double longit, lat;
        double larg = ivImagePanoramique.getFitWidth();
        String strLong, strLat;
        longit = 360.0f * mouseX / larg - 180;
        lat = 90.0d - 2.0f * mouseY / larg * 180.0f;
        getPanoramiquesProjet()[getiPanoActuel()].getHotspotHTML(iNumeroPoint).setLatitude(lat);
        getPanoramiquesProjet()[getiPanoActuel()].getHotspotHTML(iNumeroPoint).setLongitude(longit);
        circPoint.setFill(Color.DARKGREEN);
        circPoint.setStroke(Color.YELLOWGREEN);
        mouseEvent1.consume();

    });

    circPoint.setOnMouseClicked((mouseEvent1) -> {
        String strPoint = circPoint.getId();
        strPoint = strPoint.substring(4, strPoint.length());
        int iNum = Integer.parseInt(strPoint);
        Node nodePointImage;
        nodePointImage = (Node) panePanoramique.lookup("#html" + strPoint);

        if (mouseEvent1.isControlDown()) {
            valideHS();
            setbDejaSauve(false);
            getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
            panePanoramique.getChildren().remove(nodePointImage);

            for (int io = iNum + 1; io < getiNumImages(); io++) {
                nodePointImage = (Node) panePanoramique.lookup("#html" + Integer.toString(io));
                nodePointImage.setId("img" + Integer.toString(io - 1));
            }
            /**
             * on retire les anciennes indication de HS
             */
            retireAffichageHotSpots();
            setiNumHTML(getiNumHTML() - 1);
            getPanoramiquesProjet()[getiPanoActuel()].removeHotspotHTML(iNum);
            /**
             * On les cre les nouvelles
             */
            ajouteAffichageHotspots();
            mouseEvent1.consume();
        } else {
            if (!bDragDrop) {
                EditeurHTML editHTML = new EditeurHTML();
                HotspotHTML HS = getPanoramiquesProjet()[getiPanoActuel()].getHotspotHTML(iNum);
                editHTML.setHsHTML(HS);
                Rectangle2D tailleEcran = Screen.getPrimary().getBounds();
                int iHauteur = (int) tailleEcran.getHeight() - 100;
                int iLargeur = (int) tailleEcran.getWidth() - 100;
                editHTML.affiche(iLargeur, iHauteur);
                editHTML.addPropertyChangeListener("bValide", (ev) -> {
                    if (ev.getNewValue().toString().equals("true")) {
                        getPanoramiquesProjet()[getiPanoActuel()].setHotspotHTML(editHTML.getHsHTML(), iNum);
                        dejaCharge = false;
                        retireAffichageHotSpots();
                        Pane affHS1 = paneAffichageHS(strListePano(), getiPanoActuel());
                        affHS1.setId("labels");
                        vbVisuHotspots.getChildren().add(affHS1);
                    }
                });
            } else {
                bDragDrop = false;
            }
            mouseEvent1.consume();
        }

    });
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 *///w  ww .  j a  v  a 2 s.co m
private static void ajouteAffichageHotspots() {
    Pane paneLabels = (Pane) vbVisuHotspots.lookup("#labels");
    vbVisuHotspots.getChildren().remove(paneLabels);
    dejaCharge = false;
    paneLabels = paneAffichageHS(strListePano(), getiPanoActuel());
    paneLabels.setId("labels");
    vbVisuHotspots.getChildren().add(paneLabels);
    setiNumPoints(getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspots());
    setiNumImages(getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspotImage());
    setiNumHTML(getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspotHTML());
    if (apHS1.getApOutil().isVisible()) {
        PaneOutil.deplieReplie(apHS1.getApOutil(), apHS1.getIvBtnPlusOutil());
        PaneOutil.deplieReplie(apHS1.getApOutil(), apHS1.getIvBtnPlusOutil());
    }
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param i/* w  w w  . j ava 2s .  com*/
 * @param longitude
 * @param latitude
 */
private static void afficheHSImage(int i, double longitude, double latitude) {
    double largeur = ivImagePanoramique.getFitWidth();
    double X = (longitude + 180.0d) * largeur / 360.0d + ivImagePanoramique.getLayoutX();
    double Y = (90.0d - latitude) * largeur / 360.0d;
    Circle circPoint = new Circle(X, Y, 5);
    circPoint.setFill(Color.BLUE);
    circPoint.setStroke(Color.YELLOW);
    circPoint.setId("img" + i);
    circPoint.setCursor(Cursor.DEFAULT);
    panePanoramique.getChildren().add(circPoint);
    Tooltip tltpHSImage = new Tooltip("image #" + (i + 1));
    tltpHSImage.setStyle(getStrTooltipStyle());
    Tooltip.install(circPoint, tltpHSImage);
    circPoint.setOnDragDetected((mouseEvent1) -> {
        circPoint.setFill(Color.YELLOW);
        circPoint.setStroke(Color.BLUE);
        bDragDrop = true;
        mouseEvent1.consume();

    });
    circPoint.setOnMouseDragged((mouseEvent1) -> {
        double XX = mouseEvent1.getX() - ivImagePanoramique.getLayoutX();
        if (XX < 0) {
            XX = 0;
        }
        if (XX > ivImagePanoramique.getFitWidth()) {
            XX = ivImagePanoramique.getFitWidth();
        }
        circPoint.setCenterX(XX + ivImagePanoramique.getLayoutX());
        double YY = mouseEvent1.getY();
        if (YY < 0) {
            YY = 0;
        }
        if (YY > ivImagePanoramique.getFitHeight()) {
            YY = ivImagePanoramique.getFitHeight();
        }
        circPoint.setCenterY(YY);
        afficheLoupe(XX, YY);
        mouseEvent1.consume();

    });
    circPoint.setOnMouseReleased((mouseEvent1) -> {
        String strPoint = circPoint.getId();
        strPoint = strPoint.substring(3, strPoint.length());
        int iNumeroPoint = Integer.parseInt(strPoint);
        double X1 = mouseEvent1.getSceneX();
        double Y1 = mouseEvent1.getSceneY();
        double mouseX = X1 - ivImagePanoramique.getLayoutX();
        if (mouseX < 0) {
            mouseX = 0;
        }
        if (mouseX > ivImagePanoramique.getFitWidth()) {
            mouseX = ivImagePanoramique.getFitWidth();
        }
        double mouseY = Y1 - panePanoramique.getLayoutY() - 130 - getiDecalageMac();
        if (mouseY < 0) {
            mouseY = 0;
        }
        if (mouseY > ivImagePanoramique.getFitHeight()) {
            mouseY = ivImagePanoramique.getFitHeight();
        }

        double longit, lat;
        double larg = ivImagePanoramique.getFitWidth();
        String strLong, strLat;
        longit = 360.0f * mouseX / larg - 180;
        lat = 90.0d - 2.0f * mouseY / larg * 180.0f;
        getPanoramiquesProjet()[getiPanoActuel()].getHotspotImage(iNumeroPoint).setLatitude(lat);
        getPanoramiquesProjet()[getiPanoActuel()].getHotspotImage(iNumeroPoint).setLongitude(longit);
        circPoint.setFill(Color.BLUE);
        circPoint.setStroke(Color.YELLOW);
        mouseEvent1.consume();

    });

    circPoint.setOnMouseClicked((mouseEvent1) -> {
        String strPoint = circPoint.getId();
        strPoint = strPoint.substring(3, strPoint.length());
        int iNum = Integer.parseInt(strPoint);
        Node nodePointImage;
        nodePointImage = (Node) panePanoramique.lookup("#img" + strPoint);

        if (mouseEvent1.isControlDown()) {
            valideHS();
            setbDejaSauve(false);
            getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
            panePanoramique.getChildren().remove(nodePointImage);

            for (int io = iNum + 1; io < getiNumImages(); io++) {
                nodePointImage = (Node) panePanoramique.lookup("#img" + Integer.toString(io));
                nodePointImage.setId("img" + Integer.toString(io - 1));
            }
            /**
             * on retire les anciennes indication de HS
             */
            retireAffichageHotSpots();
            setiNumImages(getiNumImages() - 1);
            getPanoramiquesProjet()[getiPanoActuel()].removeHotspotImage(iNum);
            /**
             * On les cre les nouvelles
             */
            ajouteAffichageHotspots();
            mouseEvent1.consume();
        } else {
            if (!bDragDrop) {
                File fileRepert;
                if (getStrRepertHSImages().equals("")) {
                    fileRepert = new File(getStrCurrentDir() + File.separator);
                } else {
                    fileRepert = new File(getStrRepertHSImages());
                }
                FileChooser fileChooser = new FileChooser();
                FileChooser.ExtensionFilter extFilterImages = new FileChooser.ExtensionFilter(
                        "Fichiers Images (jpg, bmp, png)", "*.jpg", "*.bmp", "*.png");

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

                File fileFichierImage = fileChooser.showOpenDialog(null);
                if (fileFichierImage != null) {
                    setStrRepertHSImages(fileFichierImage.getParent());
                    HotspotImage HS = getPanoramiquesProjet()[getiPanoActuel()].getHotspotImage(iNum);
                    HS.setStrUrlImage(fileFichierImage.getAbsolutePath());
                    HS.setStrLienImg(fileFichierImage.getName());
                    HS.setStrInfo(fileFichierImage.getName().split("\\.")[0]);
                    File fileRepertImage = new File(getStrRepertTemp() + File.separator + "images");
                    if (!fileRepertImage.exists()) {
                        fileRepertImage.mkdirs();
                    }
                    try {
                        copieFichierRepertoire(fileFichierImage.getAbsolutePath(),
                                fileRepertImage.getAbsolutePath());

                    } catch (IOException ex) {
                        Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    getPanoramiquesProjet()[getiPanoActuel()].setHotspotImage(HS, iNum);
                    retireAffichageHotSpots();
                    Pane affHS1 = paneAffichageHS(strListePano(), getiPanoActuel());
                    affHS1.setId("labels");
                    vbVisuHotspots.getChildren().add(affHS1);
                }
            } else {
                bDragDrop = false;
            }
            mouseEvent1.consume();
        }

    });
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param X/*from   w  w w  .  java 2  s.  c  o m*/
 * @param Y
 */
private static void panoMouseClic(double X, double Y) {

    if (getiNombrePanoramiques() > 1) {
        valideHS();
        setbDejaSauve(false);
        getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
        double mouseX = X;
        double mouseY = Y - panePanoramique.getLayoutY() - 130 - getiDecalageMac();
        if (X > 0 && X < ivImagePanoramique.getFitWidth()) {
            double longitude, latitude;
            double largeur = ivImagePanoramique.getFitWidth();
            String strLong, strLat;
            longitude = 360.0f * mouseX / largeur - 180;
            latitude = 90.0d - 2.0f * mouseY / largeur * 180.0f;
            Circle circPoint = new Circle(mouseX + ivImagePanoramique.getLayoutX(), mouseY, 5);
            circPoint.setFill(Color.YELLOW);
            circPoint.setStroke(Color.RED);
            circPoint.setId("point" + getiNumPoints());
            circPoint.setCursor(Cursor.DEFAULT);
            panePanoramique.getChildren().add(circPoint);
            Tooltip tltpPoint = new Tooltip("point n" + (getiNumPoints() + 1));
            tltpPoint.setStyle(getStrTooltipStyle());
            Tooltip.install(circPoint, tltpPoint);
            HotSpot HS = new HotSpot();
            HS.setLongitude(longitude);
            HS.setLatitude(latitude);
            getPanoramiquesProjet()[getiPanoActuel()].addHotspot(HS);
            retireAffichageHotSpots();
            dejaCharge = false;
            Pane paneAfficheHS1 = paneAffichageHS(strListePano(), getiPanoActuel());
            paneAfficheHS1.setId("labels");
            vbVisuHotspots.getChildren().add(paneAfficheHS1);
            spPanneauOutils.setVvalue(spPanneauOutils.getVvalue() + 300);
            setiNumPoints(getiNumPoints() + 1);
            if (getiNombrePanoramiques() > 1) {

                AnchorPane apListePanoVig = apAfficherListePanosVignettes(
                        getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspots() - 1);
                double positX = (panePanoramique.getPrefWidth() - apListePanoVig.getPrefWidth()) / 2.d;
                double positY = (panePanoramique.getPrefHeight() - apListePanoVig.getPrefHeight()) / 2.d;
                apListePanoVig.setLayoutX(positX);
                apListePanoVig.setLayoutY(positY);
                apPanneauPrincipal.getChildren().add(apListePanoVig);
                valideHS();
            }
            circPoint.setOnDragDetected((mouseEvent1) -> {
                String strPoint = circPoint.getId();
                strPoint = strPoint.substring(5, strPoint.length());
                int numeroPoint = Integer.parseInt(strPoint);
                Node nodePoint;
                nodePoint = (Node) panePanoramique.lookup("#point" + strPoint);
                circPoint.setFill(Color.RED);
                circPoint.setStroke(Color.YELLOW);
                bDragDrop = true;
                mouseEvent1.consume();

            });
            circPoint.setOnMouseDragged((mouseEvent1) -> {
                double XX = mouseEvent1.getX() - ivImagePanoramique.getLayoutX();
                if (XX < 0) {
                    XX = 0;
                }
                if (XX > ivImagePanoramique.getFitWidth()) {
                    XX = ivImagePanoramique.getFitWidth();
                }
                circPoint.setCenterX(XX + ivImagePanoramique.getLayoutX());
                double YY = mouseEvent1.getY();
                if (YY < 0) {
                    YY = 0;
                }
                if (YY > ivImagePanoramique.getFitHeight()) {
                    YY = ivImagePanoramique.getFitHeight();
                }
                circPoint.setCenterY(YY);
                afficheLoupe(XX, YY);
                mouseEvent1.consume();

            });
            circPoint.setOnMouseReleased((mouseEvent1) -> {
                setbDejaSauve(false);
                getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
                String strPoint = circPoint.getId();
                strPoint = strPoint.substring(5, strPoint.length());
                int iNumeroPoint = Integer.parseInt(strPoint);
                double X1 = mouseEvent1.getSceneX();
                double Y1 = mouseEvent1.getSceneY();
                double mouseX1 = X1 - ivImagePanoramique.getLayoutX();
                if (mouseX1 < 0) {
                    mouseX1 = 0;
                }
                if (mouseX1 > ivImagePanoramique.getFitWidth()) {
                    mouseX1 = ivImagePanoramique.getFitWidth();
                }
                double mouseY1 = Y1 - panePanoramique.getLayoutY() - 130 - getiDecalageMac();
                if (mouseY1 < 0) {
                    mouseY1 = 0;
                }
                if (mouseY1 > ivImagePanoramique.getFitHeight()) {
                    mouseY1 = ivImagePanoramique.getFitHeight();
                }
                double longit, lat;
                double larg = ivImagePanoramique.getFitWidth();
                longit = 360.0f * mouseX1 / larg - 180;
                lat = 90.0d - 2.0f * mouseY1 / larg * 180.0f;
                getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumeroPoint).setLatitude(lat);
                getPanoramiquesProjet()[getiPanoActuel()].getHotspot(iNumeroPoint).setLongitude(longit);
                circPoint.setFill(Color.YELLOW);
                circPoint.setStroke(Color.RED);
                mouseEvent1.consume();

            });

            circPoint.setOnMouseClicked((mouseEvent1) -> {
                if (mouseEvent1.isControlDown()) {
                    setbDejaSauve(false);
                    getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
                    String strPoint = circPoint.getId();
                    strPoint = strPoint.substring(5, strPoint.length());
                    int iNumeroPoint = Integer.parseInt(strPoint);
                    Node nodePoint;
                    nodePoint = (Node) panePanoramique.lookup("#point" + strPoint);
                    panePanoramique.getChildren().remove(nodePoint);

                    for (int io = iNumeroPoint + 1; io < getiNumPoints(); io++) {
                        nodePoint = (Node) panePanoramique.lookup("#point" + Integer.toString(io));
                        nodePoint.setId("point" + Integer.toString(io - 1));
                    }
                    /**
                     * on retire les anciennes indication de HS
                     */
                    retireAffichageHotSpots();
                    setiNumPoints(getiNumPoints() - 1);
                    getPanoramiquesProjet()[getiPanoActuel()].removeHotspot(iNumeroPoint);
                    /**
                     * On les cre les nouvelles
                     */
                    ajouteAffichageHotspots();
                    valideHS();
                    mouseEvent1.consume();
                } else {
                    if (!bDragDrop) {
                        setbDejaSauve(false);
                        getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
                        String strPoint = circPoint.getId();
                        strPoint = strPoint.substring(5, strPoint.length());
                        int iNumeroPoint = Integer.parseInt(strPoint);
                        if (getiNombrePanoramiques() > 1) {
                            AnchorPane apListePanoVig = apAfficherListePanosVignettes(iNumeroPoint);
                            double positX = (panePanoramique.getPrefWidth() - apListePanoVig.getPrefWidth())
                                    / 2.d;
                            double positY = (panePanoramique.getPrefHeight() - apListePanoVig.getPrefHeight())
                                    / 2.d;
                            apListePanoVig.setLayoutX(positX);
                            apListePanoVig.setLayoutY(positY);
                            apPanneauPrincipal.getChildren().add(apListePanoVig);
                        }
                    } else {
                        bDragDrop = false;
                    }
                    valideHS();
                    mouseEvent1.consume();

                }
            });
        }
    }
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param X/*  w  ww  .  jav  a 2  s .  co  m*/
 * @param Y
 */
private static void panoAjouteHTML(double X, double Y) {
    if (X > 0 && X < ivImagePanoramique.getFitWidth()) {
        valideHS();
        setbDejaSauve(false);
        getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
        double mouseX = X;
        double mouseY = Y - panePanoramique.getLayoutY() - 130 - getiDecalageMac();
        double longitude, latitude;
        double largeur = ivImagePanoramique.getFitWidth();
        longitude = 360.0f * mouseX / largeur - 180;
        latitude = 90.0d - 2.0f * mouseY / largeur * 180.0f;
        Circle circPoint = new Circle(mouseX + ivImagePanoramique.getLayoutX(), mouseY, 5);
        circPoint.setFill(Color.DARKGREEN);
        circPoint.setStroke(Color.YELLOWGREEN);
        circPoint.setId("html" + getiNumHTML());
        circPoint.setCursor(Cursor.DEFAULT);
        panePanoramique.getChildren().add(circPoint);
        Tooltip tltpImage = new Tooltip("HTML n " + (getiNumHTML() + 1));
        tltpImage.setStyle(getStrTooltipStyle());
        Tooltip.install(circPoint, tltpImage);
        EditeurHTML editHTML = new EditeurHTML();
        HotspotHTML HS = new HotspotHTML();
        editHTML.setHsHTML(HS);
        HS.setLongitude(longitude);
        HS.setLatitude(latitude);
        Rectangle2D tailleEcran = Screen.getPrimary().getBounds();
        int iHauteur = (int) tailleEcran.getHeight() - 100;
        int iLargeur = (int) tailleEcran.getWidth() - 100;

        editHTML.affiche(iLargeur, iHauteur);

        editHTML.addPropertyChangeListener("bValide", (e) -> {
            if (e.getNewValue().toString().equals("true")) {
                setiNumHTML(getiNumHTML() + 1);
                getPanoramiquesProjet()[getiPanoActuel()].addHotspotHTML(editHTML.getHsHTML());
                retireAffichageHotSpots();
                dejaCharge = false;
                Pane affHS1 = paneAffichageHS(strListePano(), getiPanoActuel());
                affHS1.setId("labels");
                vbVisuHotspots.getChildren().add(affHS1);
                spPanneauOutils.setVvalue(spPanneauOutils.getVvalue() + 145);
            }
        });
        editHTML.addPropertyChangeListener("bAnnule", (e) -> {
            if (e.getNewValue().toString().equals("true")) {
                String strPoint = circPoint.getId();
                strPoint = strPoint.substring(4, strPoint.length());
                Node nodeImage = (Node) panePanoramique.lookup("#html" + strPoint);
                panePanoramique.getChildren().remove(nodeImage);
            }
        });

        valideHS();
        circPoint.setOnDragDetected((mouseEvent1) -> {
            circPoint.setFill(Color.YELLOWGREEN);
            circPoint.setStroke(Color.DARKGREEN);
            bDragDrop = true;
            mouseEvent1.consume();

        });
        circPoint.setOnMouseDragged((mouseEvent1) -> {
            double XX = mouseEvent1.getX() - ivImagePanoramique.getLayoutX();
            if (XX < 0) {
                XX = 0;
            }
            if (XX > ivImagePanoramique.getFitWidth()) {
                XX = ivImagePanoramique.getFitWidth();
            }
            circPoint.setCenterX(XX + ivImagePanoramique.getLayoutX());
            double YY = mouseEvent1.getY();
            if (YY < 0) {
                YY = 0;
            }
            if (YY > ivImagePanoramique.getFitHeight()) {
                YY = ivImagePanoramique.getFitHeight();
            }
            circPoint.setCenterY(YY);
            afficheLoupe(XX, YY);
            mouseEvent1.consume();

        });
        circPoint.setOnMouseReleased((mouseEvent1) -> {
            setbDejaSauve(false);
            getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
            String strPoint = circPoint.getId();
            strPoint = strPoint.substring(4, strPoint.length());
            int iNumeroPoint = Integer.parseInt(strPoint);
            double X1 = mouseEvent1.getSceneX();
            double Y1 = mouseEvent1.getSceneY();
            double mouseX1 = X1 - ivImagePanoramique.getLayoutX();
            if (mouseX1 < 0) {
                mouseX1 = 0;
            }
            if (mouseX1 > ivImagePanoramique.getFitWidth()) {
                mouseX1 = ivImagePanoramique.getFitWidth();
            }

            double mouseY1 = Y1 - panePanoramique.getLayoutY() - 130 - getiDecalageMac();
            if (mouseY1 < 0) {
                mouseY1 = 0;
            }
            if (mouseY1 > ivImagePanoramique.getFitHeight()) {
                mouseY1 = ivImagePanoramique.getFitHeight();
            }

            double longit, lat;
            double larg = ivImagePanoramique.getFitWidth();
            longit = 360.0f * mouseX1 / larg - 180;
            lat = 90.0d - 2.0f * mouseY1 / larg * 180.0f;
            getPanoramiquesProjet()[getiPanoActuel()].getHotspotHTML(iNumeroPoint).setLatitude(lat);
            getPanoramiquesProjet()[getiPanoActuel()].getHotspotHTML(iNumeroPoint).setLongitude(longit);
            circPoint.setFill(Color.DARKGREEN);
            circPoint.setStroke(Color.YELLOWGREEN);
            mouseEvent1.consume();

        });

        circPoint.setOnMouseClicked((mouseEvent1) -> {
            String strPoint = circPoint.getId();
            strPoint = strPoint.substring(4, strPoint.length());
            int iNum = Integer.parseInt(strPoint);
            if (mouseEvent1.isControlDown()) {
                setbDejaSauve(false);
                getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
                Node nodeImage;
                nodeImage = (Node) panePanoramique.lookup("#html" + strPoint);
                panePanoramique.getChildren().remove(nodeImage);

                for (int io = iNum + 1; io < getiNumHTML(); io++) {
                    nodeImage = (Node) panePanoramique.lookup("#html" + Integer.toString(io));
                    nodeImage.setId("html" + Integer.toString(io - 1));
                }
                /**
                 * on retire les anciennes indication de HS
                 */
                retireAffichageHotSpots();
                setiNumHTML(getiNumHTML() - 1);
                getPanoramiquesProjet()[getiPanoActuel()].removeHotspotHTML(iNum);
                /**
                 * On les cre les nouvelles
                 */
                ajouteAffichageHotspots();
            } else {
                if (!bDragDrop) {
                    setbDejaSauve(false);
                    getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");

                    EditeurHTML editHTML1 = new EditeurHTML();
                    HotspotHTML HS1 = getPanoramiquesProjet()[getiPanoActuel()].getHotspotHTML(iNum);
                    editHTML1.setHsHTML(HS1);
                    Rectangle2D tailleEcran1 = Screen.getPrimary().getBounds();
                    int iHauteur1 = (int) tailleEcran1.getHeight() - 100;
                    int iLargeur1 = (int) tailleEcran1.getWidth() - 100;
                    editHTML1.affiche(iLargeur1, iHauteur1);
                    editHTML1.addPropertyChangeListener("bValide", (ev) -> {
                        if (ev.getNewValue().toString().equals("true")) {
                            getPanoramiquesProjet()[getiPanoActuel()].setHotspotHTML(editHTML1.getHsHTML(),
                                    iNum);
                            retireAffichageHotSpots();
                            dejaCharge = false;
                            Pane affHS1 = paneAffichageHS(strListePano(), getiPanoActuel());
                            affHS1.setId("labels");
                            vbVisuHotspots.getChildren().add(affHS1);
                            apVisuHS.setPrefHeight(affHS1.getPrefHeight());
                        }
                    });
                } else {
                    bDragDrop = false;
                }
                mouseEvent1.consume();
            }
            valideHS();
            mouseEvent1.consume();
        });

    }
}