Example usage for javafx.scene.paint Color getRed

List of usage examples for javafx.scene.paint Color getRed

Introduction

In this page you can find the example usage for javafx.scene.paint Color getRed.

Prototype

public final double getRed() 

Source Link

Document

The red component of the Color , in the range 0.0-1.0 .

Usage

From source file:Main.java

public static Color fromAwt(final java.awt.Color color) {
    if (null == color) {
        return null;
    }/*from  w  w w.  j  a va  2 s. c  o m*/
    if (color.getAlpha() >= 255) {
        return Color.color(color.getRed() / 255d, color.getGreen() / 255d, color.getBlue() / 255d);
    } else {
        return Color.color(color.getRed() / 255d, color.getGreen() / 255d, color.getBlue() / 255d,
                color.getAlpha() / 255d);
    }
}

From source file:Main.java

public static java.awt.Color toAwt(final Color color) {
    if (null == color) {
        return null;
    }// w  w  w.  ja v a  2 s. c o m
    if (color.isOpaque() || color.getOpacity() >= 1d) {
        return new java.awt.Color((float) color.getRed(), (float) color.getGreen(), (float) color.getBlue());
    } else {
        return new java.awt.Color((float) color.getRed(), (float) color.getGreen(), (float) color.getBlue(),
                (float) color.getOpacity());
    }
}

From source file:net.rptools.tokentool.util.ImageUtil.java

private static boolean isMagenta(Color color, int fudge) {
    if (color.equals(Color.MAGENTA))
        return true;

    double r = color.getRed();
    double g = color.getGreen();
    double b = color.getBlue();

    if (Math.abs(r - b) > fudge)
        return false;

    if (g > r - fudge || g > b - fudge)
        return false;

    return true;// w w  w . j  ava  2  s.c o m
}

From source file:smarthome.FXMLDocumentController.java

@FXML
private void updateColor(ActionEvent event) {
    Color newColor = colorChooser1.getValue();
    currentColor.setFill(newColor);// w ww  .j ava 2 s .co m
    NumberFormat formatter = new DecimalFormat("#0.00");

    String red = formatter.format(newColor.getRed());
    String green = formatter.format(newColor.getGreen());
    String blue = formatter.format(newColor.getBlue());
    System.out.println("R= " + red + "  : G= " + green + "   : B= " + blue);

    new Thread(new Runnable() {
        @Override
        public void run() {

            httpPost("http://" + ipaddress + ":8080/cgi-bin/setRGB.py?R=" + red + "&G=" + green + "&B=" + blue);
            System.out.println("Inside The Thread.");

        }
    }).start();

}

From source file:ca.wumbo.doommanager.client.controller.file.entry.PlaypalController.java

/**
 * To be invoked when the user left clicks on the palette canvas.
 * //from  w  w w  .ja v  a2 s  . co m
 * @param x
 *       The X coordinate of the canvas.
 * 
 * @param y
 *       The Y coordinate of the canvas.
 */
private void handlePaletteCanvasLeftClick(int x, int y) {
    int paletteIndexClick = renderData.getSelectedIndex(x, y);

    // If we clicked off a box or clicked on the same box again...
    if (paletteIndexClick == NO_SELECTED_INDEX || paletteIndexClick == selectedIndex) {
        unsetCanvasSelection();
        renderData.paintPalette(); // Re-render without the selected box.
        return;
    }

    // Since we clicked on a new palette index, load the data.
    selectedIndex = paletteIndexClick;

    Color color = playpalEntry.getPaletteColor(paletteLayerToView, selectedIndex);
    int r = (int) (color.getRed() * 255);
    int g = (int) (color.getGreen() * 255);
    int b = (int) (color.getBlue() * 255);
    redSelectionLabel.setText(RED_TEXT + r);
    greenSelectionLabel.setText(GREEN_TEXT + g);
    blueSelectionLabel.setText(BLUE_TEXT + b);

    // Render again with the selected box.
    renderData.paintPalette();
}

From source file:editeurpanovisu.EditeurPanovisu.java

