Example usage for javafx.stage Stage setMinWidth

List of usage examples for javafx.stage Stage setMinWidth

Introduction

In this page you can find the example usage for javafx.stage Stage setMinWidth.

Prototype

public final void setMinWidth(double value) 

Source Link

Usage

From source file:qupath.lib.gui.panels.survival.KaplanMeierDisplay.java

private Stage createStage(final Window parent, final String title) {
    Stage frame = new Stage();
    if (parent != null)
        frame.initOwner(parent);/* www .j a  va2  s.  c  o m*/
    frame.setTitle("Kaplan Meier: " + title);

    frame.setOnCloseRequest(e -> {
        if (hierarchy != null)
            hierarchy.removePathObjectListener(KaplanMeierDisplay.this);
        panelParams.removeParameterChangeListener(KaplanMeierDisplay.this);
        frame.hide();
    });

    Scene scene = new Scene(getView(), 600, 400);
    frame.setScene(scene);
    frame.setMinWidth(600);
    frame.setMinHeight(400);
    return frame;
}

From source file:sudoku.controller.GameController.java

@Override
public void start(Stage primaryStage) throws Exception {
    getBoardReady();// w w w  . ja  v a  2s .  c o m

    //when the one of the level button is clicked

    //easy
    sudokuBoard.getEasyButton().setOnAction(e -> {
        try {
            viewController.newGrid(GameController.userBoard, GameController.solutionBoard,
                    sudokuBoard.getTextAreas(), 0);
        } catch (IOException ex) {
            System.out.println("Invalid easy file");
        } catch (ParseException ex) {
            System.out.println("Invalid format in easy file");
        }
    });

    //medium
    sudokuBoard.getMediumButton().setOnAction(e -> {
        try {
            viewController.newGrid(GameController.userBoard, GameController.solutionBoard,
                    sudokuBoard.getTextAreas(), 1);
        } catch (IOException ex) {
            System.out.println("Invalid medium file");
        } catch (ParseException ex) {
            System.out.println("Invalid format in medium file");
        }
    });

    //hard
    sudokuBoard.getHardButton().setOnAction(e -> {
        try {
            viewController.newGrid(GameController.userBoard, GameController.solutionBoard,
                    sudokuBoard.getTextAreas(), 2);
        } catch (IOException ex) {
            System.out.println("Invalid hard file");
        } catch (ParseException ex) {
            System.out.println("Invalid format in hard file");
        }
    });

    Scene scene = new Scene(sudokuBoard.getMainScene(), SIZE, SIZE);
    primaryStage.setScene(scene);
    //fixed dimensions for the board 
    primaryStage.setMaxHeight(SIZE);
    primaryStage.setMaxWidth(SIZE);
    primaryStage.setMinHeight(SIZE);
    primaryStage.setMinWidth(SIZE);

    primaryStage.show();
}

From source file:com.github.vatbub.tictactoe.view.Main.java

/**
 * The main entry point for all JavaFX applications.
 * The start method is called after the init method has returned,
 * and after the system is ready for the application to begin running.
 * <p>//w w w  .  jav  a2  s  . c  o m
 * NOTE: This method is called on the JavaFX Application Thread.
 * </p>
 *
 * @param primaryStage the primary stage for this application, onto which
 *                     the application scene can be set. The primary stage will be embedded in
 *                     the browser if the application was launched as an applet.
 *                     Applications may create other stages, if needed, but they will not be
 *                     primary stages and will not be embedded in the browser.
 */
@Override
public void start(Stage primaryStage) throws Exception {
    Parent root = FXMLLoader.load(getClass().getResource("View.fxml"));
    Scene scene = new Scene(root);
    stage = primaryStage;
    primaryStage.setMinWidth(scene.getRoot().minWidth(0) + 70);
    primaryStage.setMinHeight(scene.getRoot().minHeight(0) + 70);

    primaryStage.setScene(scene);

    // Set Icon
    primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream("icon.png")));

    primaryStage.setTitle(getWindowTitle());

    primaryStage.show();
}

