List of usage examples for javafx.scene.control Label Label
public Label(String text)
From source file:ui.main.MainViewController.java
private synchronized void paintReceivedFile(Chat chat, String path, String time) { //this method paints the recieved picture message Task<HBox> recievedMessages = new Task<HBox>() { @Override/*from ww w .j a va2s .c o m*/ protected HBox call() throws Exception { Thread.sleep(100); VBox vbox = new VBox(); //to add text ImageView imageRec = new ImageView(chatterAvatar.getImage()); //image imageRec.setFitHeight(60); imageRec.setFitWidth(50); String strChatterName = chat.getParticipant(); //add name of the chatter with light color strChatterName = Character.toUpperCase(strChatterName.charAt(0)) + strChatterName.substring(1, strChatterName.indexOf("@")); Label chatterName = new Label(strChatterName); chatterName.setDisable(true); Label timeL = new Label(time); timeL.setDisable(true); timeL.setFont(new Font("Arial", 10)); Hyperlink link = new Hyperlink("File Recieved: " + path); link.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<javafx.scene.input.MouseEvent>() { @Override public void handle(javafx.scene.input.MouseEvent event) { try { if (event.getButton() == MouseButton.PRIMARY) { Runtime.getRuntime().exec("explorer.exe /select," + path); } } catch (IOException ex) { Logger.getLogger(MainViewController.class.getName()).log(Level.SEVERE, null, ex); } } }); vbox.getChildren().addAll(chatterName, link, timeL); vbox.setAlignment(Pos.CENTER_RIGHT); HBox hbox = new HBox(); //bbl.setBubbleSpec(BubbleSpec.FACE_LEFT_CENTER); hbox.getChildren().addAll(imageRec, vbox); return hbox; } }; recievedMessages.setOnSucceeded(event -> { chatList.getChildren().add(recievedMessages.getValue()); }); if (chat.getParticipant().contains(currentChat.getParticipant())) { 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); } } //set the received chat message appear on the screen if (chat.getParticipant().contains(currentChat.getParticipant())) { Thread t = new Thread(recievedMessages); t.start(); } Task t = new Task() { @Override protected Object call() throws Exception { Thread.sleep(2500); return new Object(); } }; t.setOnSucceeded(value -> scrollPane.setVvalue(scrollPane.getHmax())); Thread thread1 = new Thread(t); thread1.start(); }
From source file:ui.main.MainViewController.java
private synchronized void paintSentPhoto(Chat chat, File file, String time) { //this method paints the recieved picture message Task<HBox> recievedMessages = new Task<HBox>() { @Override/*from w w w .ja v a 2s . co m*/ protected HBox call() throws Exception { // Thread.sleep(100); VBox vbox = new VBox(); //to add text ImageView imageRec = new ImageView(myAvatar.getImage()); //image imageRec.setFitHeight(60); imageRec.setFitWidth(50); Label chatterName = new Label(name.getText()); chatterName.setDisable(true); Label timeL = new Label(time); timeL.setDisable(true); timeL.setFont(new Font("Arial", 10)); try { Image recievedImage = SwingFXUtils.toFXImage(ImageIO.read(file), null); ImageView receivedImageView = new ImageView(recievedImage); receivedImageView.setFitHeight(300); receivedImageView.setFitWidth(300); receivedImageView.setPreserveRatio(true); receivedImageView.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { if (event.getButton() == MouseButton.PRIMARY) { Desktop dt = Desktop.getDesktop(); try { dt.open(file); } catch (IOException ex) { Logger.getLogger(MainViewController.class.getName()).log(Level.SEVERE, null, ex); } } } }); receivedImageView.setOnMouseEntered(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { chatList.getScene().setCursor(Cursor.HAND); } }); receivedImageView.setOnMouseExited(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { chatList.getScene().setCursor(Cursor.DEFAULT); } }); vbox.getChildren().addAll(chatterName, receivedImageView, timeL); } catch (IOException e) { e.printStackTrace(); } vbox.setAlignment(Pos.CENTER_LEFT); HBox hbox = new HBox(); hbox.setAlignment(Pos.CENTER_RIGHT); //bbl.setBubbleSpec(BubbleSpec.FACE_LEFT_CENTER); hbox.getChildren().addAll(vbox, imageRec); return hbox; } }; recievedMessages.setOnSucceeded(event -> { chatList.getChildren().add(recievedMessages.getValue()); }); if (chat.getParticipant().contains(currentChat.getParticipant())) { Thread t = new Thread(recievedMessages); t.start(); try { t.join(); } catch (InterruptedException ex) { Logger.getLogger(MainViewController.class.getName()).log(Level.SEVERE, null, ex); } } }
From source file:com.bekwam.resignator.ResignatorAppMainViewController.java
@FXML public void openJarsignerConfig() { clearValidationErrors();//w w w . jav a 2 s. c o m if (StringUtils.isNotEmpty(activeConfiguration.getJDKHome())) { JarsignerConfigController jarsignerConfigView = jarsignerConfigControllerProvider.get(); jarsignerConfigView.setParent(this); try { jarsignerConfigView.show(); } catch (Exception exc) { String msg = "Error launching jarsigner config"; logger.error(msg, exc); Alert alert = new Alert(Alert.AlertType.ERROR, msg); alert.showAndWait(); } } else { if (logger.isDebugEnabled()) { logger.debug("[OPEN JARSIGNER CONFIG] JDK_HOME not set"); } Alert alert = new Alert(Alert.AlertType.ERROR, "Set JDK_HOME in File > Settings"); alert.setHeaderText("JDK_HOME not defined"); FlowPane fp = new FlowPane(); Label lbl = new Label("Set JDK_HOME in "); Hyperlink link = new Hyperlink("File > Settings"); fp.getChildren().addAll(lbl, link); link.setOnAction((evt) -> { alert.close(); openSettings(); }); alert.getDialogPane().contentProperty().set(fp); alert.showAndWait(); } }
From source file:ui.main.MainViewController.java
private synchronized void paintSendMessage(String msg, String time) { Task<HBox> recievedMessages = new Task<HBox>() { @Override//from ww w. jav a2 s . c o m protected HBox call() throws Exception { VBox vbox = new VBox(); //to add text ImageView imageRec = new ImageView(myAvatar.getImage()); imageRec.setFitHeight(60); imageRec.setFitWidth(50); Label myName = new Label(name.getText()); myName.setDisable(true); Label timeL = new Label(time); timeL.setDisable(true); timeL.setFont(new Font("Arial", 10)); BubbledLabel bbl = new BubbledLabel(); bbl.setText(msg); bbl.setBackground(new Background(new BackgroundFill(Color.LIGHTBLUE, null, null))); HBox hbox = new HBox(); hbox.setAlignment(Pos.TOP_RIGHT); bbl.setBubbleSpec(BubbleSpec.FACE_RIGHT_CENTER); vbox.getChildren().addAll(myName, bbl, timeL); hbox.getChildren().addAll(vbox, imageRec); 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); } }
From source file:ui.main.MainViewController.java
private synchronized void paintSentFile(Chat chat, String path, String time) { //this method paints the recieved picture message Task<HBox> recievedMessages = new Task<HBox>() { @Override/*from w ww. j ava2 s. co m*/ protected HBox call() throws Exception { Thread.sleep(100); VBox vbox = new VBox(); //to add text ImageView imageRec = new ImageView(myAvatar.getImage()); //image imageRec.setFitHeight(60); imageRec.setFitWidth(50); Label timeL = new Label(time); timeL.setDisable(true); timeL.setFont(new Font("Arial", 10)); Label chatterName = new Label(name.getText()); chatterName.setDisable(true); Hyperlink link = new Hyperlink("File Sent: " + path); link.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<javafx.scene.input.MouseEvent>() { @Override public void handle(javafx.scene.input.MouseEvent event) { try { if (event.getButton() == MouseButton.PRIMARY) { Runtime.getRuntime().exec("explorer.exe /select," + path); } } catch (IOException ex) { Logger.getLogger(MainViewController.class.getName()).log(Level.SEVERE, null, ex); } } }); vbox.getChildren().addAll(chatterName, link, timeL); vbox.setAlignment(Pos.CENTER_LEFT); HBox hbox = new HBox(); hbox.setAlignment(Pos.CENTER_RIGHT); //bbl.setBubbleSpec(BubbleSpec.FACE_LEFT_CENTER); hbox.getChildren().addAll(vbox, imageRec); return hbox; } }; recievedMessages.setOnSucceeded(event -> { chatList.getChildren().add(recievedMessages.getValue()); }); if (chat.getParticipant().contains(currentChat.getParticipant())) { Thread t = new Thread(recievedMessages); t.start(); try { t.join(); } catch (InterruptedException ex) { Logger.getLogger(MainViewController.class.getName()).log(Level.SEVERE, null, ex); } } }
From source file:snpviewer.SnpViewer.java
public void refreshView(String chrom, boolean forceRedraw) { //if forceRedraw is false look for existing png files for each snpFile if (chrom == null) { /*if null is passed then select/reselect chromosome from * chromosomeSelector, return and let chromosomeSelector's * listener refire this method//from ww w . j a v a 2 s . c om */ if (chromosomeSelector.getSelectionModel().isEmpty()) { chromosomeSelector.getSelectionModel().selectFirst(); } else { int sel = chromosomeSelector.getSelectionModel().getSelectedIndex(); chromosomeSelector.getSelectionModel().clearSelection(); chromosomeSelector.getSelectionModel().select(sel); } return; } int totalFiles = affFiles.size() + unFiles.size(); if (totalFiles < 1) { return; } ArrayList<Pane> panesToAdd = new ArrayList<>(); ArrayList<ScrollPane> labelsToAdd = new ArrayList<>(); clearSplitPanes(); setProgressMode(true); nextChromMenu.setDisable(false); nextChromMenu.setDisable(false); for (final SnpFile f : affFiles) { Pane sPane = new Pane(); sPane.setMinHeight(chromSplitPane.getHeight() / totalFiles); sPane.setMinWidth(chromSplitPane.getWidth()); sPane.setVisible(true); panesToAdd.add(sPane); ScrollPane labelPane = new ScrollPane(); Label fileLabel = new Label(f.inputFile.getName() + "\n(Affected)"); fileLabel.setTextFill(Color.WHITE); labelPane.setMinHeight(labelSplitPane.getHeight() / totalFiles); labelPane.setPrefWidth(labelSplitPane.getWidth()); labelPane.minHeightProperty().bind(labelSplitPane.heightProperty().divide(totalFiles)); VBox vbox = new VBox(); vbox.setSpacing(10); vbox.getChildren().add(fileLabel); final TextField textField = new TextField(); textField.setStyle("-fx-text-fill: white; -fx-background-color: " + "rgba(90%,90%,90%,0.3); -fx-border-color:white"); textField.setPromptText("Sample Name"); if (f.getSampleName() != null) { textField.setText(f.getSampleName()); } textField.setFocusTraversable(true); textField.setOnKeyPressed(new EventHandler<KeyEvent>() { @Override public void handle(KeyEvent ke) { if (ke.getCode().equals(KeyCode.ENTER)) { if (!textField.getText().isEmpty()) { String name = textField.getText().trim(); if (name.length() > 0) { f.setSampleName(name); } textField.getParent().requestFocus(); saveProject(); } } } }); textField.focusedProperty().addListener(new ChangeListener<Boolean>() { @Override public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) { if (!textField.isFocused()) { if (!textField.getText().isEmpty()) { String name = textField.getText().trim(); if (name.length() > 0) { f.setSampleName(name); } saveProject(); } } } }); vbox.getChildren().add(textField); Label noCalls = new Label(); if (f.getPercentNoCall() != null) { noCalls.setText("No Calls: " + DecimalFormat.getInstance().format(f.getPercentNoCall()) + " %"); } else { noCalls.setText("No Calls: none"); } Label meanQual = new Label(); if (f.getMeanQuality() != null) { meanQual.setText("Av. Call Conf: " + DecimalFormat.getInstance().format(100 - (f.getMeanQuality() * 100)) + " %"); } else { meanQual.setText("No Call Confidence Data"); } vbox.getChildren().add(noCalls); vbox.getChildren().add(meanQual); labelPane.setContent(vbox); // labelPane.getChildren().add(fileLabel); // labelPane.getChildren().add(new TextField()); labelsToAdd.add(labelPane); } for (final SnpFile f : unFiles) { Pane sPane = new Pane(); sPane.setMinHeight(chromSplitPane.getHeight() / totalFiles); sPane.setMinWidth(chromSplitPane.getWidth()); sPane.setVisible(true); panesToAdd.add(sPane); ScrollPane labelPane = new ScrollPane(); Label fileLabel = new Label(f.inputFile.getName() + "\n(Unaffected)"); fileLabel.setStyle("-fx-text-fill: black"); labelPane.setMinHeight(labelSplitPane.getHeight() / totalFiles); labelPane.setPrefWidth(labelSplitPane.getWidth()); labelPane.minHeightProperty().bind(labelSplitPane.heightProperty().divide(totalFiles)); VBox vbox = new VBox(); vbox.setSpacing(10); vbox.getChildren().add(fileLabel); final TextField textField = new TextField(); textField.setStyle("-fx-text-fill: black; " + "-fx-background-color: rgba(90%,90%,90%,0.3);" + " -fx-border-color:white"); textField.setPromptText("Sample Name"); if (f.getSampleName() != null) { textField.setText(f.getSampleName()); } textField.setFocusTraversable(true); textField.setOnKeyPressed(new EventHandler<KeyEvent>() { @Override public void handle(KeyEvent ke) { if (ke.getCode().equals(KeyCode.ENTER)) { if (!textField.getText().isEmpty()) { f.setSampleName(textField.getText()); textField.getParent().requestFocus(); saveProject(); } } } }); textField.focusedProperty().addListener(new ChangeListener<Boolean>() { @Override public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) { if (!textField.isFocused()) { if (!textField.getText().isEmpty()) { f.setSampleName(textField.getText()); saveProject(); } } } }); vbox.getChildren().add(textField); Label noCalls = new Label(); if (f.getPercentNoCall() != null) { noCalls.setText("No Calls: " + DecimalFormat.getInstance().format(f.getPercentNoCall()) + " %"); } else { noCalls.setText("No Calls: none"); } Label meanQual = new Label(); if (f.getMeanQuality() != null) { meanQual.setText("Av. Call Conf: " + DecimalFormat.getInstance().format(100 - (f.getMeanQuality() * 100)) + " %"); } else { meanQual.setText("No Call Confidence Data"); } vbox.getChildren().add(noCalls); vbox.getChildren().add(meanQual); labelPane.setContent(vbox); // labelPane.getChildren().add(fileLabel); labelsToAdd.add(labelPane); } if (panesToAdd.size() > 0) { chromSplitPane.getItems().addAll(panesToAdd); labelSplitPane.getItems().addAll(labelsToAdd); ArrayList<SnpFile> bothFiles = new ArrayList<>(affFiles); bothFiles.addAll(unFiles); final Iterator<SnpFile> fileIter = bothFiles.iterator(); final Iterator<Pane> paneIter = panesToAdd.iterator(); SnpFile firstFileToProcess = fileIter.next(); Pane firstPaneToProcess = paneIter.next(); String pngPath = null; if (qualityFilter != null) { Integer percent = new Integer(100 - (int) (qualityFilter * 100)); pngPath = percent.toString(); } drawWithIterator(firstFileToProcess, firstPaneToProcess, pngPath, fileIter, paneIter, 1, totalFiles, chrom, forceRedraw, chromSplitPane); } else { setProgressMode(false); } }
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 v a 2s.c om 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:editeurpanovisu.EditeurPanovisu.java
/** * * @param lstPano//w w w .j av a 2 s. c o m * @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 ScrollPane afficheLegende() { double positionX = 0; double positionY = 0; AnchorPane apLegende = new AnchorPane(); ScrollPane spLegende = new ScrollPane(apLegende); spLegende.getStyleClass().add("legendePane"); apLegende.setMinWidth(1000);/* www.j a v a 2s . c om*/ apLegende.setMinHeight(150); apLegende.setPrefWidth(1000); apLegende.setPrefHeight(150); apLegende.setMaxWidth(1000); apLegende.setMaxHeight(150); positionY = (pano.getLayoutY() + pano.getPrefHeight() + 10); Circle point = new Circle(30, 20, 5); point.setFill(Color.YELLOW); point.setStroke(Color.RED); point.setCursor(Cursor.DEFAULT); Circle point2 = new Circle(30, 60, 5); point2.setFill(Color.BLUE); point2.setStroke(Color.YELLOW); point2.setCursor(Cursor.DEFAULT); Circle point3 = new Circle(30, 100, 5); point3.setFill(Color.GREEN); point3.setStroke(Color.YELLOW); point3.setCursor(Cursor.DEFAULT); Polygon polygon = new Polygon(); polygon.getPoints().addAll(new Double[] { 15.0, 2.0, 2.0, 2.0, 2.0, 15.0, -2.0, 15.0, -2.0, 2.0, -15.0, 2.0, -15.0, -2.0, -2.0, -2.0, -2.0, -15.0, 2.0, -15.0, 2.0, -2.0, 15.0, -2.0 }); polygon.setStrokeLineJoin(StrokeLineJoin.MITER); polygon.setFill(Color.BLUEVIOLET); polygon.setStroke(Color.YELLOW); polygon.setId("PoV"); polygon.setLayoutX(500); polygon.setLayoutY(20); Label lblHS = new Label(rb.getString("main.legendeHS")); Label lblHSImage = new Label(rb.getString("main.legendeHSImage")); //Label lblHSHTML = new Label(rb.getString("main.legendeHSHTML")); Label lblPoV = new Label(rb.getString("main.legendePoV")); Label lblNord = new Label(rb.getString("main.legendeNord")); Line ligneNord = new Line(500, 45, 500, 65); ligneNord.setStroke(Color.RED); ligneNord.setStrokeWidth(3); lblHS.setLayoutX(50); lblHS.setLayoutY(10); lblHSImage.setLayoutX(50); lblHSImage.setLayoutY(50); //lblHSHTML.setLayoutX(50); //lblHSHTML.setLayoutY(90); lblPoV.setLayoutX(520); lblPoV.setLayoutY(10); lblNord.setLayoutX(520); lblNord.setLayoutY(50); // apLegende.getChildren().addAll(lblHS, point, lblHSImage, point2, lblHSHTML, point3, lblPoV, polygon, lblNord, ligneNord); apLegende.getChildren().addAll(lblHS, point, lblHSImage, point2, lblPoV, polygon, lblNord, ligneNord); apLegende.setId("legende"); apLegende.setVisible(true); if (largeurMax - 50 < 1004) { spLegende.setPrefWidth(largeurMax - 50); spLegende.setMaxWidth(largeurMax - 50); positionX = 25; } else { spLegende.setPrefWidth(1004); spLegende.setMaxWidth(1004); positionX = (largeurMax - 1004) / 2.d; } spLegende.setLayoutX(positionX); spLegende.setLayoutY(positionY); spLegende.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); spLegende.setHbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED); return spLegende; }
From source file:fr.amap.lidar.amapvox.gui.MainFrameController.java
private void initEchoFiltering() { anchorPaneEchoFilteringClassifications = new AnchorPane(); listviewClassifications = new ListView<>(); listviewClassifications.getItems()//from www .j a v a 2 s. c o m .addAll(createSelectedCheckbox(Classification.CREATED_NEVER_CLASSIFIED.getValue() + " - " + Classification.CREATED_NEVER_CLASSIFIED.getDescription()), createSelectedCheckbox(Classification.UNCLASSIFIED.getValue() + " - " + Classification.UNCLASSIFIED.getDescription()), new CheckBox(Classification.GROUND.getValue() + " - " + //by default unselected, ground point will be removed Classification.GROUND.getDescription()), createSelectedCheckbox(Classification.LOW_VEGETATION.getValue() + " - " + Classification.LOW_VEGETATION.getDescription()), createSelectedCheckbox(Classification.MEDIUM_VEGETATION.getValue() + " - " + Classification.MEDIUM_VEGETATION.getDescription()), createSelectedCheckbox(Classification.HIGH_VEGETATION.getValue() + " - " + Classification.HIGH_VEGETATION.getDescription()), createSelectedCheckbox(Classification.BUILDING.getValue() + " - " + Classification.BUILDING.getDescription()), createSelectedCheckbox(Classification.LOW_POINT.getValue() + " - " + Classification.LOW_POINT.getDescription()), createSelectedCheckbox(Classification.MODEL_KEY_POINT.getValue() + " - " + Classification.MODEL_KEY_POINT.getDescription()), createSelectedCheckbox( Classification.WATER.getValue() + " - " + Classification.WATER.getDescription()), createSelectedCheckbox(Classification.RESERVED_10.getValue() + " - " + Classification.RESERVED_10.getDescription()), createSelectedCheckbox(Classification.RESERVED_11.getValue() + " - " + Classification.RESERVED_11.getDescription()), createSelectedCheckbox(Classification.OVERLAP_POINTS.getValue() + " - " + Classification.OVERLAP_POINTS.getDescription())); listviewClassifications.setPrefSize(269, 134); anchorPaneEchoFilteringClassifications.getChildren() .add(new VBox(new Label("Classifications"), listviewClassifications)); anchorPaneEchoFilteringClassifications.setLayoutX(14); anchorPaneEchoFilteringClassifications.setLayoutY(14); anchorPaneEchoFiltering.getChildren().add(anchorPaneEchoFilteringClassifications); }