Example usage for javafx.scene.control TextArea setText

List of usage examples for javafx.scene.control TextArea setText

Introduction

In this page you can find the example usage for javafx.scene.control TextArea setText.

Prototype

public final void setText(String value) 

Source Link

Usage

From source file:io.bitsquare.gui.components.paymentmethods.CashDepositForm.java

@Override
public void addFormForDisplayAccount() {
    gridRowFrom = gridRow;/*from   w w w .j a v  a 2  s. co m*/
    String countryCode = cashDepositAccountContractData.getCountryCode();

    addLabelTextField(gridPane, gridRow, "Account name:", paymentAccount.getAccountName(),
            Layout.FIRST_ROW_AND_GROUP_DISTANCE);
    addLabelTextField(gridPane, ++gridRow, "Payment method:",
            BSResources.get(paymentAccount.getPaymentMethod().getId()));
    addLabelTextField(gridPane, ++gridRow, "Country:",
            getCountryBasedPaymentAccount().getCountry() != null
                    ? getCountryBasedPaymentAccount().getCountry().name
                    : "");
    addLabelTextField(gridPane, ++gridRow, "Currency:",
            paymentAccount.getSingleTradeCurrency().getNameAndCode());
    addAcceptedBanksForDisplayAccount();
    addHolderNameAndIdForDisplayAccount();
    addLabelTextField(gridPane, ++gridRow, "Account holder email:",
            cashDepositAccountContractData.getHolderEmail());

    if (BankUtil.isBankNameRequired(countryCode))
        addLabelTextField(gridPane, ++gridRow, "Bank name:",
                cashDepositAccountContractData.getBankName()).second.setMouseTransparent(false);

    if (BankUtil.isBankIdRequired(countryCode))
        addLabelTextField(gridPane, ++gridRow, BankUtil.getBankIdLabel(countryCode),
                cashDepositAccountContractData.getBankId()).second.setMouseTransparent(false);

    if (BankUtil.isBranchIdRequired(countryCode))
        addLabelTextField(gridPane, ++gridRow, BankUtil.getBranchIdLabel(countryCode),
                cashDepositAccountContractData.getBranchId()).second.setMouseTransparent(false);

    if (BankUtil.isAccountNrRequired(countryCode))
        addLabelTextField(gridPane, ++gridRow, BankUtil.getAccountNrLabel(countryCode),
                cashDepositAccountContractData.getAccountNr()).second.setMouseTransparent(false);

    if (BankUtil.isAccountTypeRequired(countryCode))
        addLabelTextField(gridPane, ++gridRow, BankUtil.getAccountTypeLabel(countryCode),
                cashDepositAccountContractData.getAccountType()).second.setMouseTransparent(false);

    String requirements = cashDepositAccountContractData.getRequirements();
    boolean showRequirements = requirements != null && !requirements.isEmpty();
    if (showRequirements) {
        TextArea textArea = addLabelTextArea(gridPane, ++gridRow, "Extra requirements:", "").second;
        textArea.setMinHeight(30);
        textArea.setMaxHeight(30);
        textArea.setEditable(false);
        textArea.setId("text-area-disabled");
        textArea.setText(requirements);
    }

    addAllowedPeriod();
}

From source file:com.core.meka.SOMController.java

private double[][] crearArreglo(String[] patrones, TextArea resultArea) throws NumberFormatException {
    int totalPatrones = patrones.length;
    int dimension = patrones[0].split(",").length;
    double[][] result = new double[totalPatrones][dimension];

    for (int i = 0; i < totalPatrones; i++) {
        String[] patron = patrones[i].split(",");
        double[] patronDouble = new double[dimension];
        for (int j = 0; j < patron.length; j++) {
            try {
                patronDouble[j] = Double.valueOf(patron[j]);
            } catch (NumberFormatException e) {
                resultArea.setText("Imposible formatear ese numero, verifiquelo\n"
                        + e.getMessage().replaceAll("\\)", ")\n")
                                .replaceAll("For input string", "Cadena de entrada")
                                .replaceAll("multiple points", "Puntos multiples")
                        + ": " + patron[j] + "\n\n" + resultArea.getText());
                throw new NumberFormatException("Imposible formatear ese numero, veriquelo");
            }//ww  w  . jav a 2 s.  c  o m
        }
        result[i] = patronDouble;
    }

    return result;
}