From source file:nl.mvdr.umvc3replayanalyser.gui.ErrorMessagePopup.java

/**
 * Handles an exception that caused program startup to fail, by showing an error message to the user.
 * /*from   w  ww.j  a v  a2  s .c om*/
 * @param title
 *            title for the dialog
 * @param errorMessage
 *            error message
 * @param stage
 *            stage in which to show the error message
 * @param exception
 *            exception that caused the error
 */
public static void show(String title, String errorMessage, final Stage stage, Exception exception) {
    log.info("Showing error message dialog to indicate that startup failed.");

    // Create the error dialog programatically without relying on FXML, to minimize the chances of further failure.

    stage.setTitle(title);

    // Error message text.
    Text text = new Text(errorMessage);

    // Text area containing the stack trace. Not visible by default.
    String stackTrace;
    if (exception != null) {
        stackTrace = ExceptionUtils.getStackTrace(exception);
    } else {
        stackTrace = "No more details available.";
    }
    final TextArea stackTraceArea = new TextArea(stackTrace);
    stackTraceArea.setEditable(false);
    stackTraceArea.setVisible(false);

    // Details button for displaying the stack trace.
    Button detailsButton = new Button();
    detailsButton.setText("Details");
    detailsButton.setOnAction(new EventHandler<ActionEvent>() {
        /** {@inheritDoc} */
        @Override
        public void handle(ActionEvent event) {
            log.info("User clicked Details.");
            stackTraceArea.setVisible(!stackTraceArea.isVisible());
        }
    });

    // OK button for closing the dialog.
    Button okButton = new Button();
    okButton.setText("OK");
    okButton.setOnAction(new EventHandler<ActionEvent>() {
        /** {@inheritDoc} */
        @Override
        public void handle(ActionEvent event) {
            log.info("User clicked OK, closing the dialog.");
            stage.close();
        }
    });

    // Horizontal box containing the buttons, to make sure they are always centered.
    HBox buttonsBox = new HBox(5);
    buttonsBox.getChildren().add(detailsButton);
    buttonsBox.getChildren().add(okButton);
    buttonsBox.setAlignment(Pos.CENTER);

    // Layout constraints.
    AnchorPane.setTopAnchor(text, Double.valueOf(5));
    AnchorPane.setLeftAnchor(text, Double.valueOf(5));
    AnchorPane.setRightAnchor(text, Double.valueOf(5));

    AnchorPane.setTopAnchor(stackTraceArea, Double.valueOf(31));
    AnchorPane.setLeftAnchor(stackTraceArea, Double.valueOf(5));
    AnchorPane.setRightAnchor(stackTraceArea, Double.valueOf(5));
    AnchorPane.setBottomAnchor(stackTraceArea, Double.valueOf(36));

    AnchorPane.setLeftAnchor(buttonsBox, Double.valueOf(5));
    AnchorPane.setRightAnchor(buttonsBox, Double.valueOf(5));
    AnchorPane.setBottomAnchor(buttonsBox, Double.valueOf(5));

    AnchorPane root = new AnchorPane();
    root.getChildren().addAll(text, stackTraceArea, buttonsBox);

    stage.setScene(new Scene(root));

    // Use a standard program icon if possible.
    try {
        stage.getIcons().add(Icons.get().getRandomPortrait());
    } catch (IllegalStateException e) {
        log.warn("Failed to load icon for error dialog; proceeding with default JavaFX icon.", e);
    }

    stage.show();

    // Default size should also be the minimum size.
    stage.setMinWidth(stage.getWidth());
    stage.setMinHeight(stage.getHeight());

    log.info("Error dialog displayed.");
}

From source file:io.bitsquare.app.gui.BitsquareApp.java

