List of usage examples for javafx.scene.image ImageView setImage
public final void setImage(Image value)
From source file:uk.co.everywheremusic.viewcontroller.SetupScene.java
private void startSetupWindow(Stage primaryStage) { try {/* w ww.j a v a 2s . c o m*/ installFolder = new File(".").getCanonicalPath() + Globals.INSTALL_EXT; } catch (IOException ex) { Logger.getLogger(SetupScene.class.getName()).log(Level.SEVERE, null, ex); installFolder = System.getProperty("user.dir") + Globals.INSTALL_EXT; } primaryStage.setTitle(Globals.APP_NAME); grid = new GridPane(); grid.setAlignment(Pos.CENTER); grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(25, 25, 25, 25)); column1 = new ColumnConstraints(100, 100, Double.MAX_VALUE); column1.setHgrow(Priority.ALWAYS); column2 = new ColumnConstraints(100, 100, Double.MAX_VALUE); column2.setHgrow(Priority.ALWAYS); column3 = new ColumnConstraints(100, 100, Double.MAX_VALUE); column3.setHgrow(Priority.ALWAYS); column4 = new ColumnConstraints(100, 100, Double.MAX_VALUE); column4.setHgrow(Priority.ALWAYS); grid.getColumnConstraints().addAll(column1, column2, column3, column4); sceneTitle = new Label(Globals.SETUP_FRAME_TITLE); sceneTitle.setId(Globals.CSS_TITLE_ID); sceneTitle.setPrefWidth(Double.MAX_VALUE); sceneTitle.setAlignment(Pos.CENTER); ImageView imageView = null; try { imageView = new ImageView(); String img = new File(Globals.IC_LOGO).toURI().toURL().toString(); imgLogo = new Image(img); imageView.setImage(imgLogo); } catch (MalformedURLException ex) { Logger.getLogger(ServerScene.class.getName()).log(Level.SEVERE, null, ex); } GridPane titlePane = new GridPane(); ColumnConstraints c1 = new ColumnConstraints(50); ColumnConstraints c2 = new ColumnConstraints(400); titlePane.getColumnConstraints().addAll(c1, c2); titlePane.add(imageView, 0, 0); titlePane.add(sceneTitle, 1, 0); titlePane.setAlignment(Pos.CENTER); grid.add(titlePane, 0, 0, 4, 1); lblFolder = new Label(Globals.SETUP_LBL_MUSIC_FOLDER); grid.add(lblFolder, 0, 2, 3, 1); txtFolder = new TextField(); txtFolder.setText("/home/kyle/Music/Test music"); grid.add(txtFolder, 0, 3, 3, 1); btnFolder = new Button(Globals.SETUP_BTN_MUSIC_FOLDER); btnFolder.setPrefWidth(Double.MAX_VALUE); grid.add(btnFolder, 3, 3); final DirectoryChooser dirChooser = new DirectoryChooser(); btnFolder.setOnAction((ActionEvent event) -> { File dir = dirChooser.showDialog(primaryStage); if (dir != null) { txtFolder.setText(dir.getAbsolutePath()); } }); lblPassword = new Label("Choose a password:"); grid.add(lblPassword, 0, 4, 2, 1); lblConfirmPassword = new Label("Confirm your password:"); grid.add(lblConfirmPassword, 2, 4, 2, 1); txtPassword = new PasswordField(); grid.add(txtPassword, 0, 5, 2, 1); txtConfirmPassword = new PasswordField(); grid.add(txtConfirmPassword, 2, 5, 1, 1); textArea = new TextArea(); textArea.setPrefHeight(Double.MAX_VALUE); textArea.setDisable(true); textArea.setWrapText(true); grid.add(textArea, 0, 7, 4, 2); StackPane progressPane = new StackPane(); lblProgress = new Label(Globals.SETUP_LBL_PERCENT); lblProgress.setId(Globals.CSS_PROGBAR_LBL_ID); lblProgress.setVisible(false); progressBar = new ProgressBar(0); progressBar.setPrefWidth(Double.MAX_VALUE); progressBar.setVisible(false); progressPane.getChildren().addAll(progressBar, lblProgress); progressPane.setAlignment(Pos.CENTER_RIGHT); grid.add(progressPane, 0, 11, 3, 1); StackPane buttonPane = new StackPane(); btnInstall = new Button(Globals.SETUP_BTN_INSTALL); btnInstall.setPrefWidth(Double.MAX_VALUE); btnDone = new Button(Globals.SETUP_BTN_DONE); btnDone.setPrefWidth(Double.MAX_VALUE); btnDone.setVisible(false); buttonPane.getChildren().addAll(btnInstall, btnDone); grid.add(buttonPane, 3, 11); btnInstall.setOnAction((ActionEvent event) -> { boolean valid = validateForm(); if (valid) { lblFolder.setDisable(true); txtFolder.setDisable(true); btnFolder.setDisable(true); lblPassword.setDisable(true); txtPassword.setDisable(true); lblConfirmPassword.setDisable(true); txtConfirmPassword.setDisable(true); textArea.setDisable(false); lblProgress.setVisible(true); progressBar.setVisible(true); btnInstall.setDisable(true); musicFolder = txtFolder.getText(); password = txtPassword.getText(); setupWorker = createSetupWorker(); progressBar.progressProperty().unbind(); progressBar.progressProperty().bind(setupWorker.progressProperty()); setupWorker.messageProperty().addListener( (ObservableValue<? extends String> observable, String oldValue, String newValue) -> { String[] values = newValue.split("\\|"); lblProgress.setText(values[0] + "%"); textArea.appendText(values[1] + "\n"); if (values[1].equals(Globals.SETUP_MSG_DONE)) { btnInstall.setVisible(false); btnDone.setVisible(true); } }); new Thread(setupWorker).start(); } }); btnDone.setOnAction((ActionEvent event) -> { primaryStage.hide(); new ServerScene(installFolder, musicFolder).showWindow(new Stage()); }); try { String imgUrl = new File(Globals.IC_LOGO).toURI().toURL().toString(); javafx.scene.image.Image i = new javafx.scene.image.Image(imgUrl); primaryStage.getIcons().add(i); } catch (MalformedURLException ex) { Logger.getLogger(ServerScene.class.getName()).log(Level.SEVERE, null, ex); } scene = new Scene(grid, 600, 400); primaryStage.setScene(scene); scene.getStylesheets().add(SetupScene.class.getResource(Globals.CSS_FILE).toExternalForm()); // grid.setGridLinesVisible(true); primaryStage.show(); }
From source file:dpfmanager.shell.interfaces.gui.component.report.ReportsView.java
public void addFormatIcons() { colFormats.setCellFactory(/*from w w w. ja v a 2 s . co m*/ new Callback<TableColumn<ReportRow, ObservableMap<String, String>>, TableCell<ReportRow, ObservableMap<String, String>>>() { @Override public TableCell<ReportRow, ObservableMap<String, String>> call( TableColumn<ReportRow, ObservableMap<String, String>> param) { TableCell<ReportRow, ObservableMap<String, String>> cell = new TableCell<ReportRow, ObservableMap<String, String>>() { @Override public void updateItem(ObservableMap<String, String> item, boolean empty) { super.updateItem(item, empty); if (!empty && item != null) { HBox box = new HBox(); box.setSpacing(3); box.setAlignment(Pos.CENTER_LEFT); for (String i : item.keySet()) { ImageView icon = new ImageView(); icon.setId("but" + i); icon.setFitHeight(20); icon.setFitWidth(20); icon.setImage(new Image("images/formats/" + i + ".png")); icon.setCursor(Cursor.HAND); String type = i; String path = item.get(i); icon.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { ArrayMessage am = new ArrayMessage(); am.add(GuiConfig.PERSPECTIVE_SHOW, new UiMessage()); am.add(GuiConfig.PERSPECTIVE_SHOW + "." + GuiConfig.COMPONENT_SHOW, new ShowMessage(type, path)); getContext().send(GuiConfig.PERSPECTIVE_SHOW, am); } }); ContextMenu contextMenu = new ContextMenu(); javafx.scene.control.MenuItem download = new javafx.scene.control.MenuItem( "Download report"); contextMenu.getItems().add(download); icon.setOnContextMenuRequested(new EventHandler<ContextMenuEvent>() { public void handle(ContextMenuEvent e) { contextMenu.show(icon, e.getScreenX(), e.getScreenY()); } }); box.getChildren().add(icon); } setGraphic(box); } else { setGraphic(null); } } }; return cell; } }); }
From source file:Main.java
@Override public void start(Stage stage) throws Exception { ImageView imageView = new ImageView(); ScrollPane scrollPane = new ScrollPane(); DoubleProperty zoomProperty = new SimpleDoubleProperty(200); zoomProperty.addListener(new InvalidationListener() { @Override/* w w w .j a va2 s. c o m*/ public void invalidated(Observable arg0) { imageView.setFitWidth(zoomProperty.get() * 2); imageView.setFitHeight(zoomProperty.get() * 3); } }); scrollPane.addEventFilter(ScrollEvent.ANY, new EventHandler<ScrollEvent>() { @Override public void handle(ScrollEvent event) { if (event.getDeltaY() > 0) { zoomProperty.set(zoomProperty.get() * 1.2); } else if (event.getDeltaY() < 0) { zoomProperty.set(zoomProperty.get() / 1.1); } } }); imageView.setImage(new Image("http://yourImageURL")); imageView.preserveRatioProperty().set(true); scrollPane.setContent(imageView); stage.setScene(new Scene(scrollPane, 400, 300)); stage.show(); }
From source file:calendarioSeries.vistas.MainViewController.java
public void populateImagenes() { Platform.runLater(new Runnable() { @Override//from w ww .ja va 2 s . c om public void run() { imagenes.getChildren().clear(); for (Serie serie : series) { //System.out.println(serie.getLastVisto()); try { Image image = new Image(serie.getUrlImagen()); ImageView poster = new ImageView(); ContextMenu menu = new ContextMenu(); //String css = MainApp.class.getResource("resources/MainTheme.css").toExternalForm(); MenuItem delete = new MenuItem("Eliminar"); delete.setId(serie.getId()); delete.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { menu.hide(); MenuItem clicked = (MenuItem) event.getSource(); String toDelete = clicked.getId(); for (Serie serie : series) { if (serie.getId().equals(toDelete)) { series.remove(serie); populateImagenes(); showDetallesMes(mesActual); } } event.consume(); } }); menu.getItems().add(delete); poster.setId(serie.getTitulo()); poster.setImage(image); poster.setCache(true); // poster.setPreserveRatio(true); poster.setFitWidth(210); poster.setFitHeight(300); poster.setOnContextMenuRequested(new EventHandler<ContextMenuEvent>() { @Override public void handle(ContextMenuEvent event) { menu.show(poster, event.getScreenX(), event.getScreenY()); //menu.getScene().getRoot().getStylesheets().add(css); event.consume(); } }); poster.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { if (event.getButton() == MouseButton.PRIMARY) { try { //serieToPass = serie; sceneToPass = mainApp.scene; FXMLLoader loader = new FXMLLoader( getClass().getResource("DetailsSerieController.fxml")); Parent root = loader.load(); DetailsSerieController controller = loader.getController(); controller.setData(serie, series); controller.setMainApp(mainApp); Scene scene = new Scene(root); mainApp.primaryStage.setScene(scene); mainApp.primaryStage.show(); } catch (IOException ex) { ex.printStackTrace(); } } } }); imagenes.getChildren().add(poster); } catch (IllegalArgumentException e) { Image image = new Image("file:src/calendarioSeries/resources/no-image.png"); ImageView poster = new ImageView(); ContextMenu menu = new ContextMenu(); MenuItem delete = new MenuItem("Eliminar"); delete.setId(serie.getId()); delete.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { menu.hide(); MenuItem clicked = (MenuItem) event.getSource(); String toDelete = clicked.getId(); for (Serie serie : series) { if (serie.getId().equals(toDelete)) { series.remove(serie); populateImagenes(); showDetallesMes(mesActual); } } event.consume(); } }); menu.getItems().add(delete); poster.setId(serie.getTitulo()); poster.setImage(image); poster.setCache(true); //poster.setPreserveRatio(true); poster.setFitWidth(210); poster.setFitHeight(300); poster.setOnContextMenuRequested(new EventHandler<ContextMenuEvent>() { @Override public void handle(ContextMenuEvent event) { menu.show(poster, event.getScreenX(), event.getScreenY()); event.consume(); } }); Text text = new Text(serie.getTitulo()); text.getStyleClass().add("label"); StackPane pane = new StackPane(); pane.getChildren().addAll(poster, text); imagenes.getChildren().add(pane); } finally { rellenarArchivo(); } } } }); }
From source file:com.github.vatbub.tictactoe.view.Main.java
private void reloadImage(ImageView imageView, String imageURL, double newWidth, double newHeight) { if (loadTimerMap.get(imageURL) != null) { loadTimerMap.get(imageURL).cancel(); }/*from w ww . j av a2 s .co m*/ Timer loadTimer = new Timer(); loadTimerMap.put(imageURL, loadTimer); loadTimer.schedule(new TimerTask() { @Override public void run() { Image image = new Image(imageURL, newWidth, newHeight, false, true); Platform.runLater(() -> imageView.setImage(image)); } }, 300); }
From source file:ui.main.MainViewController.java
private void paintConversationMessage(Message msg) { //this method draws the recievied text message Task<HBox> recievedMessages = new Task<HBox>() { @Override//from ww w . j a va 2 s.co m protected HBox call() throws Exception { VBox vbox = new VBox(); //to add text String user = msg.getFrom(); user = user.substring(user.indexOf("/") + 1, user.length()); ImageView imageView = new ImageView(); //image imageView.setFitHeight(60); imageView.setFitWidth(50); VCard vcard = new VCard(); try { vcard.load(ConnectionManager.getConnectionManager().getXMPPConnection(), user.concat(AppData.serviceNameAt)); if (vcard.getAvatar() != null) { BufferedImage img = ImageIO.read(new ByteArrayInputStream(vcard.getAvatar())); Image image = SwingFXUtils.toFXImage(img, null); imageView.setImage(image); } else { Image defaultAvatar = new Image("resources/defaultAvatar.png", 50, 60, true, true); imageView.setImage(defaultAvatar); } } catch (XMPPException e) { Image defaultAvatar = new Image("resources/defaultAvatar.png", 50, 60, true, true); imageView.setImage(defaultAvatar); System.out.println(e); } Label chatterName = new Label(user); chatterName.setDisable(true); //chat message BubbledLabel bbl = new BubbledLabel(); bbl.setText(msg.getBody()); bbl.setBackground(new Background(new BackgroundFill(Color.GAINSBORO, null, null))); vbox.getChildren().addAll(chatterName, bbl); vbox.setAlignment(Pos.CENTER_RIGHT); HBox hbox = new HBox(); bbl.setBubbleSpec(BubbleSpec.FACE_LEFT_CENTER); hbox.getChildren().addAll(imageView, vbox); return hbox; } }; recievedMessages.setOnSucceeded(event -> { chatList.getChildren().add(recievedMessages.getValue()); }); Thread t = new Thread(recievedMessages); //t.setDaemon(true); t.start(); try { t.join(); } catch (InterruptedException ex) { Logger.getLogger(MainViewController.class.getName()).log(Level.SEVERE, null, ex); } Task t1 = new Task() { @Override protected Object call() throws Exception { Thread.sleep(500); return new Object(); } }; t1.setOnSucceeded(value -> scrollPane.setVvalue(scrollPane.getHmax())); Thread thread1 = new Thread(t1); thread1.start(); }
From source file:net.rptools.tokentool.util.ImageUtil.java
private static ImageView getImage(ImageView thumbView, final Path filePath, final boolean overlayWanted, final int THUMB_SIZE) throws IOException { Image thumb = null;//from w ww. j a va 2s .c om String fileURL = filePath.toUri().toURL().toString(); if (ImageUtil.SUPPORTED_IMAGE_FILE_FILTER.accept(null, fileURL)) { if (THUMB_SIZE <= 0) thumb = processMagenta(new Image(fileURL), COLOR_THRESHOLD, overlayWanted); else thumb = processMagenta(new Image(fileURL, THUMB_SIZE, THUMB_SIZE, true, true), COLOR_THRESHOLD, overlayWanted); } else if (ImageUtil.PSD_FILE_FILTER.accept(null, fileURL)) { ImageInputStream is = null; PSDImageReader reader = null; int imageIndex = 1; // Mask layer should always be layer 1 and overlay image on layer 2. Note, layer 0 will be a combined layer composite if (overlayWanted) imageIndex = 2; File file = filePath.toFile(); try { is = ImageIO.createImageInputStream(file); if (is == null || is.length() == 0) { log.info("Image from file " + file.getAbsolutePath() + " is null"); } Iterator<ImageReader> iterator = ImageIO.getImageReaders(is); if (iterator == null || !iterator.hasNext()) { throw new IOException("Image file format not supported by ImageIO: " + filePath); } reader = (PSDImageReader) iterator.next(); reader.setInput(is); BufferedImage thumbBI; thumbBI = reader.read(imageIndex); if (thumbBI != null) { int layerIndex = 0; if (overlayWanted) layerIndex = 1; IIOMetadata metadata = reader.getImageMetadata(0); IIOMetadataNode root = (IIOMetadataNode) metadata .getAsTree(PSDMetadata.NATIVE_METADATA_FORMAT_NAME); NodeList layerInfos = root.getElementsByTagName("LayerInfo"); // Layer index corresponds to imageIndex - 1 in the reader IIOMetadataNode layerInfo = (IIOMetadataNode) layerInfos.item(layerIndex); // Get the width & height of the Mask layer so we can create the overlay the same size int width = reader.getWidth(0); int height = reader.getHeight(0); // Get layer offsets, PhotoShop PSD layers can have different widths/heights and all images start at 0,0 with a layer offset applied int x = Math.max(Integer.parseInt(layerInfo.getAttribute("left")), 0); int y = Math.max(Integer.parseInt(layerInfo.getAttribute("top")), 0); // Lets pad the overlay with transparency to make it the same size as the PSD canvas size thumb = resizeCanvas(SwingFXUtils.toFXImage(thumbBI, null), width, height, x, y); // Finally set ImageView to thumbnail size if (THUMB_SIZE > 0) { thumbView.setFitWidth(THUMB_SIZE); thumbView.setPreserveRatio(true); } } } catch (Exception e) { log.error("Processing: " + file.getAbsolutePath(), e); } finally { // Dispose reader in finally block to avoid memory leaks reader.dispose(); is.close(); } } thumbView.setImage(thumb); return thumbView; }
From source file:editeurpanovisu.EditeurPanovisu.java
/** * +/*w ww . ja va2 s. co m*/ * * @param iNumPanochoisi */ @SuppressWarnings("empty-statement") public static void affichePanoChoisit(int iNumPanochoisi) { ivImagePanoramique.setImage(getPanoramiquesProjet()[iNumPanochoisi].getImgPanoramique()); Node nodeLegende = (Node) apPanneauPrincipal.lookup("#legende"); nodeLegende.setVisible(true); retireAffichagePointsHotSpots(); retireAffichageHotSpots(); retireAffichageLigne(); setiPanoActuel(iNumPanochoisi); if (getPanoramiquesProjet()[iNumPanochoisi].getStrTypePanoramique().equals(Panoramique.CUBE)) { ivLoupe.setImage(getPanoramiquesProjet()[iNumPanochoisi].getImgCubeEqui()); } else { String strFicImage = getStrRepertPanos() + File.separator + "panovisu" + iNumPanochoisi + ".jpg"; ivLoupe.setImage(new Image("file:" + strFicImage)); ivLoupe.setSmooth(true); ivLoupe.setPreserveRatio(true); ivLoupe.setFitWidth(8000); } ivLoupe.setClip(new Circle(4000, 2000, getiTailleLoupe() / 2)); ivLoupe.setLayoutX(-4000 + getiTailleLoupe() / 2 + 10); ivLoupe.setLayoutY(-2000 + getiTailleLoupe() / 2 + 10); apLoupe.setPrefSize(getiTailleLoupe() + 20, getiTailleLoupe() + 20); apLoupe.setMinSize(getiTailleLoupe() + 20, getiTailleLoupe() + 20); apLoupe.setMaxSize(getiTailleLoupe() + 20, getiTailleLoupe() + 20); //apLoupe.setStyle("-fx-border-width : 2px;-fx-background-color : blue;-fx-border-color :darkblue;"); creeLoupe(); panePanoramique.setOnMouseEntered((me) -> { if (isAfficheLoupe()) { apLoupe.setVisible(true); } }); panePanoramique.setOnMouseExited((me) -> { apLoupe.setVisible(false); }); setiNumPoints(0); if (navigateurPanoramique == null) { Rectangle2D tailleEcran = Screen.getPrimary().getBounds(); int iHauteur; if (isMac()) { iHauteur = (int) tailleEcran.getHeight() - 230; } else { iHauteur = (int) tailleEcran.getHeight() - 170; } int iLargeur = (int) tailleEcran.getWidth() - 20; apVisuPanoramique.getChildren().clear(); Pane paneFond = new Pane(); paneFond.setPrefSize(24, 24); Image imgExpand = new Image("file:" + getStrRepertAppli() + "/images/expand.png", 32, 24, false, true); Image imgShrink = new Image("file:" + getStrRepertAppli() + "/images/shrink.png", 32, 24, false, true); ImageView ivExpShrk = new ImageView(imgExpand); paneFond.setLayoutX(10); paneFond.setLayoutY(10); paneFond.getChildren().add(ivExpShrk); navigateurPanoramique = new NavigateurPanoramique( getPanoramiquesProjet()[iNumPanochoisi].getImgVisuPanoramique(), 10.d, 10.d, 340, 170); apVisuPano = navigateurPanoramique.affichePano(); navigateurPanoramique.addPropertyChangeListener("positNord", (e) -> { double longitude = Math.round(Double.parseDouble(e.getNewValue().toString()) * 10) / 10.d - 180; longitude = longitude % 360; longitude = longitude < 0 ? longitude + 360 : longitude; longitude = longitude > 180 ? longitude - 360 : longitude; getPanoramiquesProjet()[getiPanoActuel()].setZeroNord(longitude); afficheNord(longitude); }); navigateurPanoramique.addPropertyChangeListener("choixLatitude", (e) -> { double latitude = Math.round(navigateurPanoramique.getChoixLatitude() * 10) / 10.d; double longitude = Math.round(navigateurPanoramique.getChoixLongitude() * 10) / 10.d - 180; double fov = Math.round(navigateurPanoramique.getChoixFov() * 10) / 10.d; longitude = longitude % 360; longitude = longitude < 0 ? longitude + 360 : longitude; longitude = longitude > 180 ? longitude - 360 : longitude; getPanoramiquesProjet()[getiPanoActuel()].setRegardX(longitude); getPanoramiquesProjet()[getiPanoActuel()].setRegardY(latitude); getPanoramiquesProjet()[getiPanoActuel()].setChampVisuel(fov); affichePoV(longitude, latitude, fov); }); navigateurPanoramique.addPropertyChangeListener("choixLongitude", (e) -> { double latitude = Math.round(navigateurPanoramique.getChoixLatitude() * 10) / 10.d; double longitude = Math.round(navigateurPanoramique.getChoixLongitude() * 10) / 10.d - 180; double fov = Math.round(navigateurPanoramique.getChoixFov() * 10) / 10.d; longitude = longitude % 360; longitude = longitude < 0 ? longitude + 360 : longitude; longitude = longitude > 180 ? longitude - 360 : longitude; getPanoramiquesProjet()[getiPanoActuel()].setRegardX(longitude); getPanoramiquesProjet()[getiPanoActuel()].setRegardY(latitude); getPanoramiquesProjet()[getiPanoActuel()].setChampVisuel(fov); affichePoV(longitude, latitude, fov); }); navigateurPanoramique.addPropertyChangeListener("choixFov", (e) -> { double latitude = Math.round(navigateurPanoramique.getChoixLatitude() * 10) / 10.d; double longitude = Math.round(navigateurPanoramique.getChoixLongitude() * 10) / 10.d - 180; double fov = Math.round(navigateurPanoramique.getChoixFov() * 10) / 10.d; longitude = longitude % 360; longitude = longitude < 0 ? longitude + 360 : longitude; longitude = longitude > 180 ? longitude - 360 : longitude; getPanoramiquesProjet()[getiPanoActuel()].setRegardX(longitude); getPanoramiquesProjet()[getiPanoActuel()].setRegardY(latitude); getPanoramiquesProjet()[getiPanoActuel()].setChampVisuel(fov); affichePoV(longitude, latitude, fov); }); navigateurPanoramique.setPositNord(getPanoramiquesProjet()[iNumPanochoisi].getZeroNord() - 180); navigateurPanoramique.setLongitude(getPanoramiquesProjet()[iNumPanochoisi].getRegardX() - 180); navigateurPanoramique.setLatitude(getPanoramiquesProjet()[iNumPanochoisi].getRegardY()); navigateurPanoramique.setFov(getPanoramiquesProjet()[iNumPanochoisi].getChampVisuel()); navigateurPanoramique.setChoixLatitude(navigateurPanoramique.getLatitude()); navigateurPanoramique.setChoixLongitude(navigateurPanoramique.getLongitude()); navigateurPanoramique.setChoixFov(navigateurPanoramique.getFov()); apVisuPano.getChildren().add(paneFond); apVisuPanoramique.getChildren().addAll(apVisuPano); paneFond.setOnMouseClicked((ev) -> { if (bPleinEcranPanoramique) { navigateurPanoramique.changeTaille(340, 200); apVisuPano.getChildren().add(paneFond); ivExpShrk.setImage(imgExpand); apEnvironnement.getChildren().remove(apVisuPano); apVisuPanoramique.getChildren().add(apVisuPano); bPleinEcranPanoramique = false; mbarPrincipal.setDisable(false); bbarPrincipal.setDisable(false); hbBarreBouton.setDisable(false); tpEnvironnement.setDisable(false); } else { bPleinEcranPanoramique = true; navigateurPanoramique.changeTaille(iLargeur, iHauteur); ivExpShrk.setImage(imgShrink); apVisuPano.getChildren().add(paneFond); apVisuPanoramique.getChildren().remove(apVisuPano); apEnvironnement.getChildren().add(apVisuPano); mbarPrincipal.setDisable(true); bbarPrincipal.setDisable(true); hbBarreBouton.setDisable(true); tpEnvironnement.setDisable(true); } }); navigateurPanoramique.affiche(); } else { navigateurPanoramique.setImagePanoramique(getPanoramiquesProjet()[iNumPanochoisi].getStrNomFichier(), getPanoramiquesProjet()[iNumPanochoisi].getImgVisuPanoramique()); navigateurPanoramique.setPositNord(getPanoramiquesProjet()[iNumPanochoisi].getZeroNord() - 180); navigateurPanoramique.setLongitude(getPanoramiquesProjet()[iNumPanochoisi].getRegardX() - 180); navigateurPanoramique.setLatitude(getPanoramiquesProjet()[iNumPanochoisi].getRegardY()); navigateurPanoramique.setFov(getPanoramiquesProjet()[iNumPanochoisi].getChampVisuel()); navigateurPanoramique.affiche(); } if (getPanoramiquesProjet()[iNumPanochoisi].getMarqueurGeolocatisation() != null) { tfLatitude.setText(CoordonneesGeographiques .toDMS(getPanoramiquesProjet()[iNumPanochoisi].getMarqueurGeolocatisation().getLatitude())); tfLongitude.setText(CoordonneesGeographiques .toDMS(getPanoramiquesProjet()[iNumPanochoisi].getMarqueurGeolocatisation().getLongitude())); getPoGeolocalisation().setbValide(true); } else { if (isbInternet()) { tfLatitude.setText(""); tfLongitude.setText(""); getPoGeolocalisation().setbValide(false); } } ajouteAffichagePointsHotspots(); ajouteAffichagePointsHotspotsImage(); ajouteAffichagePointsHotspotsHTML(); ajouteAffichagePointsHotspotsDiapo(); ajouteAffichageHotspots(); affichePoV(getPanoramiquesProjet()[iNumPanochoisi].getRegardX(), getPanoramiquesProjet()[iNumPanochoisi].getRegardY(), getPanoramiquesProjet()[iNumPanochoisi].getChampVisuel()); afficheNord(getPanoramiquesProjet()[iNumPanochoisi].getZeroNord()); ajouteAffichageLignes(); afficheInfoPano(); cbListeChoixPanoramique.setValue(cbListeChoixPanoramique.getItems().get(getiPanoActuel())); int iPano = -1; int ii = 0; for (String stNumPano : ordPano.getStrPanos()) { if (Integer.parseInt(stNumPano) == iNumPanochoisi) { iPano = ii; } ii++; } rectVignettePano.setLayoutY((iLargeurVignettes / 2 + 10) * iPano + 10); rectVignettePano.setVisible(true); cbMinLat.setSelected(getPanoramiquesProjet()[iNumPanochoisi].isbMinLat()); cbMaxLat.setSelected(getPanoramiquesProjet()[iNumPanochoisi].isbMaxLat()); if (cbMinLat.isSelected()) { slMinLat.setValue(getPanoramiquesProjet()[iNumPanochoisi].getMinLat()); } else { slMinLat.setValue(-90); } if (cbMaxLat.isSelected()) { slMaxLat.setValue(getPanoramiquesProjet()[iNumPanochoisi].getMaxLat()); } else { slMaxLat.setValue(90); } slMinFov.setValue(getPanoramiquesProjet()[iNumPanochoisi].getFovMin()); slMaxFov.setValue(getPanoramiquesProjet()[iNumPanochoisi].getFovMax()); navigateurPanoramique.setMaxFov(getPanoramiquesProjet()[iNumPanochoisi].getFovMax()); navigateurPanoramique.setMinFov(getPanoramiquesProjet()[iNumPanochoisi].getFovMin()); 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); Y1 = (90.0d - (double) (double) slMaxLat.getValue()) * largeurImage1 / 360.0d; ligZenith.setStartX(X11); ligZenith.setStartY(Y1); ligZenith.setEndX(X11 + largeurImage1); ligZenith.setEndY(Y1); panePanoramique.getChildren().remove(ligNadir); panePanoramique.getChildren().remove(ligZenith); panePanoramique.getChildren().addAll(ligNadir, ligZenith); }