Example usage for javafx.scene.image Image Image

List of usage examples for javafx.scene.image Image Image

Introduction

In this page you can find the example usage for javafx.scene.image Image Image.

Prototype

public Image(@NamedArg(value = "url", defaultValue = "\"\"") String url,
        @NamedArg("requestedWidth") double requestedWidth, @NamedArg("requestedHeight") double requestedHeight,
        @NamedArg("preserveRatio") boolean preserveRatio,
        @NamedArg(value = "smooth", defaultValue = "true") boolean smooth,
        @NamedArg("backgroundLoading") boolean backgroundLoading) 

Source Link

Document

Construct a new Image with the specified parameters.

Usage

From source file:org.sleuthkit.autopsy.imageanalyzer.ThumbnailCache.java

/**
 * load a thumbnail from the disk based cache for the given file, or
 * generate and save a new thumnbail if one doesn't already exist
 *
 * @param file the file to load a thumbnail of
 *
 * @return an optional containing a thumbnail, or null if a thumbnail
 *         couldn't be loaded or generated
 *///from  w  w  w . j a va  2s .  c om
private Optional<Image> load(DrawableFile<?> file) {
    Image thumbnail = null;
    File cacheFile;
    try {// try to load the thumbnail from disk
        cacheFile = getCacheFile(file.getId());

        if (cacheFile.exists()) {
            // If a thumbnail file is already saved locally, load it
            try {
                int dim = iconSize.get();
                thumbnail = new Image(Utilities.toURI(cacheFile).toURL().toString(), dim, dim, true, false,
                        true);
            } catch (MalformedURLException ex) {
                Exceptions.printStackTrace(ex);
            }
        }
    } catch (IllegalStateException e) {
        LOGGER.log(Level.WARNING, "can't load icon when no case is open");
        return Optional.empty();
    }

    if (thumbnail == null) { //if we failed to load the icon, try to generate it
        thumbnail = generateAndSaveThumbnail(file);
    }

    return Optional.ofNullable(thumbnail); //return icon, or null if generation failed
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param fichierPano//from   w  w w.j  av a 2s.co  m
 */
@SuppressWarnings("empty-statement")
private void ajoutePanoramiqueProjet(String fichierPano, String typePano) throws InterruptedException {
    String nomPano = fichierPano.substring(fichierPano.lastIndexOf(File.separator) + 1, fichierPano.length());
    panoCharge = true;
    listeChoixPanoramique.getItems().add(nomPano);
    listeChoixPanoramiqueEntree.getItems().add(nomPano);
    paneChoixPanoramique.setVisible(true);
    estCharge = true;
    Panoramique panoCree = new Panoramique();
    System.out.println("Type pano : " + typePano);
    if (typePano.equals(Panoramique.SPHERE)) {
        System.out.println("sphere");
        panoCree.setNomFichier(fichierPano);
        String extension = fichierPano.substring(fichierPano.length() - 3, fichierPano.length());
        String nom = fichierPano.substring(0, fichierPano.length() - 4);
        int nombreNiveaux = creeNiveauxImageEqui(fichierPano, repertPanos);
        panoCree.setNomFichier(fichierPano);
        Image image3 = null;
        if ("tif".equals(extension)) {
            try {
                image2 = ReadWriteImage.readTiff(fichierPano);
                image2 = ReadWriteImage.resizeImage(image2, 1200, 600);
                image3 = ReadWriteImage.readTiff(fichierPano);
                image3 = ReadWriteImage.resizeImage(image3, 300, 150);
            } catch (ImageReadException ex) {
                Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IOException ex) {
                Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
            }
        } else {
            image2 = new Image("file:" + fichierPano, 1200, 600, true, true, true);
            image3 = new Image("file:" + fichierPano, 300, 150, true, true, true);
        }
        panoCree.setNombreNiveaux(nombreNiveaux);
        panoCree.setVignettePanoramique(image3);
        panoCree.setImagePanoramique(image2);
        panoCree.setTypePanoramique(Panoramique.SPHERE);
    }
    if (typePano.equals(Panoramique.CUBE)) {
        System.out.println("sphere");
        panoCree.setNomFichier(fichierPano);
        panoCree.setNomFichier(fichierPano);
        String nom = fichierPano.substring(0, fichierPano.length() - 6);
        String extension = fichierPano.substring(fichierPano.length() - 3, fichierPano.length());
        Image top = null;
        Image bottom = null;
        Image left = null;
        Image right = null;
        Image front = null;
        Image behind = null;
        if (extension.equals("bmp")) {
            top = new Image("file:" + nom + "_u.bmp");
            bottom = new Image("file:" + nom + "_d.bmp");
            left = new Image("file:" + nom + "_l.bmp");
            right = new Image("file:" + nom + "_r.bmp");
            front = new Image("file:" + nom + "_f.bmp");
            behind = new Image("file:" + nom + "_b.bmp");
        }
        if (extension.equals("jpg")) {
            top = new Image("file:" + nom + "_u.jpg");
            bottom = new Image("file:" + nom + "_d.jpg");
            left = new Image("file:" + nom + "_l.jpg");
            right = new Image("file:" + nom + "_r.jpg");
            front = new Image("file:" + nom + "_f.jpg");
            behind = new Image("file:" + nom + "_b.jpg");
        }
        if (extension.equals("tif")) {
            try {
                top = ReadWriteImage.readTiff(nom + "_u.tif");
                bottom = ReadWriteImage.readTiff(nom + "_d.tif");
                left = ReadWriteImage.readTiff(nom + "_l.tif");
                right = ReadWriteImage.readTiff(nom + "_r.tif");
                front = ReadWriteImage.readTiff(nom + "_f.tif");
                behind = ReadWriteImage.readTiff(nom + "_b.tif");
            } catch (ImageReadException ex) {
                Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IOException ex) {
                Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        int nombreNiveaux = creeNiveauxImageCube(nom + "_u." + extension, repertPanos);
        creeNiveauxImageCube(nom + "_d." + extension, repertPanos);
        creeNiveauxImageCube(nom + "_l." + extension, repertPanos);
        creeNiveauxImageCube(nom + "_r." + extension, repertPanos);
        creeNiveauxImageCube(nom + "_f." + extension, repertPanos);
        creeNiveauxImageCube(nom + "_b." + extension, repertPanos);
        panoCree.setNombreNiveaux(nombreNiveaux);

        Image equiRectangulaire = TransformationsPanoramique.cube2rect(front, left, right, behind, top, bottom,
                1200);
        Image vignetteEquiRectangulaire = TransformationsPanoramique.cube2rect(front, left, right, behind, top,
                bottom, 300);
        panoCree.setImagePanoramique(equiRectangulaire);
        panoCree.setVignettePanoramique(vignetteEquiRectangulaire);
        panoCree.setTypePanoramique(Panoramique.CUBE);
    }

    panoCree.setLookAtX(0.0d);
    panoCree.setLookAtY(0.0d);
    panoCree.setAfficheInfo(true);
    panoCree.setAfficheTitre(true);
    imagePanoramique.setImage(panoCree.getImagePanoramique());
    //        CheckBox chkAfficheInfo = (CheckBox) scene.lookup("#chkafficheinfo");
    //        CheckBox chkAfficheTitre = (CheckBox) scene.lookup("#chkaffichetitre");
    //        RadioButton radSphere = (RadioButton) scene.lookup("#radsphere");
    //        RadioButton radCube = (RadioButton) scene.lookup("#radcube");

    imagePanoramique.setSmooth(true);
    retireAffichageLigne();
    retireAffichageHotSpots();
    retireAffichagePointsHotSpots();
    numPoints = 0;
    ajouteAffichageLignes();
    panoramiquesProjet[nombrePanoramiques] = panoCree;
    panoActuel = nombrePanoramiques;

    //        chkAfficheInfo.setSelected(panoramiquesProjet[panoActuel].isAfficheInfo());
    //        chkAfficheTitre.setSelected(panoramiquesProjet[panoActuel].isAfficheTitre());
    //        if (panoramiquesProjet[panoActuel].getTypePanoramique().equals(Panoramique.SPHERE)) {
    //            radSphere.setSelected(true);
    //            radCube.setSelected(false);
    //        } else {
    //            radCube.setSelected(true);
    //            radSphere.setSelected(false);
    //        }
    listeChoixPanoramique.setValue(listeChoixPanoramique.getItems().get(nombrePanoramiques));
    //listeChoixPanoramiqueEntree.setValue(listeChoixPanoramiqueEntree.getItems().get(0));
    nombrePanoramiques++;
    affichePoV(panoramiquesProjet[panoActuel].getLookAtX(), panoramiquesProjet[panoActuel].getLookAtY());
    afficheNord(panoramiquesProjet[panoActuel].getZeroNord());
    gestionnairePlan.afficheConfigPlan();
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param strFichierPano//from w w w  .  j  a  va 2 s . com
 * @param typePano
 * @param iNumero
 * @param iTotal
 * @throws InterruptedException Exception interruption
 */
@SuppressWarnings("empty-statement")
private static void ajoutePanoramiqueProjet(String strFichierPano, String typePano, int iNumero, int iTotal)
        throws InterruptedException {
    bPanoCharge = true;
    bEstCharge = true;
    Panoramique panoCree = new Panoramique();
    if (typePano.equals(Panoramique.SPHERE)) {
        File jpegFile = new File(strFichierPano);
        if (!jpegFile.exists()) {
            jpegFile = new File(
                    getStrRepertAppli() + File.separator + "images" + File.separator + "pasImage.jpg");
        }
        try {
            Metadata metadata = ImageMetadataReader.readMetadata(jpegFile);
            for (Directory directory : metadata.getDirectories()) {
                System.out.println("Directory: " + directory.getName());
                for (String error : directory.getErrors()) {
                    System.out.println("> error: " + error);
                }
                directory.getTags().stream().forEach((tag) -> {
                    System.out.println("> tag: " + tag.getTagName() + " = " + tag.getDescription());
                });
            }
        } catch (ImageProcessingException | IOException ex) {
            Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
        }
        panoCree.setStrNomFichier(strFichierPano);
        int iNombreNiveaux = iCreeNiveauxImageEqui(jpegFile.getAbsolutePath(), strFichierPano,
                getStrRepertPanos(), getiNombrePanoramiques(), iNumero, iTotal);
        Platform.runLater(() -> {
            lblNiveaux.setText("Cration visualisation panoramique");
            pbarAvanceChargement.setProgress((double) (iNumero - 1) / (double) iTotal + 0.666 / iTotal);
        });

        panoCree.setStrNomFichier(strFichierPano);
        Image imgPano3 = null;
        Image imgPano4 = null;
        Image imgPano5 = null;
        String strExtension = jpegFile.getAbsolutePath().substring(jpegFile.getAbsolutePath().length() - 3,
                jpegFile.getAbsolutePath().length());
        if ("tif".equals(strExtension)) {
            try {
                imgPanoRetaille2 = ReadWriteImage.readTiff(jpegFile.getAbsolutePath());
                imgPanoRetaille2 = ReadWriteImage.resizeImage(imgPanoRetaille2, 1200, 600);

                String nomVignette = jpegFile.getAbsolutePath().substring(0,
                        jpegFile.getAbsolutePath().lastIndexOf(".")) + "Vignette.jpg";
                File ficVig = new File(nomVignette);
                if (ficVig.exists()) {
                    imgPano3 = new Image("file:" + nomVignette, 300, 150, true, true, true);
                    imgPano4 = ReadWriteImage.readTiff(jpegFile.getAbsolutePath());
                    imgPano4 = ReadWriteImage.resizeImage(imgPano4, 300, 150);
                    imgPano5 = ReadWriteImage.resizeImage(imgPano4, 70, 35);
                } else {
                    imgPano3 = ReadWriteImage.readTiff(jpegFile.getAbsolutePath());
                    imgPano3 = ReadWriteImage.resizeImage(imgPano3, 300, 150);
                    imgPano5 = ReadWriteImage.resizeImage(imgPano3, 70, 35);
                    imgPano4 = imgPano3;
                }
                panoCree.setImgVisuPanoramique(
                        imgTransformationImage(ReadWriteImage.readTiff(jpegFile.getAbsolutePath()), 2));

            } catch (ImageReadException | IOException ex) {
                Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
            }
        } else {
            imgPanoRetaille2 = new Image("file:" + jpegFile.getAbsolutePath(), 1200, 600, true, true, true);
            imgPano5 = new Image("file:" + jpegFile.getAbsolutePath(), 70, 35, true, true, true);
            imgPano4 = new Image("file:" + jpegFile.getAbsolutePath(), 300, 150, true, true, true);
            imgPano3 = imgPano4;

            String nomVignette = jpegFile.getAbsolutePath().substring(0,
                    jpegFile.getAbsolutePath().lastIndexOf(".")) + "Vignette.jpg";
            File ficVig = new File(nomVignette);
            if (ficVig.exists()) {
                imgPano3 = new Image("file:" + nomVignette, 300, 150, true, true, true);
            }
            panoCree.setImgVisuPanoramique(
                    imgTransformationImage(new Image("file:" + jpegFile.getAbsolutePath()), 2));
        }
        panoCree.setImgPanoramique(imgPanoRetaille2);
        panoCree.setNombreNiveaux(iNombreNiveaux);
        panoCree.setImgVignettePanoramique(imgPano3);
        panoCree.setImgPanoRect(imgPano4);
        panoCree.setImgPanoRectListe(imgPano5);
        panoCree.setStrTypePanoramique(Panoramique.SPHERE);
    }
    if (typePano.equals(Panoramique.CUBE)) {
        panoCree.setStrNomFichier(strFichierPano);
        panoCree.setStrNomFichier(strFichierPano);
        String strNom = strFichierPano.substring(0, strFichierPano.length() - 6);
        String strExtension = strFichierPano.substring(strFichierPano.length() - 3, strFichierPano.length());
        Image imgTop = null;
        Image imgBottom = null;
        Image imgLeft = null;
        Image imgRight = null;
        Image imgFront = null;
        Image imgBehind = null;
        if (strExtension.equals("bmp")) {
            imgTop = new Image("file:" + strNom + "_u.bmp");
            imgBottom = new Image("file:" + strNom + "_d.bmp");
            imgLeft = new Image("file:" + strNom + "_l.bmp");
            imgRight = new Image("file:" + strNom + "_r.bmp");
            imgFront = new Image("file:" + strNom + "_f.bmp");
            imgBehind = new Image("file:" + strNom + "_b.bmp");
        }
        if (strExtension.equals("jpg")) {
            imgTop = new Image("file:" + strNom + "_u.jpg");
            imgBottom = new Image("file:" + strNom + "_d.jpg");
            imgLeft = new Image("file:" + strNom + "_l.jpg");
            imgRight = new Image("file:" + strNom + "_r.jpg");
            imgFront = new Image("file:" + strNom + "_f.jpg");
            imgBehind = new Image("file:" + strNom + "_b.jpg");
        }
        if (strExtension.equals("tif")) {
            try {
                imgTop = ReadWriteImage.readTiff(strNom + "_u.tif");
                imgBottom = ReadWriteImage.readTiff(strNom + "_d.tif");
                imgLeft = ReadWriteImage.readTiff(strNom + "_l.tif");
                imgRight = ReadWriteImage.readTiff(strNom + "_r.tif");
                imgFront = ReadWriteImage.readTiff(strNom + "_f.tif");
                imgBehind = ReadWriteImage.readTiff(strNom + "_b.tif");

            } catch (ImageReadException | IOException ex) {
                Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        Image imgEquiRectangulaire = TransformationsPanoramique.cube2rect(imgFront, imgLeft, imgRight,
                imgBehind, imgTop, imgBottom, 1200);
        Image imgEquiRectangulaire2 = TransformationsPanoramique.cube2rect(imgFront, imgLeft, imgRight,
                imgBehind, imgTop, imgBottom, 8000);
        panoCree.setImgCubeEqui(imgEquiRectangulaire2);
        Image imgVignetteEquiRectangulaire = TransformationsPanoramique.cube2rect(imgFront, imgLeft, imgRight,
                imgBehind, imgTop, imgBottom, 300);
        Image imgPano5 = TransformationsPanoramique.cube2rect(imgFront, imgLeft, imgRight, imgBehind, imgTop,
                imgBottom, 70);
        panoCree.setImgPanoramique(imgEquiRectangulaire);
        Platform.runLater(() -> {
            lblNiveaux.setText("Cration visualisation panoramique");
            pbarAvanceChargement.setProgress(((double) (iNumero - 1) + 1.d / 3.d) / iTotal);
        });

        panoCree.setImgVisuPanoramique(imgTransformationImage(imgEquiRectangulaire2, 1));
        int iNombreNiveaux = iCreeNiveauxImageCube(strNom + "_u." + strExtension, getStrRepertPanos(),
                getiNombrePanoramiques(), "dessus");
        Platform.runLater(() -> {
            pbarAvanceChargement.setProgress(((double) (iNumero - 1) + 4.d / 9.d) / (double) iTotal);
        });

        iCreeNiveauxImageCube(strNom + "_d." + strExtension, getStrRepertPanos(), getiNombrePanoramiques(),
                "dessous");
        Platform.runLater(() -> {
            pbarAvanceChargement.setProgress(((double) (iNumero - 1) + 5.d / 9.d) / (double) iTotal);
        });
        iCreeNiveauxImageCube(strNom + "_l." + strExtension, getStrRepertPanos(), getiNombrePanoramiques(),
                "gauche");
        Platform.runLater(() -> {
            pbarAvanceChargement.setProgress(((double) (iNumero - 1) + 2.d / 3.d) / (double) iTotal);
        });

        iCreeNiveauxImageCube(strNom + "_r." + strExtension, getStrRepertPanos(), getiNombrePanoramiques(),
                "droite");
        Platform.runLater(() -> {
            pbarAvanceChargement.setProgress(((double) (iNumero - 1) + 7.d / 9.d) / (double) iTotal);
        });

        iCreeNiveauxImageCube(strNom + "_f." + strExtension, getStrRepertPanos(), getiNombrePanoramiques(),
                "devant");
        Platform.runLater(() -> {
            pbarAvanceChargement.setProgress(((double) (iNumero - 1) + 8.d / 9.d) / (double) iTotal);
        });

        iCreeNiveauxImageCube(strNom + "_b." + strExtension, getStrRepertPanos(), getiNombrePanoramiques(),
                "derriere");
        Platform.runLater(() -> {
            pbarAvanceChargement.setProgress(((double) (iNumero)) / (double) iTotal);
        });
        String nomVignette = strFichierPano.substring(0, strFichierPano.lastIndexOf(".")) + "Vignette.jpg";
        File ficVig = new File(nomVignette);
        Image imgPano3;
        Image imgPano4;

        if (ficVig.exists()) {
            imgPano3 = new Image("file:" + nomVignette, 300, 150, true, true, true);
            imgPano4 = imgVignetteEquiRectangulaire;
        } else {
            imgPano3 = imgVignetteEquiRectangulaire;
            imgPano4 = imgPano3;
        }

        panoCree.setNombreNiveaux(iNombreNiveaux);
        panoCree.setImgVignettePanoramique(imgPano3);
        panoCree.setImgPanoRect(imgPano4);
        panoCree.setImgPanoRectListe(imgPano5);
        panoCree.setStrTypePanoramique(Panoramique.CUBE);
    }

    panoCree.setRegardX(0.0d);
    panoCree.setRegardY(0.0d);
    panoCree.setAfficheInfo(true);
    panoCree.setAfficheTitre(true);
    panoCree.setStrTitrePanoramique("");
    getPanoramiquesProjet()[getiNombrePanoramiques()] = panoCree;
    setiPanoActuel(getiNombrePanoramiques());
    setiNombrePanoramiques(getiNombrePanoramiques() + 1);

}

From source file:editeurpanovisu.EditeurPanovisu.java

@SuppressWarnings("empty-statement")
private static void rechargePanoramiqueProjet(String strFichierPano, String typePano)
        throws InterruptedException {
    bPanoCharge = true;//from   w ww  .  ja v a 2  s. com
    bEstCharge = true;
    if (typePano.equals(Panoramique.SPHERE)) {
        File imageFile = new File(strFichierPano);
        if (!imageFile.exists()) {
            imageFile = new File(
                    getStrRepertAppli() + File.separator + "images" + File.separator + "pasImage.jpg");
        }
        try {
            Metadata metadata = ImageMetadataReader.readMetadata(imageFile);
            for (Directory directory : metadata.getDirectories()) {
                System.out.println("Directory: " + directory.getName());

                // Log all errors.
                for (String error : directory.getErrors()) {
                    System.out.println("> error: " + error);
                }

                // Log all tags.
                directory.getTags().stream().forEach((tag) -> {
                    System.out.println("> tag: " + tag.getTagName() + " = " + tag.getDescription());
                });

            }
        } catch (ImageProcessingException | IOException ex) {
            Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
        }
        getPanoramiquesProjet()[getiPanoActuel()].setStrNomFichier(strFichierPano);
        int iNum = getiPanoActuel();
        int iNombreNiveaux = iCreeNiveauxImageEqui(imageFile.getAbsolutePath(), strFichierPano,
                getStrRepertPanos(), iNum, 0, 0);
        Image imgPano3 = null;
        Image imgPano4 = null;
        Image imgPano5 = null;
        String strExtension = imageFile.getAbsolutePath().substring(imageFile.getAbsolutePath().length() - 3,
                imageFile.getAbsolutePath().length());
        if ("tif".equals(strExtension)) {
            try {
                imgPanoRetaille2 = ReadWriteImage.readTiff(imageFile.getAbsolutePath());
                imgPanoRetaille2 = ReadWriteImage.resizeImage(imgPanoRetaille2, 1200, 600);

                String nomVignette = imageFile.getAbsolutePath().substring(0,
                        imageFile.getAbsolutePath().lastIndexOf(".")) + "Vignette.jpg";
                File ficVig = new File(nomVignette);
                if (ficVig.exists()) {
                    imgPano3 = new Image("file:" + nomVignette, 300, 150, true, true, true);
                    imgPano4 = ReadWriteImage.readTiff(imageFile.getAbsolutePath());
                    imgPano4 = ReadWriteImage.resizeImage(imgPano4, 300, 150);
                    imgPano5 = ReadWriteImage.resizeImage(imgPano4, 70, 35);
                } else {
                    imgPano3 = ReadWriteImage.readTiff(imageFile.getAbsolutePath());
                    imgPano3 = ReadWriteImage.resizeImage(imgPano3, 300, 150);
                    imgPano4 = imgPano3;
                    imgPano5 = ReadWriteImage.resizeImage(imgPano3, 70, 35);
                }
                getPanoramiquesProjet()[getiPanoActuel()].setImgVisuPanoramique(
                        imgTransformationImage(ReadWriteImage.readTiff(imageFile.getAbsolutePath()), 2));

            } catch (ImageReadException | IOException ex) {
                Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
            }
        } else {
            imgPanoRetaille2 = new Image("file:" + imageFile.getAbsolutePath(), 1200, 600, true, true, true);
            imgPano5 = new Image("file:" + imageFile.getAbsolutePath(), 70, 35, true, true, true);
            String nomVignette = imageFile.getAbsolutePath().substring(0,
                    imageFile.getAbsolutePath().lastIndexOf(".")) + "Vignette.jpg";
            File ficVig = new File(nomVignette);
            if (ficVig.exists()) {
                imgPano3 = new Image("file:" + nomVignette, 300, 150, true, true, true);
                imgPano4 = new Image("file:" + imageFile.getAbsolutePath(), 300, 150, true, true, true);
            } else {
                imgPano3 = new Image("file:" + imageFile.getAbsolutePath(), 300, 150, true, true, true);
                imgPano4 = imgPano3;
            }
            getPanoramiquesProjet()[getiPanoActuel()].setImgVisuPanoramique(
                    imgTransformationImage(new Image("file:" + imageFile.getAbsolutePath()), 2));
        }
        getPanoramiquesProjet()[getiPanoActuel()].setImgPanoramique(imgPanoRetaille2);
        getPanoramiquesProjet()[getiPanoActuel()].setNombreNiveaux(iNombreNiveaux);
        getPanoramiquesProjet()[getiPanoActuel()].setImgVignettePanoramique(imgPano3);
        getPanoramiquesProjet()[getiPanoActuel()].setImgPanoRect(imgPano4);
        getPanoramiquesProjet()[getiPanoActuel()].setImgPanoRectListe(imgPano5);

        getPanoramiquesProjet()[getiPanoActuel()].setStrTypePanoramique(Panoramique.SPHERE);
    }
    if (typePano.equals(Panoramique.CUBE)) {
        getPanoramiquesProjet()[getiPanoActuel()].setStrNomFichier(strFichierPano);
        String strNom = strFichierPano.substring(0, strFichierPano.length() - 6);
        String strExtension = strFichierPano.substring(strFichierPano.length() - 3, strFichierPano.length());
        Image imgTop = null;
        Image imgBottom = null;
        Image imgLeft = null;
        Image imgRight = null;
        Image imgFront = null;
        Image imgBehind = null;
        if (strExtension.equals("bmp")) {
            imgTop = new Image("file:" + strNom + "_u.bmp");
            imgBottom = new Image("file:" + strNom + "_d.bmp");
            imgLeft = new Image("file:" + strNom + "_l.bmp");
            imgRight = new Image("file:" + strNom + "_r.bmp");
            imgFront = new Image("file:" + strNom + "_f.bmp");
            imgBehind = new Image("file:" + strNom + "_b.bmp");
        }
        if (strExtension.equals("jpg")) {
            imgTop = new Image("file:" + strNom + "_u.jpg");
            imgBottom = new Image("file:" + strNom + "_d.jpg");
            imgLeft = new Image("file:" + strNom + "_l.jpg");
            imgRight = new Image("file:" + strNom + "_r.jpg");
            imgFront = new Image("file:" + strNom + "_f.jpg");
            imgBehind = new Image("file:" + strNom + "_b.jpg");
        }
        if (strExtension.equals("tif")) {
            try {
                imgTop = ReadWriteImage.readTiff(strNom + "_u.tif");
                imgBottom = ReadWriteImage.readTiff(strNom + "_d.tif");
                imgLeft = ReadWriteImage.readTiff(strNom + "_l.tif");
                imgRight = ReadWriteImage.readTiff(strNom + "_r.tif");
                imgFront = ReadWriteImage.readTiff(strNom + "_f.tif");
                imgBehind = ReadWriteImage.readTiff(strNom + "_b.tif");

            } catch (ImageReadException | IOException ex) {
                Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        Image imgEquiRectangulaire = TransformationsPanoramique.cube2rect(imgFront, imgLeft, imgRight,
                imgBehind, imgTop, imgBottom, 1200);
        Image imgEquiRectangulaire2 = TransformationsPanoramique.cube2rect(imgFront, imgLeft, imgRight,
                imgBehind, imgTop, imgBottom, 4096);
        Image imgVignetteEquiRectangulaire = TransformationsPanoramique.cube2rect(imgFront, imgLeft, imgRight,
                imgBehind, imgTop, imgBottom, 300);
        Image imgPano5 = TransformationsPanoramique.cube2rect(imgFront, imgLeft, imgRight, imgBehind, imgTop,
                imgBottom, 70);
        getPanoramiquesProjet()[getiPanoActuel()].setImgPanoramique(imgEquiRectangulaire);

        getPanoramiquesProjet()[getiPanoActuel()]
                .setImgVisuPanoramique(imgTransformationImage(imgEquiRectangulaire2, 1));
        int iNum = getiPanoActuel();
        int iNombreNiveaux = iCreeNiveauxImageCube(strNom + "_u." + strExtension, getStrRepertPanos(), iNum,
                "dessus");
        iCreeNiveauxImageCube(strNom + "_d." + strExtension, getStrRepertPanos(), iNum, "dessous");
        iCreeNiveauxImageCube(strNom + "_l." + strExtension, getStrRepertPanos(), iNum, "gauche");
        iCreeNiveauxImageCube(strNom + "_r." + strExtension, getStrRepertPanos(), iNum, "droite");
        iCreeNiveauxImageCube(strNom + "_f." + strExtension, getStrRepertPanos(), iNum, "devant");
        iCreeNiveauxImageCube(strNom + "_b." + strExtension, getStrRepertPanos(), iNum, "derriere");
        String nomVignette = strFichierPano.substring(0, strFichierPano.lastIndexOf(".")) + "Vignette.jpg";
        File ficVig = new File(nomVignette);
        Image imgPano3;
        Image imgPano4;
        if (ficVig.exists()) {
            imgPano3 = new Image("file:" + nomVignette, 300, 150, true, true, true);
            imgPano4 = imgVignetteEquiRectangulaire;
        } else {
            imgPano3 = imgVignetteEquiRectangulaire;
            imgPano4 = imgPano3;
        }

        getPanoramiquesProjet()[getiPanoActuel()].setNombreNiveaux(iNombreNiveaux);
        getPanoramiquesProjet()[getiPanoActuel()].setImgVignettePanoramique(imgPano3);
        getPanoramiquesProjet()[getiPanoActuel()].setImgPanoRect(imgPano4);
        getPanoramiquesProjet()[getiPanoActuel()].setImgPanoRectListe(imgPano5);
        getPanoramiquesProjet()[getiPanoActuel()].setStrTypePanoramique(Panoramique.CUBE);
    }

}