@Override
public void start(Stage primaryStage) throws IOException {
    bitsquareAppModule = new BitsquareAppModule(env, primaryStage);
    injector = Guice.createInjector(bitsquareAppModule);
    injector.getInstance(GuiceControllerFactory.class).setInjector(injector);

    // route uncaught exceptions to a user-facing dialog

    Thread.currentThread().setUncaughtExceptionHandler(
            (thread, throwable) -> Popups.handleUncaughtExceptions(Throwables.getRootCause(throwable)));

    // initialize the application data directory (if necessary)

    initAppDir(env.getRequiredProperty(APP_DATA_DIR_KEY));

    // load and apply any stored settings

    User user = injector.getInstance(User.class);
    AccountSettings accountSettings = injector.getInstance(AccountSettings.class);
    Persistence persistence = injector.getInstance(Persistence.class);
    persistence.init();//w  ww . ja va2 s .c o  m

    User persistedUser = (User) persistence.read(user);
    user.applyPersistedUser(persistedUser);

    accountSettings.applyPersistedAccountSettings(
            (AccountSettings) persistence.read(accountSettings.getClass().getName()));

    // load the main view and create the main scene

    ViewLoader viewLoader = injector.getInstance(ViewLoader.class);
    ViewLoader.Item loaded = viewLoader.load(Navigation.Item.MAIN.getFxmlUrl(), false);

    Scene scene = new Scene((Parent) loaded.view, 1000, 600);
    scene.getStylesheets().setAll("/io/bitsquare/gui/bitsquare.css", "/io/bitsquare/gui/images.css");

    // configure the system tray

    SystemTray systemTray = new SystemTray(primaryStage, this::stop);
    primaryStage.setOnCloseRequest(e -> stop());
    scene.setOnKeyReleased(keyEvent -> {
        // For now we exit when closing/quit the app.
        // Later we will only hide the window (systemTray.hideStage()) and use the exit item in the system tray for
        // shut down.
        if (new KeyCodeCombination(KeyCode.W, KeyCombination.SHORTCUT_DOWN).match(keyEvent)
                || new KeyCodeCombination(KeyCode.Q, KeyCombination.SHORTCUT_DOWN).match(keyEvent))
            stop();
    });

    // configure the primary stage

    primaryStage.setTitle(env.getRequiredProperty(APP_NAME_KEY));
    primaryStage.setScene(scene);
    primaryStage.setMinWidth(75);
    primaryStage.setMinHeight(50);

    // on windows the title icon is also used as task bar icon in a larger size
    // on Linux no title icon is supported but also a large task bar icon is derived form that title icon
    String iconPath;
    if (Utilities.isOSX())
        iconPath = ImageUtil.isRetina() ? "/images/window_icon@2x.png" : "/images/window_icon.png";
    else if (Utilities.isWindows())
        iconPath = "/images/task_bar_icon_windows.png";
    else
        iconPath = "/images/task_bar_icon_linux.png";

    if (iconPath != null)
        primaryStage.getIcons().add(new Image(getClass().getResourceAsStream(iconPath)));

    // make the UI visible

    primaryStage.show();
}

From source file:snpviewer.SnpViewer.java

private void fixStageSize(Stage stage, boolean fix) {
    /*provides a fix for annoying bug which means that 
     * setResizable(false) causing windows to grow in size in Windows
     *///from   w ww.  j a v a2 s. co m
    if (fix) {
        stage.setMaxHeight(stage.getHeight());
        stage.setMinHeight(stage.getHeight());
        stage.setMaxWidth(stage.getWidth());
        stage.setMinWidth(stage.getWidth());
    } else {
        Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
        stage.setMaxHeight(primaryScreenBounds.getHeight());
        stage.setMinHeight(300);
        stage.setMaxWidth(primaryScreenBounds.getWidth());
        stage.setMinWidth(500);
    }
}

From source file:com.bekwam.mavenpomupdater.Main.java