private void genereVisite() throws IOException {
    if (!repertSauveChoisi) {
        repertoireProjet = currentDir;//from   w  w w . j  av a  2s.  c  o m
    }
    if (!dejaSauve) {
        projetSauve();
    }
    if (dejaSauve) {
        deleteDirectory(repertTemp + "/panovisu/images");
        File imagesRepert = new File(repertTemp + "/panovisu/images");
        if (!imagesRepert.exists()) {
            imagesRepert.mkdirs();
        }
        File boutonRepert = new File(repertTemp + "/panovisu/images/navigation");
        if (!boutonRepert.exists()) {
            boutonRepert.mkdirs();
        }
        File boussoleRepert = new File(repertTemp + "/panovisu/images/boussoles");
        if (!boussoleRepert.exists()) {
            boussoleRepert.mkdirs();
        }
        copieDirectory(repertAppli + File.separator + "panovisu/images/boussoles",
                boussoleRepert.getAbsolutePath());
        File planRepert = new File(repertTemp + "/panovisu/images/plan");
        if (!planRepert.exists()) {
            planRepert.mkdirs();
        }
        copieDirectory(repertAppli + File.separator + "panovisu/images/plan", planRepert.getAbsolutePath());
        File reseauRepert = new File(repertTemp + "/panovisu/images/reseaux");
        if (!reseauRepert.exists()) {
            reseauRepert.mkdirs();
        }
        copieDirectory(repertAppli + File.separator + "panovisu/images/reseaux",
                reseauRepert.getAbsolutePath());
        File interfaceRepert = new File(repertTemp + "/panovisu/images/interface");
        if (!interfaceRepert.exists()) {
            interfaceRepert.mkdirs();
        }
        copieDirectory(repertAppli + File.separator + "panovisu/images/interface",
                interfaceRepert.getAbsolutePath());
        File MARepert = new File(repertTemp + "/panovisu/images/MA");
        if (!MARepert.exists()) {
            MARepert.mkdirs();
        }
        File hotspotsRepert = new File(repertTemp + "/panovisu/images/hotspots");
        if (!hotspotsRepert.exists()) {
            hotspotsRepert.mkdirs();
        }
        copieFichierRepertoire(repertAppli + File.separator + "panovisu" + File.separator + "images"
                + File.separator + "aide_souris.png", repertTemp + "/panovisu/images");
        copieFichierRepertoire(repertAppli + File.separator + "panovisu" + File.separator + "images"
                + File.separator + "fermer.png", repertTemp + "/panovisu/images");
        copieFichierRepertoire(repertAppli + File.separator + "panovisu" + File.separator + "images"
                + File.separator + "precedent.png", repertTemp + "/panovisu/images");
        copieFichierRepertoire(repertAppli + File.separator + "panovisu" + File.separator + "images"
                + File.separator + "suivant.png", repertTemp + "/panovisu/images");
        for (int i = 0; i < gestionnaireInterface.nombreImagesBouton - 1; i++) {
            ReadWriteImage.writePng(gestionnaireInterface.nouveauxBoutons[i],
                    boutonRepert.getAbsolutePath() + File.separator + gestionnaireInterface.nomImagesBoutons[i],
                    false, 0.f);
        }
        ReadWriteImage.writePng(
                gestionnaireInterface.nouveauxBoutons[gestionnaireInterface.nombreImagesBouton - 1],
                hotspotsRepert.getAbsolutePath() + File.separator + "hotspot.png", false, 0.f);
        ReadWriteImage.writePng(gestionnaireInterface.nouveauxBoutons[gestionnaireInterface.nombreImagesBouton],
                hotspotsRepert.getAbsolutePath() + File.separator + "hotspotImage.png", false, 0.f);
        ReadWriteImage.writePng(gestionnaireInterface.nouveauxMasque,
                MARepert.getAbsolutePath() + File.separator + "MA.png", false, 0.f);

        File xmlRepert = new File(repertTemp + File.separator + "xml");
        if (!xmlRepert.exists()) {
            xmlRepert.mkdirs();
        }
        File cssRepert = new File(repertTemp + File.separator + "css");
        if (!cssRepert.exists()) {
            cssRepert.mkdirs();
        }
        File jsRepert = new File(repertTemp + File.separator + "js");
        if (!jsRepert.exists()) {
            jsRepert.mkdirs();
        }
        String contenuFichier;
        File xmlFile;
        String chargeImages = "";

        for (int i = 0; i < nombrePanoramiques; i++) {
            String fPano = "panos/" + panoramiquesProjet[i].getNomFichier()
                    .substring(panoramiquesProjet[i].getNomFichier().lastIndexOf(File.separator) + 1,
                            panoramiquesProjet[i].getNomFichier().length())
                    .split("\\.")[0];
            if (panoramiquesProjet[i].getTypePanoramique().equals(Panoramique.CUBE)) {
                fPano = fPano.substring(0, fPano.length() - 2);
                chargeImages += "                images[" + i + "]=\"" + fPano + "_f.jpg\"\n";
                chargeImages += "                images[" + i + "]=\"" + fPano + "_b.jpg\"\n";
                chargeImages += "                images[" + i + "]=\"" + fPano + "_u.jpg\"\n";
                chargeImages += "                images[" + i + "]=\"" + fPano + "_d.jpg\"\n";
                chargeImages += "                images[" + i + "]=\"" + fPano + "_r.jpg\"\n";
                chargeImages += "                images[" + i + "]=\"" + fPano + "_l.jpg\"\n";
            } else {
                chargeImages += "                images[" + i + "]=\"" + fPano + ".jpg\"\n";
            }
            String affInfo = (panoramiquesProjet[i].isAfficheInfo()) ? "oui" : "non";
            String affTitre = (gestionnaireInterface.bAfficheTitre) ? "oui" : "non";
            double regX;
            double zN;
            if (panoramiquesProjet[i].getTypePanoramique().equals(Panoramique.SPHERE)) {
                regX = Math.round(((panoramiquesProjet[i].getLookAtX() - 180) % 360) * 10) / 10;
                zN = Math.round(((panoramiquesProjet[i].getZeroNord() - 180) % 360) * 10) / 10;
            } else {
                regX = Math.round(((panoramiquesProjet[i].getLookAtX() + 90) % 360) * 10) / 10;
                zN = Math.round(((panoramiquesProjet[i].getZeroNord() + 90) % 360) * 10) / 10;
            }
            int rouge = (int) (Color.valueOf(gestionnaireInterface.couleurDiaporama).getRed() * 255.d);
            int bleu = (int) (Color.valueOf(gestionnaireInterface.couleurDiaporama).getBlue() * 255.d);
            int vert = (int) (Color.valueOf(gestionnaireInterface.couleurDiaporama).getGreen() * 255.d);
            String coulDiapo = "rgba(" + rouge + "," + vert + "," + bleu + ","
                    + gestionnaireInterface.diaporamaOpacite + ")";

            Color coulTitre = Color.valueOf(gestionnaireInterface.couleurFondTitre);
            rouge = (int) (coulTitre.getRed() * 255.d);
            bleu = (int) (coulTitre.getBlue() * 255.d);
            vert = (int) (coulTitre.getGreen() * 255.d);
            String coulFondTitre = "rgba(" + rouge + "," + vert + "," + bleu + ","
                    + gestionnaireInterface.titreOpacite + ")";

            contenuFichier = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--\n"
                    + "     Visite gnre par l'diteur panoVisu \n" + "\n"
                    + "             Cration L.LANG      le monde  360  : http://lemondea360.fr\n"
                    + "-->\n" + "\n" + "\n" + "<scene>\n" + "   <pano \n" + "      image=\"" + fPano + "\"\n"
                    + "      titre=\"" + panoramiquesProjet[i].getTitrePanoramique() + "\"\n"
                    + "      titrePolice=\"" + gestionnaireInterface.titrePoliceNom + "\"\n"
                    + "      titreTaillePolice=\""
                    + Math.round(Double.parseDouble(gestionnaireInterface.titrePoliceTaille)) + "px\"\n"
                    + "      titreTaille=\"" + Math.round(gestionnaireInterface.titreTaille) + "%\"\n"
                    + "      titreFond=\"" + coulFondTitre + "\"\n" + "      titreCouleur=\""
                    + gestionnaireInterface.couleurTitre + "\"\n"
                    //                        + "      titreOpacite=\"" + gestionnaireInterface.titreOpacite + "\"\n"
                    + "      diaporamaCouleur=\"" + coulDiapo + "\"\n" + "      type=\""
                    + panoramiquesProjet[i].getTypePanoramique() + "\"\n" + "      multiReso=\"oui\"\n"
                    + "      nombreNiveaux=\"" + panoramiquesProjet[i].getNombreNiveaux() + "\"\n"
                    + "      zeroNord=\"" + zN + "\"\n" + "      regardX=\"" + regX + "\"\n"
                    + "      regardY=\"" + Math.round(panoramiquesProjet[i].getLookAtY() * 10) / 10 + "\"\n"
                    + "      affinfo=\"" + affInfo + "\"\n" + "      afftitre=\"" + affTitre + "\"\n"
                    + "   />\n" + "   <!--Dfinition de la Barre de navigation-->\n" + "   <boutons \n"
                    + "      styleBoutons=\"navigation\"\n" + "      couleur=\"rgba(255,255,255,0)\"\n"
                    + "      bordure=\"rgba(255,255,255,0)\"\n" + "      deplacements=\""
                    + gestionnaireInterface.toggleBarreDeplacements + "\" \n" + "      zoom=\""
                    + gestionnaireInterface.toggleBarreZoom + "\" \n" + "      outils=\""
                    + gestionnaireInterface.toggleBarreOutils + "\"\n" + "      fs=\""
                    + gestionnaireInterface.toggleBoutonFS + "\" \n" + "      souris=\""
                    + gestionnaireInterface.toggleBoutonSouris + "\" \n" + "      rotation=\""
                    + gestionnaireInterface.toggleBoutonRotation + "\" \n" + "      positionX=\""
                    + gestionnaireInterface.positionBarre.split(":")[1] + "\"\n" + "      positionY=\""
                    + gestionnaireInterface.positionBarre.split(":")[0] + "\" \n" + "      dX=\""
                    + gestionnaireInterface.dXBarre + "\" \n" + "      dY=\"" + gestionnaireInterface.dYBarre
                    + "\"\n" + "      espacement=\"" + Math.round(gestionnaireInterface.espacementBoutons)
                    + "\"\n" + "      visible=\"" + gestionnaireInterface.toggleBarreVisibilite + "\"\n"
                    + "   />\n";
            if (gestionnaireInterface.bAfficheBoussole) {
                String SAiguille = (gestionnaireInterface.bAiguilleMobileBoussole) ? "oui" : "non";
                contenuFichier += "<!--  Boussole -->\n" + "    <boussole \n" + "        affiche=\"oui\"\n"
                        + "        image=\"" + gestionnaireInterface.imageBoussole + "\"\n"
                        + "        taille=\"" + gestionnaireInterface.tailleBoussole + "\"\n"
                        + "        positionY=\"" + gestionnaireInterface.positionBoussole.split(":")[0] + "\"\n"
                        + "        positionX=\"" + gestionnaireInterface.positionBoussole.split(":")[1] + "\"\n"
                        + "        opacite=\"" + gestionnaireInterface.opaciteBoussole + "\"\n"
                        + "        dX=\"" + gestionnaireInterface.dXBoussole + "\"\n" + "        dY=\""
                        + gestionnaireInterface.dYBoussole + "\"\n" + "        aiguille=\"" + SAiguille + "\"\n"
                        + "    />\n";
            }
            if (gestionnaireInterface.bAfficheMenuContextuel) {
                String SPrecSuiv = (gestionnaireInterface.bAffichePrecSuivMC) ? "oui" : "non";
                String SPlanet = (gestionnaireInterface.bAffichePlanetNormalMC) ? "oui" : "non";
                String SPers1 = (gestionnaireInterface.bAffichePersMC1) ? "oui" : "non";
                String SPers2 = (gestionnaireInterface.bAffichePersMC2) ? "oui" : "non";
                contenuFichier += "<!--  MenuContextuel -->\n" + "    <menuContextuel \n"
                        + "        affiche=\"oui\"\n" + "        precSuiv=\"" + SPrecSuiv + "\"\n"
                        + "        planete=\"" + SPlanet + "\"\n" + "        pers1=\"" + SPers1 + "\"\n"
                        + "        lib1=\"" + gestionnaireInterface.stPersLib1 + "\"\n" + "        url1=\""
                        + gestionnaireInterface.stPersURL1 + "\"\n" + "        pers2=\"" + SPers2 + "\"\n"
                        + "        lib2=\"" + gestionnaireInterface.stPersLib2 + "\"\n" + "        url2=\""
                        + gestionnaireInterface.stPersURL2 + "\"\n" + "    />\n";
            }
            if (gestionnaireInterface.bSuivantPrecedent) {

                int panoPrecedent = (i == nombrePanoramiques - 1) ? 0 : i + 1;
                int panoSuivant = (i == 0) ? nombrePanoramiques - 1 : i - 1;
                String nomPano = panoramiquesProjet[panoSuivant].getNomFichier();
                String strPanoSuivant = "xml/"
                        + nomPano.substring(nomPano.lastIndexOf(File.separator) + 1, nomPano.lastIndexOf("."))
                        + ".xml";
                nomPano = panoramiquesProjet[panoPrecedent].getNomFichier();
                String strPanoPrecedent = "xml/"
                        + nomPano.substring(nomPano.lastIndexOf(File.separator) + 1, nomPano.lastIndexOf("."))
                        + ".xml";
                contenuFichier += "<!--  Bouton Suivant Precedent -->\n" + "    <suivantPrecedent\n"
                        + "        suivant=\"" + strPanoSuivant + "\"            \n" + "        precedent=\""
                        + strPanoPrecedent + "\"            \n" + "    />    \n" + "";
            }
            if (gestionnaireInterface.bAfficheMasque) {
                String SNavigation = (gestionnaireInterface.bMasqueNavigation) ? "oui" : "non";
                String SBoussole = (gestionnaireInterface.bMasqueBoussole) ? "oui" : "non";
                String STitre = (gestionnaireInterface.bMasqueTitre) ? "oui" : "non";
                String splan = (gestionnaireInterface.bMasquePlan) ? "oui" : "non";
                String SReseaux = (gestionnaireInterface.bMasqueReseaux) ? "oui" : "non";
                String SVignettes = (gestionnaireInterface.bMasqueVignettes) ? "oui" : "non";
                contenuFichier += "<!--  Bouton de Masquage -->\n" + "    <marcheArret \n"
                        + "        affiche=\"oui\"\n" + "        image=\"MA.png\"\n" + "        taille=\""
                        + gestionnaireInterface.tailleMasque + "\"\n" + "        positionY=\""
                        + gestionnaireInterface.positionMasque.split(":")[0] + "\"\n" + "        positionX=\""
                        + gestionnaireInterface.positionMasque.split(":")[1] + "\"\n" + "        opacite=\""
                        + gestionnaireInterface.opaciteMasque + "\"\n" + "        dX=\""
                        + gestionnaireInterface.dXMasque + "\"\n" + "        dy=\""
                        + gestionnaireInterface.dYMasque + "\"\n" + "        navigation=\"" + SNavigation
                        + "\"\n" + "        boussole=\"" + SBoussole + "\"\n" + "        titre=\"" + STitre
                        + "\"\n" + "        plan=\"" + splan + "\"\n" + "        reseaux=\"" + SReseaux + "\"\n"
                        + "        vignettes=\"" + SVignettes + "\"\n" + "    />\n";
            }

            if (gestionnaireInterface.bAfficheReseauxSociaux) {
                String STwitter = (gestionnaireInterface.bReseauxSociauxTwitter) ? "oui" : "non";
                String SGoogle = (gestionnaireInterface.bReseauxSociauxGoogle) ? "oui" : "non";
                String SFacebook = (gestionnaireInterface.bReseauxSociauxFacebook) ? "oui" : "non";
                String SEmail = (gestionnaireInterface.bReseauxSociauxEmail) ? "oui" : "non";
                contenuFichier += "<!--  Rseaux Sociaux -->\n" + "    <reseauxSociaux \n"
                        + "        affiche=\"oui\"\n" + "        taille=\""
                        + gestionnaireInterface.tailleReseauxSociaux + "\"\n" + "        positionY=\""
                        + gestionnaireInterface.positionReseauxSociaux.split(":")[0] + "\"\n"
                        + "        positionX=\"" + gestionnaireInterface.positionReseauxSociaux.split(":")[1]
                        + "\"\n" + "        opacite=\"" + gestionnaireInterface.opaciteReseauxSociaux + "\"\n"
                        + "        dX=\"" + gestionnaireInterface.dXReseauxSociaux + "\"\n" + "        dY=\""
                        + gestionnaireInterface.dYReseauxSociaux + "\"\n" + "        twitter=\"" + STwitter
                        + "\"\n" + "        google=\"" + SGoogle + "\"\n" + "        facebook=\"" + SFacebook
                        + "\"\n" + "        email=\"" + SEmail + "\"\n" + "    />\n";
            }
            if (gestionnaireInterface.bAfficheVignettes) {
                String SAfficheVignettes = (gestionnaireInterface.bAfficheVignettes) ? "oui" : "non";
                contenuFichier += "<!-- Barre des vignettes -->" + "    <vignettes \n" + "        affiche=\""
                        + SAfficheVignettes + "\"\n" + "        tailleImage=\""
                        + gestionnaireInterface.tailleImageVignettes + "\"\n" + "        fondCouleur=\""
                        + gestionnaireInterface.couleurFondVignettes + "\"\n" + "        texteCouleur=\""
                        + gestionnaireInterface.couleurTexteVignettes + "\"\n" + "        opacite=\""
                        + gestionnaireInterface.opaciteVignettes + "\"\n" + "        position=\""
                        + gestionnaireInterface.positionVignettes + "\"\n" + "    >\n";
                for (int j = 0; j < nombrePanoramiques; j++) {
                    String nomPano = panoramiquesProjet[j].getNomFichier();
                    String nFichier = nomPano.substring(nomPano.lastIndexOf(File.separator) + 1,
                            nomPano.lastIndexOf(".")) + "Vignette.jpg";
                    String nXML = nomPano.substring(nomPano.lastIndexOf(File.separator) + 1,
                            nomPano.lastIndexOf(".")) + ".xml";
                    ReadWriteImage.writeJpeg(panoramiquesProjet[j].getVignettePanoramique(),
                            repertTemp + "/panos/" + nFichier, 1.0f, false, 0.0f);
                    contenuFichier += "        <imageVignette \n" + "            image=\"panos/" + nFichier
                            + "\"\n" + "            xml=\"xml/" + nXML + "\"\n" + "        />\n";
                }
                contenuFichier += "    </vignettes>       \n" + "";

            }

            contenuFichier += "    <!--Dfinition des hotspots-->  \n" + "   <hotspots>\n";
            for (int j = 0; j < panoramiquesProjet[i].getNombreHotspots(); j++) {
                HotSpot HS = panoramiquesProjet[i].getHotspot(j);
                double longit;
                if (panoramiquesProjet[i].getTypePanoramique().equals(Panoramique.SPHERE)) {
                    longit = HS.getLongitude() - 180;
                } else {
                    longit = HS.getLongitude() + 90;
                }
                String txtAnime = (HS.isAnime()) ? "true" : "false";
                contenuFichier += "      <point \n" + "           type=\"panoramique\"\n" + "           long=\""
                        + longit + "\"\n" + "           lat=\"" + HS.getLatitude() + "\"\n"
                        + "           image=\"panovisu/images/hotspots/hotspot.png\"\n"
                        + "           xml=\"xml/" + HS.getFichierXML() + "\"\n" + "           info=\""
                        + HS.getInfo() + "\"\n" + "           anime=\"" + txtAnime + "\"\n" + "      />\n";
            }
            for (int j = 0; j < panoramiquesProjet[i].getNombreHotspotImage(); j++) {
                HotspotImage HS = panoramiquesProjet[i].getHotspotImage(j);
                double longit;
                if (panoramiquesProjet[i].getTypePanoramique().equals(Panoramique.SPHERE)) {
                    longit = HS.getLongitude() - 180;
                } else {
                    longit = HS.getLongitude() + 90;
                }
                String txtAnime = (HS.isAnime()) ? "true" : "false";
                contenuFichier += "      <point \n" + "           type=\"image\"\n" + "           long=\""
                        + longit + "\"\n" + "           lat=\"" + HS.getLatitude() + "\"\n"
                        + "           image=\"panovisu/images/hotspots/hotspotImage.png\"\n"
                        + "           img=\"images/" + HS.getLienImg() + "\"\n" + "           info=\""
                        + HS.getInfo() + "\"\n" + "           anime=\"" + txtAnime + "\"\n" + "      />\n";
            }
            contenuFichier += "   </hotspots>\n";
            contenuFichier += "\n" + "<!-- Dfinition des images de fond -->\n" + "\n";
            if (gestionnaireInterface.nombreImagesFond > 0) {
                for (int ii = 0; ii < gestionnaireInterface.nombreImagesFond; ii++) {
                    ImageFond imgFond = gestionnaireInterface.imagesFond[ii];
                    String strImgFond = "images/" + imgFond.getFichierImage().substring(
                            imgFond.getFichierImage().lastIndexOf(File.separator) + 1,
                            imgFond.getFichierImage().length());
                    String SMasquable = (imgFond.isMasquable()) ? "oui" : "non";

                    contenuFichier += "    <imageFond\n" + "        fichier=\"" + strImgFond + "\"\n"
                            + "        posX=\"" + imgFond.getPosX() + "\" \n" + "        posY=\""
                            + imgFond.getPosY() + "\" \n" + "        offsetX=\"" + imgFond.getOffsetX()
                            + "\" \n" + "        offsetY=\"" + imgFond.getOffsetY() + "\" \n"
                            + "        tailleX=\"" + imgFond.getTailleX() + "\" \n" + "        tailleY=\""
                            + imgFond.getTailleY() + "\" \n" + "        opacite=\"" + imgFond.getOpacite()
                            + "\" \n" + "        masquable=\"" + SMasquable + "\" \n" + "        url=\""
                            + imgFond.getUrl() + "\" \n" + "        infobulle=\"" + imgFond.getInfobulle()
                            + "\" \n" + "    />\n" + "";
                }
            }
            if (gestionnaireInterface.bAffichePlan && panoramiquesProjet[i].isAffichePlan()) {
                int numPlan = panoramiquesProjet[i].getNumeroPlan();
                Plan planPano = plans[numPlan];
                rouge = (int) (gestionnaireInterface.couleurFondPlan.getRed() * 255.d);
                bleu = (int) (gestionnaireInterface.couleurFondPlan.getBlue() * 255.d);
                vert = (int) (gestionnaireInterface.couleurFondPlan.getGreen() * 255.d);
                String SAfficheRadar = (gestionnaireInterface.bAfficheRadar) ? "oui" : "non";
                String coulFond = "rgba(" + rouge + "," + vert + "," + bleu + ","
                        + gestionnaireInterface.opacitePlan + ")";
                contenuFichier += "    <plan\n" + "        affiche=\"oui\" \n" + "        image=\"images/"
                        + planPano.getImagePlan() + "\"\n" + "        largeur=\""
                        + gestionnaireInterface.largeurPlan + "\"\n" + "        position=\""
                        + gestionnaireInterface.positionPlan + "\"\n" + "        couleurFond=\"" + coulFond
                        + "\"\n" + "        couleurTexte=\"#" + gestionnaireInterface.txtCouleurTextePlan
                        + "\"\n" + "        nord=\"" + planPano.getDirectionNord() + "\"\n"
                        + "        boussolePosition=\"" + planPano.getPosition() + "\"\n"
                        + "        boussoleX=\"" + planPano.getPositionX() + "\"\n" + "        boussoleY=\""
                        + planPano.getPositionX() + "\"\n" + "        radarAffiche=\"" + SAfficheRadar + "\"\n"
                        + "        radarTaille=\"" + Math.round(gestionnaireInterface.tailleRadar) + "\"\n"
                        + "        radarCouleurFond=\"#" + gestionnaireInterface.txtCouleurFondRadar + "\"\n"
                        + "        radarCouleurLigne=\"#" + gestionnaireInterface.txtCouleurLigneRadar + "\"\n"
                        + "        radarOpacite=\""
                        + Math.round(gestionnaireInterface.opaciteRadar * 100.d) / 100.d + "\"\n" + "    >\n";
                for (int iPoint = 0; iPoint < planPano.getNombreHotspots(); iPoint++) {
                    double posX = planPano.getHotspot(iPoint).getLongitude()
                            * gestionnaireInterface.largeurPlan;
                    double posY = planPano.getHotspot(iPoint).getLatitude() * planPano.getHauteurPlan()
                            * gestionnaireInterface.largeurPlan / planPano.getLargeurPlan();
                    if (planPano.getHotspot(iPoint).getNumeroPano() == i) {
                        contenuFichier += "        <pointPlan\n" + "            positX=\"" + posX + "\"\n"
                                + "            positY=\"" + posY + "\"\n" + "            xml=\"actif\"\n"
                                + "            />  \n";

                    } else {
                        contenuFichier += "        <pointPlan\n" + "            positX=\"" + posX + "\"\n"
                                + "            positY=\"" + posY + "\"\n" + "            xml=\"xml/"
                                + planPano.getHotspot(iPoint).getFichierXML() + "\"\n" + "            texte=\""
                                + planPano.getHotspot(iPoint).getInfo() + "\"\n" + "            />  \n";
                    }
                }
                contenuFichier += "    </plan>\n";
            }

            contenuFichier += "</scene>\n";
            String fichierPano = panoramiquesProjet[i].getNomFichier();
            String nomXMLFile = fichierPano
                    .substring(fichierPano.lastIndexOf(File.separator) + 1, fichierPano.length())
                    .split("\\.")[0] + ".xml";
            xmlFile = new File(xmlRepert + File.separator + nomXMLFile);
            xmlFile.setWritable(true);
            FileWriter fw = new FileWriter(xmlFile);
            try (BufferedWriter bw = new BufferedWriter(fw)) {
                bw.write(contenuFichier);
            }
        }
        Dimension tailleEcran = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        int hauteur = (int) tailleEcran.getHeight() - 200;
        String titreVis = "Panovisu - visualiseur 100% html5 (three.js)";
        TextArea tfVisite = (TextArea) paneChoixPanoramique.lookup("#titreVisite");
        if (!tfVisite.getText().equals("")) {
            titreVis = tfVisite.getText() + " - " + titreVis;
        }
        String fPano1 = "panos/niveau0/" + panoramiquesProjet[0].getNomFichier().substring(
                panoramiquesProjet[0].getNomFichier().lastIndexOf(File.separator) + 1,
                panoramiquesProjet[0].getNomFichier().length());

        String fichierHTML = "<!DOCTYPE html>\n" + "<html lang=\"fr\">\n" + "    <head>\n" + "        <title>"
                + titreVis + "</title>\n" + "        <meta charset=\"utf-8\">\n"
                + "        <meta name=\"viewport\" content=\"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0\">\n"
                + "        <link rel=\"stylesheet\" media=\"screen\" href=\"panovisu/libs/jqueryMenu/jquery.contextMenu.css\" type=\"text/css\"/>\n"
                + "        <meta property=\"og:title\" content=\"" + titreVis + "\" />\n"
                + "        <meta property=\"og:description\" content=\"Une page cre avec panoVisu Editeur : 100% Libre 100% HTML5\" />\n"
                + "        <meta property=\"og:image\" content=\"" + fPano1 + "\" />" + "    </head>\n"
                + "    <body>\n" + "        <header>\n" + "\n" + "        </header>\n"
                + "        <article style=\"height : " + hauteur + "px;\">\n"
                + "            <div id=\"pano\">\n" + "            </div>\n" + "        </article>\n"
                + "        <script src=\"panovisu/panovisuInit.js\"></script>\n"
                + "        <script src=\"panovisu/panovisu.js\"></script>\n" + "        <script>\n" + "\n"
                + "            $(function() {\n" + "                $(window).resize(function(){\n"
                + "                    $(\"article\").height($(window).height()-10);\n"
                + "                    $(\"#pano\").height($(window).height()-10);\n" + "                })\n"
                + "                $(\"article\").height($(window).height()-10);\n"
                + "                $(\"#pano\").height($(window).height()-10);\n"
                + "                ajoutePano({\n" + "                    langue : \"" + locale.toString()
                + "\",\n" + "                    panoramique: \"pano\",\n" + "                    minFOV: 35,\n"
                + "                    maxFOV: 120,\n" + "                    fenX: \"100%\",\n"
                + "                    fenY: \"100%\",\n" + "                    xml: \"xml/PANO.xml\"\n"
                + "                });\n"
                + "                $(\".reseauSocial-twitter\").on(\"click\", function() {\n"
                + "                    window.open(\n"
                + "                            \"https://twitter.com/share?url=\" + document.location.href\n"
                + "                            );\n" + "                    return false;\n"
                + "                });\n"
                + "                $(\".reseauSocial-fb\").on(\"click\", function() {\n"
                + "                    window.open(\n"
                + "                            \"http://www.facebook.com/share.php?u=\" + document.location.href\n"
                + "                            );\n" + "                    return false;\n"
                + "                });\n"
                + "                $(\".reseauSocial-google\").on(\"click\", function() {\n"
                + "                    window.open(\n"
                + "                            \"https://plus.google.com/share?url=\" + document.location.href + \"&amp;hl=fr\"\n"
                + "                            );\n" + "                    return false;\n"
                + "                });\n"
                + "                $(\".reseauSocial-email\").attr(\"href\",\"mailto:?body=\" + document.location.href + \"&amp;hl=fr\");\n"
                //                    + "                images=new Array();\n"
                //                    + chargeImages
                //                    + "                prechargeImages(images); \n \n"
                + "            });\n" + "        </script>\n" + "    </body>\n" + "</html>\n";
        if (panoEntree.equals("")) {
            fichierHTML = fichierHTML
                    .replace("PANO",
                            panoramiquesProjet[0].getNomFichier()
                                    .substring(panoramiquesProjet[0].getNomFichier().lastIndexOf(File.separator)
                                            + 1, panoramiquesProjet[0].getNomFichier().length())
                                    .split("\\.")[0]);
        } else {
            fichierHTML = fichierHTML.replace("PANO", panoEntree);
        }
        File fichIndexHTML = new File(repertTemp + File.separator + "index.html");
        fichIndexHTML.setWritable(true);
        FileWriter fw1 = new FileWriter(fichIndexHTML);
        try (BufferedWriter bw1 = new BufferedWriter(fw1)) {
            bw1.write(fichierHTML);
        }
        DirectoryChooser repertChoix = new DirectoryChooser();
        repertChoix.setTitle("Choix du repertoire de sauvegarde de la visite");
        File repert = new File(EditeurPanovisu.repertoireProjet);
        repertChoix.setInitialDirectory(repert);
        File repertVisite = repertChoix.showDialog(null);

        String nomRepertVisite = repertVisite.getAbsolutePath();
        copieDirectory(repertTemp, nomRepertVisite);
        Dialogs.create().title("Gnration de la visite")
                .message("Votre visite a bien t gnr dans le rpertoire : " + nomRepertVisite)
                .showInformation();
        if (Desktop.isDesktopSupported()) {
            if (Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
                Desktop dt = Desktop.getDesktop();
                File fIndex = new File(nomRepertVisite + File.separator + "index.html");
                dt.browse(fIndex.toURI());
            }
        }
    } else {
        Dialogs.create().title("Gnration de la visite")
                .message("Votre visite n'a pu tre gnre, votre fichier n'tant pas sauvegard")
                .showError();

    }
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @throws IOException Exception d'entre sortie
 *///from   w w  w.  j a v a 2 s . c o  m
private static void genereVisite() throws IOException {
    if (!bRepertSauveChoisi) {
        setStrRepertoireProjet(getStrCurrentDir());
    }
    if (!isbDejaSauve()) {
        projetSauve();
    }
    if (isbDejaSauve()) {
        String strHTMLRepert = getStrRepertTemp() + "/pagesHTML";
        File fileHTMLRepert = new File(strHTMLRepert);
        if (!fileHTMLRepert.exists()) {
            fileHTMLRepert.mkdirs();
        }
        deleteDirectory(getStrRepertTemp() + "/panovisu/images");
        File fileImagesRepert = new File(getStrRepertTemp() + "/panovisu/images");
        if (!fileImagesRepert.exists()) {
            fileImagesRepert.mkdirs();
        }
        File fileBoutonRepert = new File(getStrRepertTemp() + "/panovisu/images/navigation");
        if (!fileBoutonRepert.exists()) {
            fileBoutonRepert.mkdirs();
        }
        File fileBoussoleRepert = new File(getStrRepertTemp() + "/panovisu/images/boussoles");
        if (!fileBoussoleRepert.exists()) {
            fileBoussoleRepert.mkdirs();
        }
        copieRepertoire(getStrRepertAppli() + File.separator + "panovisu/images/boussoles",
                fileBoussoleRepert.getAbsolutePath());
        File filePlanRepert = new File(getStrRepertTemp() + "/panovisu/images/plan");
        if (!filePlanRepert.exists()) {
            filePlanRepert.mkdirs();
        }
        copieRepertoire(getStrRepertAppli() + File.separator + "panovisu/images/plan",
                filePlanRepert.getAbsolutePath());
        File fileReseauRepert = new File(getStrRepertTemp() + "/panovisu/images/reseaux");
        if (!fileReseauRepert.exists()) {
            fileReseauRepert.mkdirs();
        }
        copieRepertoire(getStrRepertAppli() + File.separator + "panovisu/images/reseaux",
                fileReseauRepert.getAbsolutePath());
        File fileInterfaceRepert = new File(getStrRepertTemp() + "/panovisu/images/interface");
        if (!fileInterfaceRepert.exists()) {
            fileInterfaceRepert.mkdirs();
        }
        copieRepertoire(getStrRepertAppli() + File.separator + "panovisu/images/interface",
                fileInterfaceRepert.getAbsolutePath());
        File fileMARepert = new File(getStrRepertTemp() + "/panovisu/images/MA");
        if (!fileMARepert.exists()) {
            fileMARepert.mkdirs();
        }
        File fileHotspotsRepert = new File(getStrRepertTemp() + "/panovisu/images/hotspots");
        if (!fileHotspotsRepert.exists()) {
            fileHotspotsRepert.mkdirs();
        }
        if (getGestionnaireInterface().getStrVisibiliteBarrePersonnalisee().equals("oui")) {
            File fileTelecommandeRepert = new File(getStrRepertTemp() + "/panovisu/images/telecommande");
            if (!fileTelecommandeRepert.exists()) {
                fileTelecommandeRepert.mkdirs();
            }
            ReadWriteImage.writePng(getGestionnaireInterface().getWiBarrePersonnaliseeCouleur(),
                    getStrRepertTemp() + "/panovisu/images/telecommande" + File.separator + "telecommande.png",
                    false, 0.f);
            copieFichierRepertoire(getStrRepertAppli() + "/theme/telecommandes" + File.separator + "fs.png",
                    getStrRepertTemp() + "/panovisu/images/telecommande");
            copieFichierRepertoire(getStrRepertAppli() + "/theme/telecommandes" + File.separator + "fs2.png",
                    getStrRepertTemp() + "/panovisu/images/telecommande");
            copieFichierRepertoire(getStrRepertAppli() + "/theme/telecommandes" + File.separator + "souris.png",
                    getStrRepertTemp() + "/panovisu/images/telecommande");
            copieFichierRepertoire(
                    getStrRepertAppli() + "/theme/telecommandes" + File.separator + "souris2.png",
                    getStrRepertTemp() + "/panovisu/images/telecommande");
            copieFichierRepertoire(getStrRepertAppli() + "/theme/telecommandes" + File.separator + "aide.png",
                    getStrRepertTemp() + "/panovisu/images/telecommande");
            copieFichierRepertoire(getStrRepertAppli() + "/theme/telecommandes" + File.separator + "info.png",
                    getStrRepertTemp() + "/panovisu/images/telecommande");
            copieFichierRepertoire(
                    getStrRepertAppli() + "/theme/telecommandes" + File.separator + "rotation.png",
                    getStrRepertTemp() + "/panovisu/images/telecommande");
            copieFichierRepertoire(getStrRepertAppli() + "/theme/telecommandes" + File.separator + "zoomin.png",
                    getStrRepertTemp() + "/panovisu/images/telecommande");
            copieFichierRepertoire(
                    getStrRepertAppli() + "/theme/telecommandes" + File.separator + "zoomout.png",
                    getStrRepertTemp() + "/panovisu/images/telecommande");
        }
        copieFichierRepertoire(getStrRepertAppli() + "/theme" + File.separator + "chargement.gif",
                getStrRepertTemp() + "/panovisu/images");
        copieFichierRepertoire(getStrRepertAppli() + File.separator + "panovisu" + File.separator + "images"
                + File.separator + "aide_souris.png", getStrRepertTemp() + "/panovisu/images");
        copieFichierRepertoire(getStrRepertAppli() + File.separator + "panovisu" + File.separator + "images"
                + File.separator + "fermer.png", getStrRepertTemp() + "/panovisu/images");
        copieFichierRepertoire(getStrRepertAppli() + File.separator + "panovisu" + File.separator + "images"
                + File.separator + "precedent.png", getStrRepertTemp() + "/panovisu/images");
        copieFichierRepertoire(getStrRepertAppli() + File.separator + "panovisu" + File.separator + "images"
                + File.separator + "suivant.png", getStrRepertTemp() + "/panovisu/images");
        for (int i = 0; i < getGestionnaireInterface().getiNombreImagesBouton() - 2; i++) {
            ReadWriteImage.writePng(
                    getGestionnaireInterface().getWiNouveauxBoutons()[i], fileBoutonRepert.getAbsolutePath()
                            + File.separator + getGestionnaireInterface().getStrNomImagesBoutons()[i],
                    false, 0.f);
        }
        if (!strTypeHS.equals("gif")) {
            ReadWriteImage.writePng(
                    getGestionnaireInterface()
                            .getWiNouveauxBoutons()[getGestionnaireInterface().getiNombreImagesBouton() - 2],
                    fileHotspotsRepert.getAbsolutePath() + File.separator + "hotspot.png", false, 0.f);
        } else {
            copieFichierRepertoire(getStrRepertAppli() + "/theme/hotspots" + File.separator + strNomfichierHS,
                    fileHotspotsRepert.getAbsolutePath() + File.separator);
        }

        if (!strTypeHSImage.equals("gif")) {
            ReadWriteImage.writePng(
                    getGestionnaireInterface()
                            .getWiNouveauxBoutons()[getGestionnaireInterface().getiNombreImagesBouton() - 1],
                    fileHotspotsRepert.getAbsolutePath() + File.separator + "hotspotImage.png", false, 0.f);
        } else {
            copieFichierRepertoire(
                    getStrRepertAppli() + "/theme/photos" + File.separator + strNomfichierHSImage,
                    fileHotspotsRepert.getAbsolutePath() + File.separator);
        }
        if (!strTypeHSHTML.equals("gif")) {
            ReadWriteImage.writePng(
                    getGestionnaireInterface().getWiNouveauxBoutons()[getGestionnaireInterface()
                            .getiNombreImagesBouton()],
                    fileHotspotsRepert.getAbsolutePath() + File.separator + "hotspotHTML.png", false, 0.f);
        } else {
            copieFichierRepertoire(getStrRepertAppli() + "/theme/html" + File.separator + strNomfichierHSHTML,
                    fileHotspotsRepert.getAbsolutePath() + File.separator);
        }

        ReadWriteImage.writePng(getGestionnaireInterface().getWiNouveauxMasque(),
                fileMARepert.getAbsolutePath() + File.separator + "MA.png", false, 0.f);

        if (getGestionnaireInterface().isbAfficheCarte()) {
            File filemarqueursOL = new File(getStrRepertTemp() + "/panovisu/images/marqueursOL");
            if (!filemarqueursOL.exists()) {
                filemarqueursOL.mkdirs();
            }
            copieFichierRepertoire(
                    getStrRepertAppli() + File.separator + "theme" + File.separator + "marqueursOL"
                            + File.separator + "marqueur.png",
                    getStrRepertTemp() + File.separator + "panovisu/images/marqueursOL");
            copieFichierRepertoire(
                    getStrRepertAppli() + File.separator + "theme" + File.separator + "marqueursOL"
                            + File.separator + "home.png",
                    getStrRepertTemp() + File.separator + "panovisu/images/marqueursOL");
            copieFichierRepertoire(
                    getStrRepertAppli() + File.separator + "theme" + File.separator + "marqueursOL"
                            + File.separator + "marqueurActif.png",
                    getStrRepertTemp() + File.separator + "panovisu/images/marqueursOL");
        }
        if (getGestionnaireInterface().isbAfficheBoutonVisiteAuto()) {
            File filemarqueursAT = new File(getStrRepertTemp() + "/panovisu/images/visiteAutomatique");
            if (!filemarqueursAT.exists()) {
                filemarqueursAT.mkdirs();
            }
            copieFichierRepertoire(
                    getStrRepertAppli() + File.separator + "theme" + File.separator + "visiteAutomatique"
                            + File.separator + "playAutoTour.png",
                    getStrRepertTemp() + File.separator + "panovisu/images/visiteAutomatique");
            copieFichierRepertoire(
                    getStrRepertAppli() + File.separator + "theme" + File.separator + "visiteAutomatique"
                            + File.separator + "pauseAutoTour.png",
                    getStrRepertTemp() + File.separator + "panovisu/images/visiteAutomatique");
        }
        File fileXMLRepert = new File(getStrRepertTemp() + File.separator + "xml");
        if (!fileXMLRepert.exists()) {
            fileXMLRepert.mkdirs();
        }
        File fileCSSRepert = new File(getStrRepertTemp() + File.separator + "css");
        if (!fileCSSRepert.exists()) {
            fileCSSRepert.mkdirs();
        }
        File fileJsRepert = new File(getStrRepertTemp() + File.separator + "js");
        if (!fileJsRepert.exists()) {
            fileJsRepert.mkdirs();
        }
        String strContenuFichier;
        File fileXML;
        String strChargeImages = "";
        int iPanoEntree = Integer.parseInt(ordPano.getStrPanos().get(0));
        strPanoEntree = getPanoramiquesProjet()[iPanoEntree].getStrNomFichier()
                .substring(
                        getPanoramiquesProjet()[iPanoEntree].getStrNomFichier().lastIndexOf(File.separator) + 1,
                        getPanoramiquesProjet()[iPanoEntree].getStrNomFichier().length())
                .split("\\.")[0];
        for (int ii = 0; ii < ordPano.getStrPanos().size(); ii++) {
            int i = Integer.parseInt(ordPano.getStrPanos().get(ii));
            String strHTMLPanoRepert = strHTMLRepert + "/" + i;
            File fileHTMLPanoRepert = new File(strHTMLPanoRepert);
            if (!fileHTMLPanoRepert.exists()) {
                fileHTMLPanoRepert.mkdirs();
            }
            String strFichierPano = "panos/panovisu" + i;
            if (getPanoramiquesProjet()[i].getStrTypePanoramique().equals(Panoramique.CUBE)) {
                strChargeImages += "                images[" + i + "]=\"" + strFichierPano + "_f.jpg\"\n";
                strChargeImages += "                images[" + i + "]=\"" + strFichierPano + "_b.jpg\"\n";
                strChargeImages += "                images[" + i + "]=\"" + strFichierPano + "_u.jpg\"\n";
                strChargeImages += "                images[" + i + "]=\"" + strFichierPano + "_d.jpg\"\n";
                strChargeImages += "                images[" + i + "]=\"" + strFichierPano + "_r.jpg\"\n";
                strChargeImages += "                images[" + i + "]=\"" + strFichierPano + "_l.jpg\"\n";
            } else {
                strChargeImages += "                images[" + i + "]=\"" + strFichierPano + ".jpg\"\n";
            }
            String strIntroPetitePlanete = (isbIntroPetitePlanete()) ? "oui" : "non";
            String strAutorotation = (isbAutoRotationDemarre()) ? "oui" : "non";
            String strAutoTour = (isbAutoTourDemarre()) ? "oui" : "non";
            String strAutoTourBouton = (getGestionnaireInterface().isbAfficheBoutonVisiteAuto()) ? "oui"
                    : "non";
            String strAffInfo = (getPanoramiquesProjet()[i].isAfficheInfo()) ? "oui" : "non";
            String strAffTitre = (getGestionnaireInterface().isbAfficheTitre()) ? "oui" : "non";
            String strTitreAdpte = (getGestionnaireInterface().isbTitreAdapte()) ? "oui" : "non";
            double regX;
            double zN;
            if (getPanoramiquesProjet()[i].getStrTypePanoramique().equals(Panoramique.SPHERE)) {
                regX = Math.round(((getPanoramiquesProjet()[i].getRegardX() - 180) % 360) * 10) / 10;
                zN = Math.round(((getPanoramiquesProjet()[i].getZeroNord() - 180) % 360) * 10) / 10;
            } else {
                regX = Math.round(((getPanoramiquesProjet()[i].getRegardX() + 90) % 360) * 10) / 10;
                zN = Math.round(((getPanoramiquesProjet()[i].getZeroNord() + 90) % 360) * 10) / 10;
            }

            Color coulTitre = Color.valueOf(getGestionnaireInterface().getStrCouleurFondTitre());
            int iRouge = (int) (coulTitre.getRed() * 255.d);
            int iBleu = (int) (coulTitre.getBlue() * 255.d);
            int iVert = (int) (coulTitre.getGreen() * 255.d);
            String strCoulFondTitre = "rgba(" + iRouge + "," + iVert + "," + iBleu + ","
                    + getGestionnaireInterface().getTitreOpacite() + ")";

            strContenuFichier = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--\n"
                    + "     Visite gnre par l'diteur panoVisu \n" + "\n"
                    + "             Cration L.LANG      le monde  360  : http://lemondea360.fr\n" + "\n"
                    + "             fichier image : " + getPanoramiquesProjet()[i].getStrNomFichier() + "\n"
                    + "\n" + "-->\n" + "\n" + "\n" + "<scene>\n" + "   <pano \n" + "      image=\""
                    + strFichierPano + "\"\n";
            if (getGestionnaireInterface().isbAfficheTitre() && getGestionnaireInterface().isbTitreVisite()
                    && getGestionnaireInterface().isbTitrePanoramique()) {
                String strTit = "";
                TextField tfVisite = (TextField) getVbChoixPanoramique().lookup("#titreVisite");
                if (!tfVisite.getText().equals("")) {
                    strTit = tfVisite.getText();
                }

                strContenuFichier += "      afftitre=\"oui\"\n" + "      titre=\"" + strTit + "\"\n"
                        + "      titre2=\"" + getPanoramiquesProjet()[i].getStrTitrePanoramique() + "\"\n";
            } else if (getGestionnaireInterface().isbAfficheTitre()
                    && getGestionnaireInterface().isbTitreVisite()) {
                String strTit = "";
                TextField tfVisite = (TextField) getVbChoixPanoramique().lookup("#titreVisite");
                if (!tfVisite.getText().equals("")) {
                    strTit = tfVisite.getText();
                }

                strContenuFichier += "      afftitre=\"oui\"\n" + "      titre=\"" + strTit + "\"\n";

            } else if (getGestionnaireInterface().isbAfficheTitre()
                    && getGestionnaireInterface().isbTitrePanoramique()) {
                String strTit = "";
                TextField tfVisite = (TextField) getVbChoixPanoramique().lookup("#titreVisite");
                if (!tfVisite.getText().equals("")) {
                    strTit = tfVisite.getText();
                }

                strContenuFichier += "      afftitre=\"oui\"\n" + "      titre2=\""
                        + getPanoramiquesProjet()[i].getStrTitrePanoramique() + "\"\n";

            } else {
                strContenuFichier += "      afftitre=\"non\"\n";
            }
            int taillePolice2 = (int) Math.round(
                    Double.parseDouble(getGestionnaireInterface().getStrTitrePoliceTaille()) * 3.d / 4.d);
            strContenuFichier += "      titrePosition=\"" + getGestionnaireInterface().getStrTitrePosition()
                    + "\"\n" + "      titreDecalage=\""
                    + Math.round(getGestionnaireInterface().getTitreDecalage()) + "px\"\n"
                    + "      titrePolice=\"" + getGestionnaireInterface().getStrTitrePoliceNom() + "\"\n"
                    + "      titreTaillePolice=\""
                    + Math.round(Double.parseDouble(getGestionnaireInterface().getStrTitrePoliceTaille()))
                    + "px\"\n" + "      titreTaillePolice2=\"" + taillePolice2 + "px\"\n"
                    + "      titreCalque=\"" + getGestionnaireInterface().getiCalqueTitre() + "\"\n";

            if (getGestionnaireInterface().isbTitreAdapte()) {
                strContenuFichier += "      titreTaille=\"adapte\"\n";
            } else {
                strContenuFichier += "      titreTaille=\""
                        + Math.round(getGestionnaireInterface().getTitreTaille()) + "%\"\n";
            }
            strContenuFichier += "      titreFond=\"" + strCoulFondTitre + "\"\n" + "      titreCouleur=\""
                    + getGestionnaireInterface().getStrCouleurTitre() + "\"\n" + "      type=\""
                    + getPanoramiquesProjet()[i].getStrTypePanoramique() + "\"\n" + "      multiReso=\"oui\"\n"
                    + "      nombreNiveaux=\"" + getPanoramiquesProjet()[i].getNombreNiveaux() + "\"\n"
                    + "      zeroNord=\"" + zN + "\"\n" + "      regardX=\"" + regX + "\"\n"
                    + "      regardY=\""
                    + Math.round((getPanoramiquesProjet()[i].getRegardY() * 1000) + 0.002) / 1000 + "\"\n"
                    + "      minFOV=\"" + Math.round((getPanoramiquesProjet()[i].getFovMin() * 200)) / 100
                    + "\"\n" + "      maxFOV=\""
                    + Math.round((getPanoramiquesProjet()[i].getFovMax() * 200)) / 100 + "\"\n"
                    + "      champVisuel=\""
                    + Math.round((getPanoramiquesProjet()[i].getChampVisuel() + 0.002) * 1000) / 1000 + "\"\n";

            if (getPanoramiquesProjet()[i].getMinLat() != -1000 && getPanoramiquesProjet()[i].isbMinLat()) {
                strContenuFichier += "      minLat=\""
                        + Math.round((getPanoramiquesProjet()[i].getMinLat() + 0.002) * 1000) / 1000 + "\"\n";
            }
            if (getPanoramiquesProjet()[i].getMaxLat() != 1000 && getPanoramiquesProjet()[i].isbMaxLat()) {
                strContenuFichier += "      maxLat=\""
                        + Math.round((getPanoramiquesProjet()[i].getMaxLat() + 0.002) * 1000) / 1000 + "\"\n";
            }
            strContenuFichier += "      autorotation=\"" + strAutorotation + "\"\n" + "      vitesseAR=\""
                    + getiAutoRotationVitesse() + "\"\n" + "      autotour=\"" + strAutoTour + "\"\n"
                    + "      atBouton=\"" + strAutoTourBouton + "\"\n" + "      atBoutonTaille=\""
                    + getGestionnaireInterface().getTailleBoutonVisiteAuto() + "\"\n"
                    + "      atBoutonPositionX=\""
                    + getGestionnaireInterface().getStrPositionXBoutonVisiteAuto() + "\"\n"
                    + "      atBoutonPositionY=\""
                    + getGestionnaireInterface().getStrPositionYBoutonVisiteAuto() + "\"\n"
                    + "      atBoutonOffsetX=\"" + getGestionnaireInterface().getOffsetXBoutonVisiteAuto()
                    + "\"\n" + "      atBoutonOffsetY=\""
                    + getGestionnaireInterface().getOffsetYBoutonVisiteAuto() + "\"\n" + "      atCalque=\""
                    + getGestionnaireInterface().getiCalqueVisiteAuto() + "\"\n" + "      typeAT=\""
                    + getStrAutoTourType() + "\"\n" + "      limiteAT=\"" + getiAutoTourLimite() + "\"\n"
                    + "      demarrageAT=\"" + getiAutoTourDemarrage() + "\"\n" + "      affinfo=\""
                    + strAffInfo + "\"\n";
            if (getPanoramiquesProjet()[i].getStrNomFichier()
                    .substring(getPanoramiquesProjet()[i].getStrNomFichier().lastIndexOf(File.separator) + 1,
                            getPanoramiquesProjet()[i].getStrNomFichier().length())
                    .split("\\.")[0].equals(strPanoEntree) && isbPetitePlaneteDemarrage()) {
                strContenuFichier += "      petitePlanete=\"" + strIntroPetitePlanete + "\"\n";
            }
            if (getPanoramiquesProjet()[i].getStrNomFichier()
                    .substring(getPanoramiquesProjet()[i].getStrNomFichier().lastIndexOf(File.separator) + 1,
                            getPanoramiquesProjet()[i].getStrNomFichier().length())
                    .split("\\.")[0].equals(strPanoEntree)
                    && getGestionnaireInterface().isbReplieDemarragePlan()) {
                strContenuFichier += "      repliePlan=\"oui\"\n";
            }
            if (getPanoramiquesProjet()[i].getStrNomFichier()
                    .substring(getPanoramiquesProjet()[i].getStrNomFichier().lastIndexOf(File.separator) + 1,
                            getPanoramiquesProjet()[i].getStrNomFichier().length())
                    .split("\\.")[0].equals(strPanoEntree)
                    && getGestionnaireInterface().isbReplieDemarrageCarte()) {
                strContenuFichier += "      replieCarte=\"oui\"\n";
            }
            if (getPanoramiquesProjet()[i].getStrNomFichier()
                    .substring(getPanoramiquesProjet()[i].getStrNomFichier().lastIndexOf(File.separator) + 1,
                            getPanoramiquesProjet()[i].getStrNomFichier().length())
                    .split("\\.")[0].equals(strPanoEntree)
                    && getGestionnaireInterface().isbReplieDemarrageVignettes()) {
                strContenuFichier += "      replieVignettes=\"oui\"\n";
            }

            strContenuFichier += "   />\n";
            if (getGestionnaireInterface().getStrVisibiliteBarreClassique().equals("oui")) {
                strContenuFichier += "   <!--Dfinition de la Barre de navigation-->\n" + "   <boutons \n"
                        + "      styleBoutons=\"navigation\"\n" + "      couleur=\"rgba(255,255,255,0)\"\n"
                        + "      bordure=\"rgba(255,255,255,0)\"\n" + "      deplacements=\""
                        + getGestionnaireInterface().getStrDeplacementsBarreClassique() + "\" \n"
                        + "      zoom=\"" + getGestionnaireInterface().getStrZoomBarreClassique() + "\" \n"
                        + "      outils=\"" + getGestionnaireInterface().getStrOutilsBarreClassique() + "\"\n"
                        + "      fs=\"" + getGestionnaireInterface().getStrPleinEcranBarreClassique() + "\" \n"
                        + "      souris=\"" + getGestionnaireInterface().getStrSourisBarreClassique() + "\" \n"
                        + "      rotation=\"" + getGestionnaireInterface().getStrRotationBarreClassique()
                        + "\" \n" + "      positionX=\""
                        + getGestionnaireInterface().getStrPositionBarreClassique().split(":")[1] + "\"\n"
                        + "      positionY=\""
                        + getGestionnaireInterface().getStrPositionBarreClassique().split(":")[0] + "\" \n"
                        + "      barreCCalque=\"" + getGestionnaireInterface().getiCalqueBarreClassique()
                        + "\"\n" + "      dX=\"" + getGestionnaireInterface().getOffsetXBarreClassique()
                        + "\" \n" + "      dY=\"" + getGestionnaireInterface().getOffsetYBarreClassique()
                        + "\"\n" + "      espacement=\""
                        + Math.round(getGestionnaireInterface().getEspacementBarreClassique()) + "\"\n"
                        + "      visible=\"" + getGestionnaireInterface().getStrVisibiliteBarreClassique()
                        + "\"\n" + "   />\n";
            }
            if (getGestionnaireInterface().getStrVisibiliteBarrePersonnalisee().equals("oui")) {
                strContenuFichier += "<!--  Barre de Navigation Personnalise -->\n\n" + "    <telecommande\n"
                        + "        fs=\"" + getGestionnaireInterface().getStrPleinEcranBarrePersonnalisee()
                        + "\" \n" + "        souris=\""
                        + getGestionnaireInterface().getStrSourisBarrePersonnalisee() + "\" \n"
                        + "        rotation=\"" + getGestionnaireInterface().getStrRotationBarrePersonnalisee()
                        + "\" \n" + "        info=\""
                        + getGestionnaireInterface().getStrInfoBarrePersonnalisee() + "\"\n" + "        aide=\""
                        + getGestionnaireInterface().getStrAideBarrePersonnalisee() + "\"\n"
                        + "        positionX=\""
                        + getGestionnaireInterface().getStrPositionBarrePersonnalisee().split(":")[1] + "\"\n"
                        + "        positionY=\""
                        + getGestionnaireInterface().getStrPositionBarrePersonnalisee().split(":")[0] + "\" \n"
                        + "        taille=\"" + getGestionnaireInterface().getTailleBarrePersonnalisee()
                        + "\"\n" + "        tailleBouton=\""
                        + getGestionnaireInterface().getTailleIconesBarrePersonnalisee() + "\"\n"
                        + "        dX=\"" + getGestionnaireInterface().getOffsetXBarrePersonnalisee() + "\" \n"
                        + "        dY=\"" + getGestionnaireInterface().getOffsetYBarrePersonnalisee() + "\"\n"
                        + "        barrePCalque=\"" + getGestionnaireInterface().getiCalqueBarrePersonnalisee()
                        + "\"\n" + "        lien1=\""
                        + getGestionnaireInterface().getStrLien1BarrePersonnalisee() + "\"\n"
                        + "        lien2=\"" + getGestionnaireInterface().getStrLien2BarrePersonnalisee()
                        + "\"\n" + "        visible=\"oui\">\n";
                for (int ij = 0; ij < getGestionnaireInterface().getiNombreZonesBarrePersonnalisee(); ij++) {
                    strContenuFichier += "        <zoneNavPerso " + "id=\""
                            + getGestionnaireInterface().getZonesBarrePersonnalisee()[ij].getStrIdZone() + "\" "
                            + "alt=\"\" title=\"\" " + "shape=\""
                            + getGestionnaireInterface().getZonesBarrePersonnalisee()[ij].getStrTypeZone()
                            + "\" " + "coords=\"" + getGestionnaireInterface().getZonesBarrePersonnalisee()[ij]
                                    .getStrCoordonneesZone()
                            + "\"" + " />\n";
                }
                strContenuFichier += "    </telecommande>\n" + "";
            }
            if (getGestionnaireInterface().isbAfficheBoussole()) {
                String strAiguille = (getGestionnaireInterface().isbAiguilleMobileBoussole()) ? "oui" : "non";
                strContenuFichier += "<!--  Boussole -->\n" + "    <boussole \n" + "        affiche=\"oui\"\n"
                        + "        image=\"" + getGestionnaireInterface().getStrImageBoussole() + "\"\n"
                        + "        taille=\"" + getGestionnaireInterface().getTailleBoussole() + "\"\n"
                        + "        positionY=\""
                        + getGestionnaireInterface().getStrPositionBoussole().split(":")[0] + "\"\n"
                        + "        positionX=\""
                        + getGestionnaireInterface().getStrPositionBoussole().split(":")[1] + "\"\n"
                        + "        opacite=\"" + getGestionnaireInterface().getOpaciteBoussole() + "\"\n"
                        + "        dX=\"" + getGestionnaireInterface().getOffsetXBoussole() + "\"\n"
                        + "        dY=\"" + getGestionnaireInterface().getOffsetYBoussole() + "\"\n"
                        + "        boussoleCalque=\"" + getGestionnaireInterface().getiCalqueBoussole() + "\"\n"
                        + "        aiguille=\"" + strAiguille + "\"\n" + "    />\n";
            }
            if (getGestionnaireInterface().isbFenetreInfoPersonnalise()) {
                String strImgInfoURL = "images/"
                        + getGestionnaireInterface().getStrFenetreInfoImage().substring(
                                getGestionnaireInterface().getStrFenetreInfoImage().lastIndexOf(File.separator)
                                        + 1,
                                getGestionnaireInterface().getStrFenetreInfoImage().length());
                strContenuFichier += "<!--  Fentre info personnalise -->\n" + "    <fenetreInfo \n"
                        + "        affiche=\"oui\"\n" + "        image=\"" + strImgInfoURL + "\"\n"
                        + "        taille=\"" + getGestionnaireInterface().getFenetreInfoTaille() + "\"\n"
                        + "        opacite=\"" + getGestionnaireInterface().getFenetreInfoOpacite() + "\"\n"
                        + "        dX=\""
                        + Math.round(getGestionnaireInterface().getFenetreInfoPosX() * 10) / 10 + "\"\n"
                        + "        dY=\""
                        + Math.round(getGestionnaireInterface().getFenetreInfoPosY() * 10) / 10 + "\"\n"
                        + "        URL=\"" + getGestionnaireInterface().getStrFenetreURL() + "\"\n"
                        + "        texteURL=\"" + getGestionnaireInterface().getStrFenetreTexteURL() + "\"\n"
                        + "        couleurURL=\"" + getGestionnaireInterface().getStrFenetreURLCouleur()
                        + "\"\n" + "        TailleURL=\""
                        + Math.round(getGestionnaireInterface().getFenetrePoliceTaille() * 10) / 10 + "\"\n"
                        + "        URLdX=\""
                        + Math.round(getGestionnaireInterface().getFenetreURLPosX() * 10) / 10 + "\"\n"
                        + "        URLdY=\""
                        + Math.round(getGestionnaireInterface().getFenetreURLPosY() * 10) / 10 + "\"\n"
                        + "    />\n";
            }
            if (getGestionnaireInterface().isbFenetreAidePersonnalise()) {
                String strImgAideURL = "images/"
                        + getGestionnaireInterface().getStrFenetreAideImage().substring(
                                getGestionnaireInterface().getStrFenetreAideImage().lastIndexOf(File.separator)
                                        + 1,
                                getGestionnaireInterface().getStrFenetreAideImage().length());
                strContenuFichier += "<!--  Fentre Aide personnalise -->\n" + "    <fenetreAide \n"
                        + "        affiche=\"oui\"\n" + "        image=\"" + strImgAideURL + "\"\n"
                        + "        taille=\"" + getGestionnaireInterface().getFenetreAideTaille() + "\"\n"
                        + "        opacite=\"" + getGestionnaireInterface().getFenetreAideOpacite() + "\"\n"
                        + "        dX=\"" + getGestionnaireInterface().getFenetreAidePosX() + "\"\n"
                        + "        dY=\"" + getGestionnaireInterface().getFenetreAidePosY() + "\"\n"
                        + "    />\n";
            }
            if (getGestionnaireInterface().isbAfficheMenuContextuel()) {
                String strPrecSuiv = (getGestionnaireInterface().isbAffichePrecSuivMC()) ? "oui" : "non";
                String strPlanet = (getGestionnaireInterface().isbAffichePlanetNormalMC()) ? "oui" : "non";
                String strPers1 = (getGestionnaireInterface().isbAffichePersMC1()) ? "oui" : "non";
                String strPers2 = (getGestionnaireInterface().isbAffichePersMC2()) ? "oui" : "non";
                strContenuFichier += "<!--  MenuContextuel -->\n" + "    <menuContextuel \n"
                        + "        affiche=\"oui\"\n" + "        precSuiv=\"" + strPrecSuiv + "\"\n"
                        + "        planete=\"" + strPlanet + "\"\n" + "        pers1=\"" + strPers1 + "\"\n"
                        + "        lib1=\"" + getGestionnaireInterface().getStrPersLib1() + "\"\n"
                        + "        url1=\"" + getGestionnaireInterface().getStrPersURL1() + "\"\n"
                        + "        pers2=\"" + strPers2 + "\"\n" + "        lib2=\""
                        + getGestionnaireInterface().getStrPersLib2() + "\"\n" + "        url2=\""
                        + getGestionnaireInterface().getStrPersURL2() + "\"\n" + "    />\n";
            }

            int iPanoSuivant = (ii == ordPano.getStrPanos().size() - 1) ? 0 : ii + 1;
            int iPanoPrecedent = (ii == 0) ? ordPano.getStrPanos().size() - 1 : ii - 1;
            String strNomPano = "panovisu" + iPanoSuivant;
            String strPanoSuivant = "xml/" + strNomPano + ".xml";
            strNomPano = "panovisu" + iPanoPrecedent;
            String strPanoPrecedent = "xml/" + strNomPano + ".xml";
            strContenuFichier += "<!--  Bouton Suivant Precedent -->\n" + "    <suivantPrecedent\n"
                    + "        suivPrecCalque=\"" + getGestionnaireInterface().getiCalqueSuivPrec() + "\"\n"
                    + "        suivant=\"" + strPanoSuivant + "\"            \n" + "        precedent=\""
                    + strPanoPrecedent + "\"            \n";
            if (getGestionnaireInterface().isbSuivantPrecedent()) {
                strContenuFichier += "        afficheSuivantPrecedent=\"oui\"            \n";

            }
            strContenuFichier += "    />    \n" + "";
            String strbAffichemasque = (getGestionnaireInterface().isbAfficheMasque()) ? "oui" : "non";
            String strNavigation = (getGestionnaireInterface().isbMasqueNavigation()) ? "oui" : "non";
            String strBoussole = (getGestionnaireInterface().isbMasqueBoussole()) ? "oui" : "non";
            String strTitre = (getGestionnaireInterface().isbMasqueTitre()) ? "oui" : "non";
            String strPlan = (getGestionnaireInterface().isbMasquePlan()) ? "oui" : "non";
            String strReseaux = (getGestionnaireInterface().isbMasqueReseaux()) ? "oui" : "non";
            String strVignettes = (getGestionnaireInterface().isbMasqueVignettes()) ? "oui" : "non";
            String strCombo = (getGestionnaireInterface().isbMasqueCombo()) ? "oui" : "non";
            String strSuivPrec = (getGestionnaireInterface().isbMasqueSuivPrec()) ? "oui" : "non";
            String strHotspots = (getGestionnaireInterface().isbMasqueHotspots()) ? "oui" : "non";
            strContenuFichier += "<!--  Bouton de Masquage -->\n" + "    <marcheArret \n" + "        affiche=\""
                    + strbAffichemasque + "\"\n" + "        image=\"MA.png\"\n" + "        taille=\""
                    + getGestionnaireInterface().getTailleMasque() + "\"\n" + "        positionY=\""
                    + getGestionnaireInterface().getStrPositionMasque().split(":")[0] + "\"\n"
                    + "        positionX=\"" + getGestionnaireInterface().getStrPositionMasque().split(":")[1]
                    + "\"\n" + "        opacite=\"" + getGestionnaireInterface().getOpaciteMasque() + "\"\n"
                    + "        dX=\"" + getGestionnaireInterface().getdXMasque() + "\"\n" + "        dY=\""
                    + getGestionnaireInterface().getdYMasque() + "\"\n" + "        navigation=\""
                    + strNavigation + "\"\n" + "        boussole=\"" + strBoussole + "\"\n" + "        titre=\""
                    + strTitre + "\"\n" + "        plan=\"" + strPlan + "\"\n" + "        reseaux=\""
                    + strReseaux + "\"\n" + "        masquageCalque=\""
                    + getGestionnaireInterface().getiCalqueMasquage() + "\"\n" + "        vignettes=\""
                    + strVignettes + "\"\n" + "        combo=\"" + strCombo + "\"\n" + "        suivPrec=\""
                    + strSuivPrec + "\"\n" + "        hotspots=\"" + strHotspots + "\"\n" + "    />\n";

            if (getGestionnaireInterface().isbAfficheReseauxSociaux()) {
                String strTwitter = (getGestionnaireInterface().isbReseauxSociauxTwitter()) ? "oui" : "non";
                String strGoogle = (getGestionnaireInterface().isbReseauxSociauxGoogle()) ? "oui" : "non";
                String strFacebook = (getGestionnaireInterface().isbReseauxSociauxFacebook()) ? "oui" : "non";
                String strEmail = (getGestionnaireInterface().isbReseauxSociauxEmail()) ? "oui" : "non";
                strContenuFichier += "<!--  Rseaux Sociaux -->\n" + "    <reseauxSociaux \n"
                        + "        affiche=\"oui\"\n" + "        taille=\""
                        + getGestionnaireInterface().getTailleReseauxSociaux() + "\"\n" + "        positionY=\""
                        + getGestionnaireInterface().getStrPositionReseauxSociaux().split(":")[0] + "\"\n"
                        + "        positionX=\""
                        + getGestionnaireInterface().getStrPositionReseauxSociaux().split(":")[1] + "\"\n"
                        + "        opacite=\"" + getGestionnaireInterface().getOpaciteReseauxSociaux() + "\"\n"
                        + "        dX=\"" + getGestionnaireInterface().getdXReseauxSociaux() + "\"\n"
                        + "        dY=\"" + getGestionnaireInterface().getdYReseauxSociaux() + "\"\n"
                        + "        partageCalque=\"" + getGestionnaireInterface().getiCalquePartage() + "\"\n"
                        + "        twitter=\"" + strTwitter + "\"\n" + "        google=\"" + strGoogle + "\"\n"
                        + "        facebook=\"" + strFacebook + "\"\n" + "        email=\"" + strEmail + "\"\n"
                        + "    />\n";
            }
            if (getGestionnaireInterface().isbAfficheVignettes()) {
                int iRougeVig = (int) (Color.valueOf(getGestionnaireInterface().getStrCouleurFondVignettes())
                        .getRed() * 255.d);
                int iBleuVig = (int) (Color.valueOf(getGestionnaireInterface().getStrCouleurFondVignettes())
                        .getBlue() * 255.d);
                int iVertVig = (int) (Color.valueOf(getGestionnaireInterface().getStrCouleurFondVignettes())
                        .getGreen() * 255.d);
                String strCoulVig = "rgba(" + iRougeVig + "," + iVertVig + "," + iBleuVig + ","
                        + getGestionnaireInterface().getOpaciteVignettes() + ")";
                String strAfficheVignettes = (getGestionnaireInterface().isbAfficheVignettes()) ? "oui" : "non";
                strContenuFichier += "<!-- Barre des vignettes -->" + "    <vignettes \n" + "        affiche=\""
                        + strAfficheVignettes + "\"\n" + "        tailleImage=\""
                        + getGestionnaireInterface().getTailleImageVignettes() + "\"\n"
                        + "        fondCouleur=\"" + strCoulVig + "\"\n" + "        texteCouleur=\""
                        + getGestionnaireInterface().getStrCouleurTexteVignettes() + "\"\n"
                        + "        opacite=\"1.0\"\n" + "        vignettesCalque=\""
                        + getGestionnaireInterface().getiCalqueVignettes() + "\"\n" + "        position=\""
                        + getGestionnaireInterface().getStrPositionVignettes() + "\"\n" + "    >\n";
                for (int jj = 0; jj < ordPano.getStrPanos().size(); jj++) {
                    int j = Integer.parseInt(ordPano.getStrPanos().get(jj));
                    String strNomPan1 = getPanoramiquesProjet()[j].getStrNomFichier();
                    String strFichier = "panovisu" + j + "Vignette.jpg";
                    String strXML = "panovisu" + j + ".xml";
                    ReadWriteImage.writeJpeg(getPanoramiquesProjet()[j].getImgVignettePanoramique(),
                            getStrRepertTemp() + "/panos/" + strFichier, 1.0f, false, 0.0f);
                    strContenuFichier += "        <imageVignette \n" + "            image=\"panos/" + strFichier
                            + "\"\n" + "            xml=\"xml/" + strXML + "\"\n" + "            infoBulle=\""
                            + getPanoramiquesProjet()[j].getStrTitrePanoramique() + "\"\n" + "        />\n";
                }
                strContenuFichier += "    </vignettes>       \n" + "";

            }
            if (getGestionnaireInterface().isbAfficheComboMenu()) {
                String strAfficheComboMenu = (getGestionnaireInterface().isbAfficheComboMenu()) ? "oui" : "non";
                TextField tfTitreVisite = (TextField) getVbChoixPanoramique().lookup("#titreVisite");
                String strTitreVisite1 = tfTitreVisite.getText();
                strContenuFichier += "<!-- Barre des comboMenu -->" + "    <comboMenu \n" + "        affiche=\""
                        + strAfficheComboMenu + "\"\n" + "        positionX=\""
                        + getGestionnaireInterface().getStrPositionXComboMenu() + "\"\n"
                        + "        positionY=\"" + getGestionnaireInterface().getStrPositionYComboMenu()
                        + "\"\n" + "        dX=\"" + getGestionnaireInterface().getOffsetXComboMenu() + "\"\n"
                        + "        comboCalque=\"" + getGestionnaireInterface().getiCalqueMenuPanoramiques()
                        + "\"\n" + "        dY=\"" + getGestionnaireInterface().getOffsetYComboMenu() + "\"\n"
                        + "    >\n";
                for (int jj = 0; jj < ordPano.getStrPanos().size(); jj++) {
                    int j = Integer.parseInt(ordPano.getStrPanos().get(jj));
                    String strNomPan2 = getPanoramiquesProjet()[j].getStrNomFichier();
                    String strFichier = "panovisu" + j + "Vignette.jpg";
                    String strXML = "panovisu" + j + ".xml";
                    ReadWriteImage.writeJpeg(getPanoramiquesProjet()[j].getImgVignettePanoramique(),
                            getStrRepertTemp() + "/panos/" + strFichier, 1.0f, false, 0.0f);

                    strContenuFichier += "        <imageComboMenu \n";
                    if (getGestionnaireInterface().isbAfficheComboMenuImages()) {
                        strContenuFichier += "            image=\"panos/" + strFichier + "\"\n";
                    }
                    if (i == j) {
                        strContenuFichier += "            selectionne=\"selected\"\n";
                    }
                    strContenuFichier += "            xml=\"xml/" + strXML + "\"\n" + "            titre=\""
                            + getPanoramiquesProjet()[j].getStrTitrePanoramique() + "\"\n"
                            + "            sousTitre=\"" + strTitreVisite1 + "\"\n" + "        />\n";
                }
                strContenuFichier += "    </comboMenu>       \n" + "";

            }

            strContenuFichier += "    <!--Dfinition des hotspots-->  \n" + "   <hotspots>\n";
            for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspots(); j++) {
                HotSpot HS = getPanoramiquesProjet()[i].getHotspot(j);
                double longit;
                if (getPanoramiquesProjet()[i].getStrTypePanoramique().equals(Panoramique.SPHERE)) {
                    longit = HS.getLongitude() - 180;
                } else {
                    longit = HS.getLongitude() + 90;
                }
                String strAnime = (HS.isAnime()) ? "true" : "false";
                strContenuFichier += "      <point \n" + "           type=\"panoramique\"\n"
                        + "           long=\"" + longit + "\"\n" + "           lat=\"" + HS.getLatitude()
                        + "\"\n" + "           tailleHS=\""
                        + getGestionnaireInterface().getiTailleHotspotsPanoramique() + "px\"\n";
                if (!strTypeHS.equals("gif")) {
                    strContenuFichier += "           image=\"panovisu/images/hotspots/hotspot.png\"\n";
                } else {
                    String strNomHSGif = strNomfichierHS
                            .substring(strNomfichierHS.lastIndexOf(File.separator) + 1);
                    strContenuFichier += "           image=\"panovisu/images/hotspots/" + strNomHSGif + "\"\n";
                }
                strContenuFichier += "           xml=\"xml/panovisu" + HS.getNumeroPano() + ".xml\"\n";
                if (HS.getRegardX() != 1000) {
                    strContenuFichier += "           regardX=\"" + HS.getRegardX() + "\"\n";
                }
                if (HS.getRegardY() != 1000) {
                    strContenuFichier += "           regardY=\"" + HS.getRegardY() + "\"\n";
                }
                if (HS.getChampVisuel() != 0) {
                    strContenuFichier += "           champVisuel=\"" + HS.getChampVisuel() + "\"\n";
                }
                strContenuFichier += "           info=\""
                        + HS.getStrInfo().replace("<", "&lt;").replace(">", "&gt;").replace("\"", "&quot;")
                        + "\"\n" + "           anime=\"" + strAnime + "\"\n" + "      />\n";
            }
            for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspotHTML(); j++) {
                HotspotHTML HS = getPanoramiquesProjet()[i].getHotspotHTML(j);
                String strUrlHTML;
                if (!HS.isbLienExterieur()) {
                    HS.creeHTML(strHTMLPanoRepert + "/page" + j);
                    strUrlHTML = "pagesHTML/" + i + "/page" + j + "/index.html";
                } else {
                    strUrlHTML = HS.getStrURLExterieure();
                }
                Color coulTitreHTML = Color.valueOf(HS.getStrCouleurHTML());
                iRouge = (int) (coulTitreHTML.getRed() * 255.d);
                iBleu = (int) (coulTitreHTML.getBlue() * 255.d);
                iVert = (int) (coulTitreHTML.getGreen() * 255.d);
                String strCoulHTML = "rgba(" + iRouge + "," + iVert + "," + iBleu + ","
                        + Math.round(HS.getOpaciteHTML() * 100.d) / 100.d + ")";
                double longit;
                if (getPanoramiquesProjet()[i].getStrTypePanoramique().equals(Panoramique.SPHERE)) {
                    longit = HS.getLongitude() - 180;
                } else {
                    longit = HS.getLongitude() + 90;
                }
                String strAnime = (HS.isAnime()) ? "true" : "false";

                strContenuFichier += "      <point \n" + "           type=\"html\"\n" + "           long=\""
                        + longit + "\"\n" + "           lat=\"" + HS.getLatitude() + "\"\n"
                        + "           tailleHS=\"" + getGestionnaireInterface().getiTailleHotspotsHTML()
                        + "px\"\n";
                if (!strTypeHSHTML.equals("gif")) {
                    strContenuFichier += "           image=\"panovisu/images/hotspots/hotspotHTML.png\"\n";
                } else {
                    String strNomHSGif = strNomfichierHSHTML
                            .substring(strNomfichierHSHTML.lastIndexOf(File.separator) + 1);
                    strContenuFichier += "           image=\"panovisu/images/hotspots/" + strNomHSGif + "\"\n";
                }
                strContenuFichier += "           url=\"" + strUrlHTML + "\"\n" + "           info=\""
                        + HS.getStrInfo().replace("<", "&lt;").replace(">", "&gt;").replace("\"", "&quot;")
                        + "\"\n" + "           taille=\"" + Math.round(HS.getLargeurHTML()) + "px\"\n"
                        + "           position=\"" + HS.getStrPositionHTML() + "\"\n" + "           couleur=\""
                        + strCoulHTML + "\"\n" + "           anime=\"" + strAnime + "\"\n" + "      />\n";
            }

            for (int j = 0; j < getPanoramiquesProjet()[i].getiNombreHotspotDiapo(); j++) {
                HotspotDiaporama HS = getPanoramiquesProjet()[i].getHotspotDiapo(j);
                String strUrlHTML;

                strUrlHTML = "diaporama/diapo" + HS.getiNumDiapo() + ".html";

                Color coulTitreHTML = Color.valueOf(diaporamas[HS.getiNumDiapo()].getStrCouleurFondDiaporama());
                iRouge = (int) (coulTitreHTML.getRed() * 255.d);
                iBleu = (int) (coulTitreHTML.getBlue() * 255.d);
                iVert = (int) (coulTitreHTML.getGreen() * 255.d);
                String strCoulHTML = "rgba(" + iRouge + "," + iVert + "," + iBleu + ","
                        + Math.round(diaporamas[HS.getiNumDiapo()].getOpaciteDiaporama() * 100.d) / 100.d + ")";
                double longit;
                if (getPanoramiquesProjet()[i].getStrTypePanoramique().equals(Panoramique.SPHERE)) {
                    longit = HS.getLongitude() - 180;
                } else {
                    longit = HS.getLongitude() + 90;
                }
                String strAnime = (HS.isbAnime()) ? "true" : "false";

                strContenuFichier += "      <point \n" + "           type=\"html\"\n" + "           long=\""
                        + longit + "\"\n" + "           lat=\"" + HS.getLatitude() + "\"\n"
                        + "           tailleHS=\"" + getGestionnaireInterface().getiTailleHotspotsImage()
                        + "px\"\n";
                if (!strTypeHSImage.equals("gif")) {
                    strContenuFichier += "           image=\"panovisu/images/hotspots/hotspotImage.png\"\n";
                } else {
                    String strNomHSGif = strNomfichierHSImage
                            .substring(strNomfichierHSImage.lastIndexOf(File.separator) + 1);
                    strContenuFichier += "           image=\"panovisu/images/hotspots/" + strNomHSGif + "\"\n";
                }
                strContenuFichier += "           url=\"" + strUrlHTML + "\"\n" + "           taille=\"90%\"\n"
                        + "           info=\""
                        + HS.getStrInfo().replace("<", "&lt;").replace(">", "&gt;").replace("\"", "&quot;")
                        + "\"\n" + "           couleur=\"" + strCoulHTML + "\"\n" + "           anime=\""
                        + strAnime + "\"\n" + "      />\n";
            }

            for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspotImage(); j++) {
                HotspotImage HS = getPanoramiquesProjet()[i].getHotspotImage(j);
                String strCouleurFondImage = HS.getStrCouleurFond();
                if (strCouleurFondImage.equals("")) {
                    strCouleurFondImage = "#"
                            + getGestionnaireInterface().getCouleurFondTheme().toString().substring(2, 8);
                }
                double opaciteImage = HS.getOpacite();
                if (opaciteImage == -1) {
                    opaciteImage = getGestionnaireInterface().getOpaciteTheme();
                }
                Color coulImage = Color.valueOf(strCouleurFondImage);
                iRouge = (int) (coulImage.getRed() * 255.d);
                iBleu = (int) (coulImage.getBlue() * 255.d);
                iVert = (int) (coulImage.getGreen() * 255.d);
                String strCoulImage = "rgba(" + iRouge + "," + iVert + "," + iBleu + ","
                        + Math.round(opaciteImage * 100.d) / 100.d + ")";

                double longit;
                if (getPanoramiquesProjet()[i].getStrTypePanoramique().equals(Panoramique.SPHERE)) {
                    longit = HS.getLongitude() - 180;
                } else {
                    longit = HS.getLongitude() + 90;
                }
                String strAnime = (HS.isAnime()) ? "true" : "false";
                strContenuFichier += "      <point \n" + "           type=\"image\"\n" + "           long=\""
                        + longit + "\"\n" + "           lat=\"" + HS.getLatitude() + "\"\n"
                        + "           tailleHS=\"" + getGestionnaireInterface().getiTailleHotspotsImage()
                        + "px\"\n";
                if (!strTypeHSImage.equals("gif")) {
                    strContenuFichier += "           image=\"panovisu/images/hotspots/hotspotImage.png\"\n";
                } else {
                    String strNomHSGif = strNomfichierHSImage
                            .substring(strNomfichierHSImage.lastIndexOf(File.separator) + 1);
                    strContenuFichier += "           image=\"panovisu/images/hotspots/" + strNomHSGif + "\"\n";
                }
                strContenuFichier += "           img=\"images/" + HS.getStrLienImg() + "\"\n"
                        + "           info=\""
                        + HS.getStrInfo().replace("<", "&lt;").replace(">", "&gt;").replace("\"", "&quot;")
                        + "\"\n" + "           couleur=\"" + strCoulImage + "\"\n" + "           anime=\""
                        + strAnime + "\"\n" + "      />\n";
            }
            strContenuFichier += "   </hotspots>\n";
            strContenuFichier += "\n" + "<!-- Dfinition des images de fond -->\n" + "\n";
            if (getGestionnaireInterface().getiNombreImagesFond() > 0) {
                for (int k = 0; k < getGestionnaireInterface().getiNombreImagesFond(); k++) {
                    ImageFond imgFond = getGestionnaireInterface().getImagesFond()[k];
                    String strImgFond = "images/" + imgFond.getStrFichierImage().substring(
                            imgFond.getStrFichierImage().lastIndexOf(File.separator) + 1,
                            imgFond.getStrFichierImage().length());
                    String strMasquable = (imgFond.isMasquable()) ? "oui" : "non";

                    strContenuFichier += "    <imageFond\n"
                            + "        fichier=\"" + strImgFond + "\"\n" + "        posX=\"" + imgFond
                                    .getStrPosX()
                            + "\" \n" + "        posY=\"" + imgFond.getStrPosY() + "\" \n"
                            + "        offsetX=\"" + imgFond.getOffsetX() + "\" \n" + "        offsetY=\""
                            + imgFond.getOffsetY() + "\" \n" + "        tailleX=\"" + imgFond.getTailleX()
                            + "\" \n" + "        tailleY=\"" + imgFond.getTailleY() + "\" \n"
                            + "        opacite=\"" + imgFond.getOpacite() + "\" \n" + "        cible=\""
                            + imgFond.getStrCible() + "\" \n" + "        calque=\"" + imgFond.getiCalqueImage()
                            + "\"\n" + "        masquable=\"" + strMasquable + "\" \n" + "        url=\""
                            + imgFond.getStrUrl() + "\" \n" + "        infobulle=\"" + imgFond.getStrInfobulle()
                                    .replace("<", "&lt;").replace(">", "&gt;").replace("\"", "&quot;")
                            + "\" \n" + "    />\n" + "";
                }
            }
            if (getGestionnaireInterface().isbAffichePlan() && getPanoramiquesProjet()[i].isAffichePlan()) {
                int iNumPlan = getPanoramiquesProjet()[i].getNumeroPlan();
                Plan planPano = getPlans()[iNumPlan];
                iRouge = (int) (getGestionnaireInterface().getCouleurFondPlan().getRed() * 255.d);
                iBleu = (int) (getGestionnaireInterface().getCouleurFondPlan().getBlue() * 255.d);
                iVert = (int) (getGestionnaireInterface().getCouleurFondPlan().getGreen() * 255.d);
                String strAfficheRadar = (getGestionnaireInterface().isbAfficheRadar()) ? "oui" : "non";
                String strCoulFond = "rgba(" + iRouge + "," + iVert + "," + iBleu + ","
                        + getGestionnaireInterface().getOpacitePlan() + ")";
                strContenuFichier += "    <plan\n" + "        affiche=\"oui\" \n" + "        image=\"images/"
                        + planPano.getStrImagePlan() + "\"\n" + "        largeur=\""
                        + getGestionnaireInterface().getLargeurPlan() + "\"\n" + "        position=\""
                        + getGestionnaireInterface().getStrPositionPlan() + "\"\n" + "        couleurFond=\""
                        + strCoulFond + "\"\n" + "        couleurTexte=\"#"
                        + getGestionnaireInterface().getStrCouleurTextePlan() + "\"\n" + "        nord=\""
                        + planPano.getDirectionNord() + "\"\n" + "        planCalque=\""
                        + getGestionnaireInterface().getiCalquePlan() + "\"\n" + "        boussolePosition=\""
                        + planPano.getStrPosition() + "\"\n" + "        boussoleX=\"" + planPano.getPositionX()
                        + "\"\n" + "        boussoleY=\"" + planPano.getPositionX() + "\"\n"
                        + "        radarAffiche=\"" + strAfficheRadar + "\"\n" + "        radarTaille=\""
                        + Math.round(getGestionnaireInterface().getTailleRadar()) + "\"\n"
                        + "        radarCouleurFond=\"#" + getGestionnaireInterface().getStrCouleurFondRadar()
                        + "\"\n" + "        radarCouleurLigne=\"#"
                        + getGestionnaireInterface().getStrCouleurLigneRadar() + "\"\n"
                        + "        radarOpacite=\""
                        + Math.round(getGestionnaireInterface().getOpaciteRadar() * 100.d) / 100.d + "\"\n"
                        + "    >\n";
                for (int iPoint = 0; iPoint < planPano.getNombreHotspots(); iPoint++) {
                    double posX = planPano.getHotspot(iPoint).getLongitude()
                            * getGestionnaireInterface().getLargeurPlan();
                    double posY = planPano.getHotspot(iPoint).getLatitude() * planPano.getHauteurPlan()
                            * getGestionnaireInterface().getLargeurPlan() / planPano.getLargeurPlan();
                    if (planPano.getHotspot(iPoint).getNumeroPano() == i) {
                        strContenuFichier += "        <pointPlan\n" + "            positX=\"" + posX + "\"\n"
                                + "            positY=\"" + posY + "\"\n" + "            xml=\"actif\"\n"
                                + "            />  \n";

                    } else {
                        strContenuFichier += "        <pointPlan\n" + "            positX=\"" + posX + "\"\n"
                                + "            positY=\"" + posY + "\"\n" + "            xml=\"xml/panovisu"
                                + planPano.getHotspot(iPoint).getNumeroPano() + ".xml\"\n"
                                + "            texte=\"" + planPano.getHotspot(iPoint).getStrInfo() + "\"\n"
                                + "            />  \n";
                    }
                }
                strContenuFichier += "    </plan>\n";
            }

            if (getGestionnaireInterface().isbAfficheCarte()) {
                iRouge = (int) (getGestionnaireInterface().getCouleurFondCarte().getRed() * 255.d);
                iBleu = (int) (getGestionnaireInterface().getCouleurFondCarte().getBlue() * 255.d);
                iVert = (int) (getGestionnaireInterface().getCouleurFondCarte().getGreen() * 255.d);
                String strAfficheRadarCarte = (getGestionnaireInterface().isbAfficheRadarCarte()) ? "oui"
                        : "non";
                String strCoulFond = "rgba(" + iRouge + "," + iVert + "," + iBleu + ","
                        + getGestionnaireInterface().getOpaciteCarte() + ")";
                CoordonneesGeographiques coords;
                if (getGestionnaireInterface().getCoordCentreCarte() != null) {
                    coords = getGestionnaireInterface().getCoordCentreCarte();
                } else {
                    coords = getGestionnaireInterface().navigateurCarteOL.recupereCoordonnees();
                }
                strContenuFichier += "    <carte\n" + "        affiche=\"oui\" \n" + "        largeur=\""
                        + getGestionnaireInterface().getLargeurCarte() + "\"\n" + "        hauteur=\""
                        + getGestionnaireInterface().getHauteurCarte() + "\"\n" + "        zoom=\""
                        + (getGestionnaireInterface().getiFacteurZoomCarte() + 1) + "\"\n"
                        + "        coordCentreLong=\"" + coords.getLongitude() + "\"\n"
                        + "        coordCentreLat=\"" + coords.getLatitude() + "\"\n" + "        nomLayer=\""
                        + getGestionnaireInterface().getStrNomLayers() + "\"\n" + "        position=\""
                        + getGestionnaireInterface().getStrPositionCarte() + "\"\n" + "        carteCalque=\""
                        + getGestionnaireInterface().getiCalqueCarte() + "\"\n" + "        bingAPIKey=\""
                        + getStrBingAPIKey() + "\"\n" + "        couleurFond=\"" + strCoulFond + "\"\n"
                        + "        couleurTexte=\"#" + getGestionnaireInterface().getStrCouleurTexteCarte()
                        + "\"\n" + "        radarCarteAffiche=\"" + strAfficheRadarCarte + "\"\n"
                        + "        radarCarteTaille=\""
                        + Math.round(getGestionnaireInterface().getTailleRadarCarte()) + "\"\n"
                        + "        radarCarteCouleurFond=\"#"
                        + getGestionnaireInterface().getStrCouleurFondRadarCarte() + "\"\n"
                        + "        radarCarteCouleurLigne=\"#"
                        + getGestionnaireInterface().getStrCouleurLigneRadarCarte() + "\"\n"
                        + "        radarCarteOpacite=\""
                        + Math.round(getGestionnaireInterface().getOpaciteRadarCarte() * 100.d) / 100.d + "\"\n"
                        + "    >\n";
                for (int iPoint2 = 0; iPoint2 < getiNombrePanoramiques(); iPoint2++) {
                    if (getPanoramiquesProjet()[iPoint2].getMarqueurGeolocatisation() != null) {
                        double posX = getPanoramiquesProjet()[iPoint2].getMarqueurGeolocatisation()
                                .getLongitude();
                        double posY = getPanoramiquesProjet()[iPoint2].getMarqueurGeolocatisation()
                                .getLatitude();
                        String strFichierPano2 = getPanoramiquesProjet()[iPoint2].getStrNomFichier()
                                .substring(
                                        getPanoramiquesProjet()[iPoint2].getStrNomFichier()
                                                .lastIndexOf(File.separator) + 1,
                                        getPanoramiquesProjet()[iPoint2].getStrNomFichier().length())
                                .split("\\.")[0];
                        String strHTML = "<span style='font-family : Verdana,Arial,sans-serif;font-weight:bold;font-size : 12px;'>"
                                + getPanoramiquesProjet()[iPoint2].getStrTitrePanoramique() + "</span>";
                        strHTML = strHTML.replace("<", "&lt;").replace(">", "&gt;");
                        String strFichierXML = "panovisu" + iPoint2;
                        if (iPoint2 == i) {
                            strContenuFichier += "        <pointCarte\n" + "            positX=\"" + posX
                                    + "\"\n" + "            positY=\"" + posY + "\"\n"
                                    + "            xml=\"actif\"\n" + "            image=\"panos/"
                                    + strFichierXML + "Vignette.jpg\"\n" + "            html=\"" + strHTML
                                    + "\"\n" + "            />  \n";

                        } else {
                            strContenuFichier += "        <pointCarte\n" + "            positX=\"" + posX
                                    + "\"\n" + "            positY=\"" + posY + "\"\n"
                                    + "            xml=\"xml/" + strFichierXML + ".xml\"\n"
                                    + "            image=\"panos/" + strFichierXML + "Vignette.jpg\"\n"
                                    + "            html=\"" + strHTML + "\"\n" + "            />  \n";
                        }

                    }
                }
                strContenuFichier += "    </carte>\n";
            }

            strContenuFichier += "</scene>\n";
            String strFichPano = getPanoramiquesProjet()[i].getStrNomFichier();
            String strNomXMLFile = "panovisu" + i + ".xml";
            fileXML = new File(fileXMLRepert + File.separator + strNomXMLFile);
            fileXML.setWritable(true);
            OutputStreamWriter oswFichierXML = new OutputStreamWriter(new FileOutputStream(fileXML), "UTF-8");
            try (BufferedWriter bwFichierXML = new BufferedWriter(oswFichierXML)) {
                bwFichierXML.write(strContenuFichier);
            }
        }
        Rectangle2D tailleEcran = Screen.getPrimary().getBounds();
        int iHauteur = (int) tailleEcran.getHeight() - 200;
        String strTitreVis = "Panovisu - visualiseur 100% html5 (three.js)";
        TextField tfVisite = (TextField) getVbChoixPanoramique().lookup("#titreVisite");
        if (!tfVisite.getText().equals("")) {
            strTitreVis = tfVisite.getText();
        }
        String strNomPano1 = getPanoramiquesProjet()[0].getStrNomFichier();
        String strFPano1 = "panos/" + strNomPano1.substring(strNomPano1.lastIndexOf(File.separator) + 1,
                strNomPano1.lastIndexOf(".")) + "Vignette.jpg";

        String strFichierHTML = "<!DOCTYPE html>\n" + "<html lang=\"fr\">\n" + "    <head>\n"
                + "        <title>" + strTitreVis + "</title>\n" + "        <meta charset=\"utf-8\">\n"
                + "        <meta name=\"viewport\" content=\"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0\">\n"
                + "        <link rel=\"stylesheet\" media=\"screen\" href=\"panovisu/libs/jquerymenu/jquery.contextMenu.css\" type=\"text/css\"/>\n"
                + "        <link rel=\"stylesheet\" type=\"text/css\" href=\"panovisu/css/msdropdown/dd.css\" />\n"
                + "        <meta name=\"url\" property=\"og:url\" content=\"\" />\n"
                + "        <meta property=\"og:title\"  name=\"twitter:title\" content=\"" + strTitreVis
                + "\" />\n"
                + "        <meta itemprop=\"description\" property=\"og:description\" name=\"twitter:description\" content=\"Une page cre avec panoVisu Editeur : 100% Libre 100% HTML5\" />\n"
                + "        <meta name=\"img\" property=\"og:image\" itemprop=\"image primaryImageOfPage\" content=\"./"
                + strFPano1 + "\" />\n"
                + "        <script type=\"text/javascript\" src=\"panovisu/libs/openlayers/OpenLayers.js\"></script>\n"
                + "        <script type=\"text/javascript\" src=\"panovisu/libs/openlayers/OpenStreetMap.js\"></script>\n"
                + "        <script src=\"http://maps.google.com/maps/api/js?v=3.5&sensor=false\" style=\"\"></script>\n"
                + "        <script src=\"http://maps.gstatic.com/maps-api-v3/api/js/20/13/intl/fr_ALL/main.js\"></script>\n"
                + "        <style>\n" + "            .olControlLayerSwitcher\n" + "            {\n"
                + "                font-family: Verdana,Arial,sans-serif!important;\n"
                + "                margin-top: 3px;\n" + "                margin-left: 3px;\n"
                + "                margin-bottom: 3px;\n" + "                font-size: 10pt!important;\n"
                + "                color: white;\n" + "                background-color: transparent;\n"
                + "                z-index: 10000;\n" + "                background-color: #999!important;\n"
                + "                color : #ff0!important;\n" + "                max-width: 180px!important;\n"
                + "                opacity: 0.95!important;\n" + "            }\n"
                + "            .olControlLayerSwitcher .layersDiv\n" + "            {\n"
                + "                padding-top: 5px;\n" + "                padding-left: 10px;\n"
                + "                padding-bottom: 5px;\n" + "                padding-right: 10px;\n"
                + "                background-color: #aaa!important;\n"
                + "                color : #fff!important;\n"
                + "                font-family: Verdana,Arial,sans-serif!important;\n"
                + "                font-size: 10pt!important;\n"
                + "                font-weight: normal!important;\n"
                + "                max-width: 180px!important;\n"
                + "                overflow: hidden!important;\n" + "                opacity: 0.95!important;\n"
                + "            }        \n" + "\n" + "            #infoBulle {\n"
                + "                background: " + getGestionnaireInterface().strCouleurFondInfoBulle + ";\n"
                + "                border-top: " + getGestionnaireInterface().iTailleBordureTop + "px solid "
                + getGestionnaireInterface().strCouleurBordureInfoBulle + ";\n"
                + "                border-bottom: " + getGestionnaireInterface().iTailleBordureBottom
                + "px solid " + getGestionnaireInterface().strCouleurBordureInfoBulle + ";\n"
                + "                border-left: " + getGestionnaireInterface().iTailleBordureLeft + "px solid "
                + getGestionnaireInterface().strCouleurBordureInfoBulle + ";\n"
                + "                border-right: " + getGestionnaireInterface().iTailleBordureRight
                + "px solid " + getGestionnaireInterface().strCouleurBordureInfoBulle + ";\n"
                + "                padding: 3px 10px;\n" + "                opacity: "
                + Math.round(getGestionnaireInterface().opaciteInfoBulle * 10) / 10.0 + ";\n"
                + "                color : " + getGestionnaireInterface().strCouleurTexteInfoBulle + ";\n"
                + "                font-family: " + getGestionnaireInterface().strPoliceInfoBulle
                + ",Arial,sans-serif!important;  \n" + "                border-radius: "
                + getGestionnaireInterface().iArrondiTL + "px  " + getGestionnaireInterface().iArrondiTR + "px "
                + getGestionnaireInterface().iArrondiBR + "px " + getGestionnaireInterface().iArrondiBL
                + "px;  \n";
        if (getGestionnaireInterface().bOmbreInfoBulle) {
            strFichierHTML += "                box-shadow: 5px 5px 10px #444;\n";
        }
        strFichierHTML += "                font-size : " + getGestionnaireInterface().taillePoliceInfoBulle
                + "px;           \n" + "                z-index : 10000000;\n" + "            } \n" + "\n"
                + "        </style>\n" + "" + "    </head>\n"
                + "    <body style='background-color:#777; margin-top: 8px; margin-bottom: 2px;overflow: hidden;'>\n"
                + "        <header>\n" + "\n" + "        </header>\n" + "        <article style=\"height : "
                + iHauteur + "px;\">\n" + "            <div style='background-color : #777' id=\"pano\">\n"
                + "            </div>\n" + "        </article>\n"
                + "        <script src=\"panovisu/panovisuInit.js\"></script>\n"
                + "        <script src=\"panovisu/panovisu.js\"></script>\n" + "        <script>\n" + "\n"
                + "            $(function() {\n"
                + "                $('meta[name=img]').attr('content', document.location.href+\"" + strFPano1
                + "\");\n" + "                $('meta[name=url]').attr('content', document.location.href);\n"
                + "                $(window).resize(function(){\n"
                + "                    $(\"article\").height($(window).height()-17);\n"
                + "                    $(\"#pano\").height($(window).height()-17);\n" + "                })\n"
                + "                $(\"article\").height($(window).height()-17);\n"
                + "                $(\"#pano\").height($(window).height()-17);\n"
                + "                ajoutePano({\n" + "                    langue : \"" + getLocale().toString()
                + "\",\n" + "                    panoramique: \"pano\",\n" + "                    minFOV: "
                + (navigateurPanoramique.getMinFov() * 2) + ",\n" + "                    maxFOV: "
                + (navigateurPanoramique.getMaxFov() * 2) + ",\n" + "                    fenX: \"100%\",\n"
                + "                    fenY: \"100%\",\n" + "                    xml: \"xml/PANO.xml\"\n"
                + "                });\n"
                + "                $(\".reseauSocial-twitter\").on(\"click\", function() {\n"
                + "                    window.open(\n"
                + "                            \"https://twitter.com/share?url=\" + document.location.href\n"
                + "                            );\n" + "                    return false;\n"
                + "                });\n"
                + "                $(\".reseauSocial-fb\").on(\"click\", function() {\n"
                + "                    url=\"http://www.facebook.com/sharer.php?s=100&p[url]=\" + encodeURIComponent(document.location.href)\n"
                + "                            + \"&p[images][0]=\" + encodeURIComponent(document.location.href + \""
                + strFPano1 + "\")\n" + "                            + \"&p[title]=\" + encodeURIComponent(\""
                + strTitreVis + "\")\n"
                + "                            + \"&p[summary]=\" + encodeURIComponent(\"Une page cre avec panoVisu Editeur : 100% Libre 100% HTML5\");\n"
                + "                    window.open(url);\n" + "                    return false;\n"
                + "                });\n"
                + "                $(\".reseauSocial-google\").on(\"click\", function() {\n"
                + "                    window.open(\n"
                + "                            \"https://plus.google.com/share?url=\" + document.location.href + \"&amp;hl=fr\"\n"
                + "                            );\n" + "                    return false;\n"
                + "                });\n"
                + "                $(\".reseauSocial-email\").attr(\"href\",\"mailto:?body=\" + document.location.href + \"&amp;hl=fr\");\n"
                + "            });\n" + "        </script>\n" + "    </body>\n" + "</html>\n";
        int i = Integer.parseInt(ordPano.getStrPanos().get(0));
        strFichierHTML = strFichierHTML.replace("PANO", "panovisu" + i);
        File fileIndexHTML = new File(getStrRepertTemp() + File.separator + "index.html");
        fileIndexHTML.setWritable(true);
        OutputStreamWriter oswFichierHTML = new OutputStreamWriter(new FileOutputStream(fileIndexHTML),
                "UTF-8");
        try (BufferedWriter bwFichierHTML = new BufferedWriter(oswFichierHTML)) {
            bwFichierHTML.write(strFichierHTML);
        }
        DirectoryChooser dcRepertChoix = new DirectoryChooser();
        dcRepertChoix.setTitle("Choix du repertoire de sauvegarde de la visite");
        File fileRepert = new File(EditeurPanovisu.getStrRepertoireProjet());
        dcRepertChoix.setInitialDirectory(fileRepert);
        File fileRepertVisite = dcRepertChoix.showDialog(null);
        if (fileRepertVisite != null) {
            String strNomRepertVisite = fileRepertVisite.getAbsolutePath();
            copieRepertoire(getStrRepertTemp(), strNomRepertVisite);
            Alert alert = new Alert(AlertType.INFORMATION);
            alert.setHeaderText(null);
            alert.setTitle(rbLocalisation.getString("main.dialog.generationVisite"));
            alert.setContentText(
                    rbLocalisation.getString("main.dialog.generationVisiteMessage") + strNomRepertVisite);
            alert.showAndWait();
            Application app = new Application() {
                @Override
                public void start(Stage stage) {
                }
            };
            app.getHostServices().showDocument(strNomRepertVisite + File.separator + "index.html");
        }
    } else {
        Alert alert = new Alert(AlertType.ERROR);
        alert.setTitle(rbLocalisation.getString("main.dialog.generationVisite"));
        alert.setHeaderText(null);
        alert.setContentText(rbLocalisation.getString("main.dialog.generationVisiteMessageErreur"));
        alert.showAndWait();

    }
}

From source file:org.openbase.display.HTMLLoader.java

public String loadTextView(final String text, final Color color) throws CouldNotPerformException {
    try {/* w  w w . j  a v a  2s  . com*/
        variableStore.store("TEXT", text);
        variableStore.store("COLOR", "rgb(" + (int) (color.getRed() * 255) + ","
                + (int) (color.getGreen() * 255) + "," + (int) (color.getBlue() * 255) + ")");
        return buildContext(Template.TEXT_VIEW);
    } catch (CouldNotPerformException ex) {
        throw new CouldNotPerformException("Could not load TextView!", ex);
    }
}

From source file:org.specvis.logic.Functions.java

/**
 * Convert javafx.scene.paint.Color to its HEX value.
 * @param color//from  www.jav  a 2 s  .  c  o  m
 * @return Color in HEX value in "#RRGGBB" format.
 */
public String toHexCode(Color color) {
    return String.format("#%02X%02X%02X", (int) (color.getRed() * 255), (int) (color.getGreen() * 255),
            (int) (color.getBlue() * 255));
}