From source file:com.core.meka.SOMController.java

private String guardarArrayAArchivo(String array, TextArea resultado) throws IOException {
    String result = "";
    FileChooser chooser = new FileChooser();
    chooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("Text doc(*.txt)", "*.txt"));
    File file = chooser.showSaveDialog(base.getScene().getWindow());
    if (file != null) {
        file = new File(file.getAbsolutePath() + ".txt");
        String path = file.getAbsolutePath();
        try {//from  w  ww.j  a v  a2  s.co m
            PrintWriter writer = new PrintWriter(path, "UTF-8");
            writer.print(array);
            writer.close();
        } catch (Exception e) {
            resultado.setText("Problemas al almacenar el vector\n" + e.getMessage().replaceAll("\\)", "\n"));
        }
    }
    return result;
}

From source file:com.ggvaidya.scinames.dataset.BinomialChangesSceneController.java

private Optional<String> askUserForTextArea(String label, String initialText) {
    TextArea textarea = new TextArea();
    if (initialText != null)
        textarea.setText(initialText);

    Dialog<ButtonType> dialog = new Dialog<>();
    dialog.getDialogPane().headerTextProperty().set(label);
    dialog.getDialogPane().contentProperty().set(textarea);
    dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);
    Optional<ButtonType> result = dialog.showAndWait();

    if (result.isPresent() && result.get().equals(ButtonType.OK))
        return Optional.of(textarea.getText());
    else/* w w  w.j a  v  a 2  s  . c  o m*/
        return Optional.empty();
}

From source file:com.github.drbookings.ui.controller.MainController.java

private void showAbout() {

    final Alert alert = new Alert(AlertType.INFORMATION);
    alert.setTitle("About DrBookings");
    final TextArea label = new TextArea();

    label.setEditable(false);// w ww.j a va 2  s. c o  m
    label.setPrefHeight(400);
    label.setPrefWidth(400);
    label.getStyleClass().add("copyable-label");

    final StringBuilder sb = new StringBuilder();

    try {
        sb.append("Application version\t").append(Manifests.read("Implementation-Version")).append("\n");
        sb.append("Build time\t\t").append(Manifests.read("Build-Time")).append("\n");
    } catch (final Exception e) {
        if (logger.isInfoEnabled()) {
            logger.error("Failed to add manifest entry", e.getLocalizedMessage());
        }
    }

    label.setText(sb.toString());
    alert.setHeaderText("proudly brought to you by kerner1000");
    alert.setContentText(null);
    alert.getDialogPane().setContent(label);
    alert.showAndWait();
}

From source file:editeurpanovisu.EditeurPanovisu.java