@Override
public void start(Stage primaryStage) throws Exception {

    ////w  w w  .  j  av  a  2 s  .co m
    // handle command line options
    //
    Application.Parameters params = getParameters();

    List<String> unnamedList = params.getUnnamed();

    Options options = new Options();
    options.addOption("help", false, "Print this message");
    options.addOption("hidpi", false, "Use high-DPI scaling");

    CommandLineParser p = new BasicParser();
    CommandLine cmd = p.parse(options, unnamedList.toArray(new String[0]));

    HelpFormatter formatter = new HelpFormatter();

    if (cmd.hasOption("help")) {
        if (log.isDebugEnabled()) {
            log.debug("[START] running as help command");
        }
        formatter.printHelp("Main", options);
        return;
    }

    AbstractModule module = null;
    if (runningAsJNLP()) {

        if (log.isInfoEnabled()) {
            log.info("using jnlp module and jnlp favorites store");
        }
        module = new MPUJNLPModule();
    } else {

        if (log.isInfoEnabled()) {
            log.info("using standalone module and in-memory favorites store");
        }
        module = new MPUStandaloneModule();
    }

    //
    // setup google guice
    //
    final Injector injector = Guice.createInjector(module);

    BuilderFactory builderFactory = new JavaFXBuilderFactory();

    Callback<Class<?>, Object> guiceControllerFactory = clazz -> injector.getInstance(clazz);

    //
    // setup icons
    //
    primaryStage.getIcons().add(new Image("images/mpu_icon_64.png"));

    //
    // load fxml and wire controllers
    //
    FXMLLoader mainViewLoader = new FXMLLoader(getClass().getResource("mavenpomupdater.fxml"), null,
            builderFactory, guiceControllerFactory);
    Parent mainView = mainViewLoader.load();
    MainViewController mainViewController = mainViewLoader.getController();

    FXMLLoader alertViewLoader = new FXMLLoader(getClass().getResource("alert.fxml"), null, builderFactory,
            guiceControllerFactory);
    Parent alertView = alertViewLoader.load();

    //
    // i'm continuing this manual wiring to 1) accommodate a potential
    // bi-directional reference problem and 2) to make sure that guice
    // doesn't return different object for the main -> alert and alert ->
    // main dependency injections
    //

    final AlertController alertController = alertViewLoader.getController();
    mainViewController.alertController = alertController;
    alertController.mainViewControllerRef = new WeakReference<MainViewController>(mainViewController);

    //
    // add FlowPane, StackPane objects (defined in program and outside of 
    // FXML)
    //
    final FlowPane fp = new FlowPane();
    fp.setAlignment(Pos.CENTER);
    fp.getChildren().add(alertView);
    fp.getStyleClass().add("alert-background-pane");

    final StackPane sp = new StackPane();
    sp.getChildren().add(fp); // initially hide the alert
    sp.getChildren().add(mainView);

    //
    // setup scene
    //
    Scene scene = new Scene(sp);
    scene.getStylesheets().add("com/bekwam/mavenpomupdater/mpu.css");

    scene.setOnKeyPressed(keyEvent -> {
        KeyCode key = keyEvent.getCode();
        if (key == KeyCode.ESCAPE && (sp.getChildren().get(1) == fp)) {
            if (log.isDebugEnabled()) {
                log.debug("[ESCAPE]");
            }
            alertController.action();
        }
    });

    //
    // setup stage
    //
    primaryStage.setTitle("Maven POM Version Updater");
    primaryStage.setScene(scene);

    if (cmd.hasOption("hidpi")) {

        if (log.isInfoEnabled()) {
            log.info("running in Hi-DPI display mode");
        }
        primaryStage.setWidth(2560.0);
        primaryStage.setHeight(1440.0);
        primaryStage.setMinWidth(1920.0);
        primaryStage.setMinHeight(1080.0);

        mainViewController.adjustForHiDPI();

    } else {
        if (log.isInfoEnabled()) {
            log.info("running in normal display mode");
        }

        primaryStage.setWidth(1280.0);
        primaryStage.setHeight(800.0);
        primaryStage.setMinWidth(1024.0);
        primaryStage.setMinHeight(768.0);

    }

    primaryStage.show();
}

From source file:editeurpanovisu.EditeurPanovisu.java

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                rafraichitListePano();

            }

        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    spVuePanoramique = new ScrollPane();

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

    stPrimaryStage.setScene(getScnPrincipale());

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

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

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

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

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

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