private AnchorPane afficherListePanosVignettes(int numHS) {

    AnchorPane aplistePano = new AnchorPane();
    aplistePano.setOpacity(1);//from  w  w w  .j  av a2 s  . co  m
    Pane fond = new Pane();
    fond.setStyle("-fx-background-color : #bbb;");
    fond.setPrefWidth(540);
    fond.setPrefHeight(((nombrePanoramiques - 2) / 4 + 1) * 65 + 10);
    fond.setMinWidth(540);
    fond.setMinHeight(70);
    aplistePano.getChildren().add(fond);
    aplistePano.setStyle("-fx-backgroung-color : #bbb;");
    int j = 0;
    ImageView[] IVPano;
    IVPano = new ImageView[nombrePanoramiques];
    double xPos;
    double yPos;
    int row = 0;
    for (int i = 0; i < nombrePanoramiques; i++) {
        int numeroPano = i;
        IVPano[j] = new ImageView(panoramiquesProjet[i].getVignettePanoramique());
        IVPano[j].setFitWidth(120);
        IVPano[j].setFitHeight(60);
        IVPano[j].setSmooth(true);
        String nomPano = panoramiquesProjet[i].getNomFichier();
        int col = j % 4;
        row = j / 4;
        xPos = col * 130 + 25;
        yPos = row * 65 + 5;
        IVPano[j].setLayoutX(xPos);
        IVPano[j].setLayoutY(yPos);
        IVPano[j].setCursor(Cursor.HAND);
        IVPano[j].setStyle("-fx-background-color : #ccc;");
        Tooltip t = new Tooltip(
                nomPano.substring(nomPano.lastIndexOf(File.separator) + 1, nomPano.lastIndexOf(".")));
        t.setStyle(tooltipStyle);
        Tooltip.install(IVPano[j], t);
        IVPano[j].setOnMouseClicked((MouseEvent me) -> {
            pano.setCursor(Cursor.CROSSHAIR);
            pano.setOnMouseClicked((MouseEvent me1) -> {
                gereSourisPanoramique(me1);
            });
            panoListeVignette = nomPano;
            if (panoramiquesProjet[numeroPano].getTitrePanoramique() != null) {
                String texteHS = panoramiquesProjet[numeroPano].getTitrePanoramique();
                TextArea txtHS = (TextArea) outils.lookup("#txtHS" + numHS);
                txtHS.setText(texteHS);
            }
            panoramiquesProjet[panoActuel].getHotspot(numHS).setNumeroPano(numeroPano);
            ComboBox cbx = (ComboBox) outils.lookup("#cbpano" + numHS);
            cbx.setValue(nomPano.substring(nomPano.lastIndexOf(File.separator) + 1, nomPano.lastIndexOf(".")));
            aplistePano.setVisible(false);
            me.consume();
        });
        aplistePano.getChildren().add(IVPano[j]);
        j++;

    }
    int taille = (row + 1) * 65 + 5;
    aplistePano.setPrefWidth(540);
    aplistePano.setPrefHeight(taille);
    aplistePano.setMinWidth(540);
    aplistePano.setMinHeight(taille);
    ImageView IVClose = new ImageView(
            new Image("file:" + repertAppli + File.separator + "images/ferme.png", 20, 20, true, true));
    IVClose.setLayoutX(2);
    IVClose.setLayoutY(5);
    IVClose.setCursor(Cursor.HAND);
    aplistePano.getChildren().add(IVClose);
    IVClose.setOnMouseClicked((MouseEvent me) -> {
        pano.setCursor(Cursor.CROSSHAIR);
        pano.setOnMouseClicked((MouseEvent me1) -> {
            gereSourisPanoramique(me1);
        });

        panoListeVignette = "";
        aplistePano.setVisible(false);
        me.consume();
    });
    aplistePano.setTranslateZ(2);
    return aplistePano;
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param lstPano/*from   w ww .  ja  v  a  2 s.c  om*/
 * @param numPano
 * @return
 */
public Pane affichageHS(String lstPano, int numPano) {

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

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

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

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

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

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

From source file:editeurpanovisu.EditeurPanovisu.java

private void analyseLigne(String ligneComplete) throws InterruptedException, ImageReadException {
    panoEntree = "";
    nombrePanoramiques = 0;//from w  w w.ja  v a 2s. c o  m
    ligneComplete = ligneComplete.replace("[", "|");
    String lignes[] = ligneComplete.split("\\|", 500);
    String ligne;
    String[] elementsLigne;
    String[] typeElement;
    int nbHS = 0;
    int nbImg = 0;
    int nbHsplan = 0;
    nombrePlans = -1;
    for (int kk = 1; kk < lignes.length; kk++) {
        ligne = lignes[kk];
        elementsLigne = ligne.split(";", 25);
        typeElement = elementsLigne[0].split(">", 2);
        typeElement[0] = typeElement[0].replace(" ", "").replace("=", "").replace("[", "");
        elementsLigne[0] = typeElement[1];
        if ("Panoramique".equals(typeElement[0])) {
            for (int i = 0; i < elementsLigne.length; i++) {
                elementsLigne[i] = elementsLigne[i].replace("]", "").replace("\n", "");
                String[] valeur = elementsLigne[i].split(":", 2);
                System.out.println(valeur[0] + "=" + valeur[1]);

                switch (valeur[0]) {
                case "fichier":
                    String nmFich = valeur[1];
                    Platform.runLater(() -> {
                        lblCharge.setText(nmFich);
                    });
                    File imgPano = new File(nmFich);
                    File imageRepert = new File(repertTemp + File.separator + "panos");

                    if (!imageRepert.exists()) {
                        imageRepert.mkdirs();
                    }
                    repertPanos = imageRepert.getAbsolutePath();
                    String fichierPano = imgPano.getPath();
                    String extension = fichierPano.substring(fichierPano.length() - 3, fichierPano.length());
                    Image img = null;
                    if ("tif".equals(extension)) {
                        try {
                            img = ReadWriteImage.readTiff(fichierPano);
                        } catch (IOException ex) {
                            Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
                        }
                    } else {
                        img = new Image("file:" + fichierPano);
                    }

                    //                            try {
                    //                                copieFichierRepertoire(imgPano.getPath(), repertPanos);
                    //
                    //                            } catch (IOException ex) {
                    //                                Logger.getLogger(EditeurPanovisu.class
                    //                                        .getName()).log(Level.SEVERE, null, ex);
                    //                            }
                    if (img.getWidth() == img.getHeight()) {
                        ajoutePanoramiqueProjet(valeur[1], Panoramique.CUBE);

                    } else {
                        ajoutePanoramiqueProjet(valeur[1], Panoramique.SPHERE);
                    }

                    break;

                case "titre":
                    if (!valeur[1].equals("'null'")) {
                        panoramiquesProjet[panoActuel].setTitrePanoramique(valeur[1]);
                    } else {
                        panoramiquesProjet[panoActuel].setTitrePanoramique("");
                    }
                    break;
                case "type":
                    panoramiquesProjet[panoActuel].setTypePanoramique(valeur[1]);
                    break;
                case "afficheInfo":
                    if (valeur[1].equals("true")) {
                        panoramiquesProjet[panoActuel].setAfficheInfo(true);
                    } else {
                        panoramiquesProjet[panoActuel].setAfficheInfo(false);
                    }
                    break;
                case "afficheTitre":
                    if (valeur[1].equals("true")) {
                        panoramiquesProjet[panoActuel].setAfficheTitre(true);
                    } else {
                        panoramiquesProjet[panoActuel].setAfficheTitre(false);
                    }
                    break;
                case "nb":
                    nbHS = Integer.parseInt(valeur[1]);
                    break;
                case "nbImg":
                    nbImg = Integer.parseInt(valeur[1]);
                    break;
                case "regardX":
                    panoramiquesProjet[panoActuel].setLookAtX(Double.parseDouble(valeur[1]));
                    break;
                case "regardY":
                    panoramiquesProjet[panoActuel].setLookAtY(Double.parseDouble(valeur[1]));
                    break;
                case "zeroNord":
                    panoramiquesProjet[panoActuel].setZeroNord(Double.parseDouble(valeur[1]));
                    break;
                case "numeroPlan":
                    panoramiquesProjet[panoActuel].setNumeroPlan(Integer.parseInt(valeur[1].replace(" ", "")));
                    break;
                case "affichePlan":
                    if (valeur[1].equals("true")) {
                        panoramiquesProjet[panoActuel].setAffichePlan(true);
                    } else {
                        panoramiquesProjet[panoActuel].setAffichePlan(false);
                    }
                    break;
                default:
                    break;
                }
            }
            for (int jj = 0; jj < nbHS; jj++) {
                kk++;
                ligne = lignes[kk];
                elementsLigne = ligne.split(";", 10);
                typeElement = elementsLigne[0].split(">", 2);
                typeElement[0] = typeElement[0].replace(" ", "").replace("=", "").replace("[", "");
                elementsLigne[0] = typeElement[1];
                HotSpot HS = new HotSpot();
                for (int i = 0; i < elementsLigne.length; i++) {
                    elementsLigne[i] = elementsLigne[i].replace("]", "");
                    String[] valeur = elementsLigne[i].split(":", 2);

                    switch (valeur[0]) {
                    case "longitude":
                        HS.setLongitude(Double.parseDouble(valeur[1]));
                        break;
                    case "latitude":
                        HS.setLatitude(Double.parseDouble(valeur[1]));
                        break;
                    case "image":
                        if ("null".equals(valeur[1])) {
                            HS.setFichierImage(null);
                        } else {
                            HS.setFichierImage(valeur[1]);
                        }
                        break;
                    case "info":
                        if ("null".equals(valeur[1])) {
                            HS.setInfo(null);
                        } else {
                            HS.setInfo(valeur[1]);
                        }
                        break;
                    case "xml":
                        if ("null".equals(valeur[1])) {
                            HS.setFichierXML(null);
                        } else {
                            HS.setFichierXML(valeur[1]);
                        }
                        break;
                    case "anime":
                        if (valeur[1].equals("true")) {
                            HS.setAnime(true);
                        } else {
                            HS.setAnime(false);
                        }
                        break;
                    }
                }
                panoramiquesProjet[panoActuel].addHotspot(HS);
            }

            for (int jj = 0; jj < nbImg; jj++) {
                kk++;
                ligne = lignes[kk];
                elementsLigne = ligne.split(";", 10);
                typeElement = elementsLigne[0].split(">", 2);
                typeElement[0] = typeElement[0].replace(" ", "").replace("=", "").replace("[", "");
                elementsLigne[0] = typeElement[1];
                HotspotImage HS = new HotspotImage();
                for (int i = 0; i < elementsLigne.length; i++) {
                    elementsLigne[i] = elementsLigne[i].replace("]", "");
                    String[] valeur = elementsLigne[i].split(":", 2);
                    switch (valeur[0]) {
                    case "longitude":
                        HS.setLongitude(Double.parseDouble(valeur[1]));
                        break;
                    case "latitude":
                        HS.setLatitude(Double.parseDouble(valeur[1]));
                        break;
                    case "image":
                        if ("null".equals(valeur[1])) {
                            HS.setFichierImage(null);
                        } else {
                            HS.setFichierImage(valeur[1]);
                        }
                        break;
                    case "info":
                        if ("null".equals(valeur[1])) {
                            HS.setInfo(null);
                        } else {
                            HS.setInfo(valeur[1]);
                        }
                        break;
                    case "img":
                        if ("null".equals(valeur[1])) {
                            HS.setLienImg(null);
                        } else {
                            HS.setLienImg(valeur[1]);
                        }
                        break;
                    case "urlImg":
                        if ("null".equals(valeur[1])) {
                            HS.setUrlImage(null);
                        } else {
                            HS.setUrlImage(valeur[1]);
                        }
                        String nmFich = valeur[1];
                        File imgPano = new File(nmFich);
                        File imageRepert = new File(repertTemp + File.separator + "images");

                        if (!imageRepert.exists()) {
                            imageRepert.mkdirs();
                        }
                        repertPanos = imageRepert.getAbsolutePath();
                        try {
                            copieFichierRepertoire(imgPano.getPath(), repertPanos);
                        } catch (IOException ex) {
                            Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
                        }

                        break;
                    case "anime":
                        if (valeur[1].equals("true")) {
                            HS.setAnime(true);
                        } else {
                            HS.setAnime(false);
                        }
                        break;
                    }
                }
                panoramiquesProjet[panoActuel].addHotspotImage(HS);
            }

        }

        if ("Plan".equals(typeElement[0])) {
            for (int i = 0; i < elementsLigne.length; i++) {
                elementsLigne[i] = elementsLigne[i].replace("]", "");
                String[] valeur = elementsLigne[i].split(":", 2);
                System.out.println(valeur[0] + "=" + valeur[1]);
                switch (valeur[0]) {
                case "lienImage":
                    nombrePlans++;
                    plans[nombrePlans] = new Plan();
                    plans[nombrePlans].setLienPlan(valeur[1]);
                    File repertoirePlan = new File(repertTemp + File.separator + "images");
                    if (!repertoirePlan.exists()) {
                        repertoirePlan.mkdirs();
                    }
                    try {
                        copieFichierRepertoire(plans[nombrePlans].getLienPlan(),
                                repertoirePlan.getAbsolutePath());
                    } catch (IOException ex) {
                        Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
                    }

                    break;
                case "image":
                    plans[nombrePlans].setImagePlan(valeur[1]);
                    break;
                case "titre":
                    if (!valeur[1].equals("'null'")) {
                        plans[nombrePlans].setTitrePlan(valeur[1]);
                    } else {
                        plans[nombrePlans].setTitrePlan("");
                    }
                    break;
                case "nb":
                    nbHsplan = Integer.parseInt(valeur[1]);
                    break;
                case "position":
                    plans[nombrePlans].setPosition(valeur[1]);
                    break;
                case "positionX":
                    plans[nombrePlans].setPositionX(Double.parseDouble(valeur[1]));
                    break;
                case "positionY":
                    plans[nombrePlans].setPositionY(Double.parseDouble(valeur[1]));
                    break;
                case "directionNord":
                    plans[nombrePlans].setDirectionNord(Double.parseDouble(valeur[1]));
                    break;
                default:
                    break;
                }
            }
            for (int jj = 0; jj < nbHsplan; jj++) {
                kk++;
                ligne = lignes[kk];
                elementsLigne = ligne.split(";", 15);
                typeElement = elementsLigne[0].split(">", 2);
                typeElement[0] = typeElement[0].replace(" ", "").replace("=", "").replace("[", "");
                elementsLigne[0] = typeElement[1];
                HotSpot HS = new HotSpot();
                for (int i = 0; i < elementsLigne.length; i++) {
                    elementsLigne[i] = elementsLigne[i].replace("]", "");
                    String[] valeur = elementsLigne[i].split(":", 2);
                    switch (valeur[0]) {
                    case "longitude":
                        HS.setLongitude(Double.parseDouble(valeur[1]));
                        break;
                    case "latitude":
                        HS.setLatitude(Double.parseDouble(valeur[1]));
                        break;
                    case "image":
                        if ("null".equals(valeur[1])) {
                            HS.setFichierImage(null);
                        } else {
                            HS.setFichierImage(valeur[1]);
                        }
                        break;
                    case "info":
                        if ("null".equals(valeur[1])) {
                            HS.setInfo(null);
                        } else {
                            HS.setInfo(valeur[1]);
                        }
                        break;
                    case "xml":
                        if ("null".equals(valeur[1])) {
                            HS.setFichierXML(null);
                        } else {
                            HS.setFichierXML(valeur[1]);
                        }
                        break;
                    case "numeroPano":
                        HS.setNumeroPano(Integer.parseInt(valeur[1].replace("\n", "").replace(" ", "")));
                        break;
                    case "anime":
                        if (valeur[1].equals("true")) {
                            HS.setAnime(true);
                        } else {
                            HS.setAnime(false);
                        }
                        break;
                    }
                }
                plans[nombrePlans].addHotspot(HS);
            }
            gestionnairePlan.ajouterPlan();
        }
        if ("Interface".equals(typeElement[0])) {
            String[] elts = elementsLigne[0].replace("]", "").split("\n");
            List<String> listeTemplate = new ArrayList<>();
            for (String texte : elts) {
                if (!texte.equals("")) {
                    listeTemplate.add(texte);
                }
            }
            gestionnaireInterface.setTemplate(listeTemplate);
            gestionnaireInterface.afficheTemplate();
        }
        if ("PanoEntree".equals(typeElement[0])) {
            panoEntree = elementsLigne[0].split("]")[0];
        }
        if ("titreVisite".equals(typeElement[0])) {
            TextArea tfVisite = (TextArea) paneChoixPanoramique.lookup("#titreVisite");
            tfVisite.setText(elementsLigne[0].split("]")[0]);
        }

    }
    if (!panoEntree.equals("")) {
        listeChoixPanoramiqueEntree.setValue(panoEntree + ".jpg");
    }
    for (int ii = 0; ii < nombrePanoramiques; ii++) {
        Panoramique pano1 = panoramiquesProjet[ii];
    }
    nombrePlans++;
    gestionnaireInterface.rafraichit();
}

From source file:editeurpanovisu.EditeurPanovisu.java

private void afficheInfoPano() {
    TextArea txtTitrePano = (TextArea) scene.lookup("#txttitrepano");
    //        CheckBox chkAfficheInfo = (CheckBox) scene.lookup("#chkafficheinfo");
    //        CheckBox chkAfficheTitre = (CheckBox) scene.lookup("#chkaffichetitre");
    //        RadioButton radSphere = (RadioButton) scene.lookup("#radsphere");
    //        RadioButton radCube = (RadioButton) scene.lookup("#radcube");

    if (panoramiquesProjet[panoActuel].getTitrePanoramique() != null) {
        txtTitrePano.setText(panoramiquesProjet[panoActuel].getTitrePanoramique());
    } else {/*  w  w w.j  a va2s.com*/
        txtTitrePano.setText("");
    }
    //        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);
    //        }

}