List of usage examples for javafx.scene.control TextField getText
public final String getText()
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 w w w. j av a2 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:com.chart.SwingChart.java
/** * Series edition//from w w w . j a va 2 s. c om * @param series Series to edit */ void editSeries(final Series series) { String[] style = series.getStyle().split(";"); String strColor = "black"; final TextField editWidth = new TextField(); String tempS = "null"; for (String e : style) { if (e.contains("color: ")) { strColor = e.replace("color: ", ""); } else if (e.contains("width: ")) { editWidth.setText(e.replace("width: ", "")); } else if (e.contains("shape: ")) { tempS = e.replace("shape: ", ""); } } final String symbol = tempS; final List<SeriesShape> symbolList = new ArrayList<>(); final ObservableList<SeriesShape> symbolListModel; final ListView<SeriesShape> comboSymbol = new ListView(); symbolList.add(new SeriesShape("null", javafx.scene.paint.Color.web(strColor))); symbolList.add(new SeriesShape("rectangle", javafx.scene.paint.Color.web(strColor))); symbolList.add(new SeriesShape("circle", javafx.scene.paint.Color.web(strColor))); symbolList.add(new SeriesShape("triangle", javafx.scene.paint.Color.web(strColor))); symbolList.add(new SeriesShape("crux", javafx.scene.paint.Color.web(strColor))); symbolList.add(new SeriesShape("diamond", javafx.scene.paint.Color.web(strColor))); symbolList.add(new SeriesShape("empty rectangle", javafx.scene.paint.Color.web(strColor))); symbolList.add(new SeriesShape("empty circle", javafx.scene.paint.Color.web(strColor))); symbolList.add(new SeriesShape("empty triangle", javafx.scene.paint.Color.web(strColor))); symbolList.add(new SeriesShape("empty diamond", javafx.scene.paint.Color.web(strColor))); symbolListModel = FXCollections.observableList(symbolList); comboSymbol.setItems(symbolListModel); comboSymbol.setCellFactory(new Callback<ListView<SeriesShape>, ListCell<SeriesShape>>() { @Override public ListCell<SeriesShape> call(ListView<SeriesShape> p) { ListCell<SeriesShape> cell = new ListCell<SeriesShape>() { @Override protected void updateItem(SeriesShape t, boolean bln) { super.updateItem(t, bln); if (t != null) { setText(""); setGraphic(t.getShapeGraphic()); } } }; return cell; } }); for (SeriesShape smb : symbolListModel) { if (smb.getName().equals(symbol)) { comboSymbol.getSelectionModel().select(smb); } } final ColorPicker colorPicker = new ColorPicker(javafx.scene.paint.Color.web(strColor)); colorPicker.setOnAction((ActionEvent t) -> { String sc = colorPicker.getValue().toString(); symbolListModel.clear(); symbolListModel.add(new SeriesShape("null", javafx.scene.paint.Color.web(sc))); symbolListModel.add(new SeriesShape("rectangle", javafx.scene.paint.Color.web(sc))); symbolListModel.add(new SeriesShape("circle", javafx.scene.paint.Color.web(sc))); symbolListModel.add(new SeriesShape("triangle", javafx.scene.paint.Color.web(sc))); symbolListModel.add(new SeriesShape("crux", javafx.scene.paint.Color.web(sc))); symbolListModel.add(new SeriesShape("diamond", javafx.scene.paint.Color.web(sc))); symbolListModel.add(new SeriesShape("empty rectangle", javafx.scene.paint.Color.web(sc))); symbolListModel.add(new SeriesShape("empty circle", javafx.scene.paint.Color.web(sc))); symbolListModel.add(new SeriesShape("empty triangle", javafx.scene.paint.Color.web(sc))); symbolListModel.add(new SeriesShape("empty diamond", javafx.scene.paint.Color.web(sc))); comboSymbol.setItems(symbolListModel); for (SeriesShape smb : symbolListModel) { if (smb.getName().equals(symbol)) { comboSymbol.getSelectionModel().select(smb); } } }); GridPane grid = new GridPane(); grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(0, 10, 0, 10)); grid.add(new Label("Series"), 0, 0); grid.add(new Label(series.getKey().toString()), 1, 0); grid.add(new Label("Color"), 0, 1); grid.add(colorPicker, 1, 1); grid.add(new Label("Width"), 0, 2); grid.add(editWidth, 1, 2); grid.add(new Label("Shape"), 0, 3); grid.add(comboSymbol, 1, 3); new PseudoModalDialog(skeleton, grid, true) { @Override public boolean validation() { String strColor = colorPicker.getValue().toString(); String strWidth = editWidth.getText(); double dWidth = Double.valueOf(strWidth); String strSimbolo = "null"; SeriesShape simb = new SeriesShape(comboSymbol.getSelectionModel().getSelectedItem().toString(), javafx.scene.paint.Color.web(strColor)); XYItemRenderer renderer = (XYItemRenderer) plot.getRenderer(series.getAxisIndex()); renderer.setSeriesPaint(series.getSeriesIndex(), scene2awtColor(colorPicker.getValue())); try { if (Double.valueOf(strWidth) > 0) { ((XYLineAndShapeRenderer) renderer).setSeriesLinesVisible(series.getSeriesIndex(), true); renderer.setSeriesStroke(series.getSeriesIndex(), new BasicStroke(Integer.valueOf(strWidth))); } else { ((XYLineAndShapeRenderer) renderer).setSeriesLinesVisible(series.getSeriesIndex(), false); } } catch (NumberFormatException ex) { } if (simb.getName().contains("null")) { ((XYLineAndShapeRenderer) renderer).setSeriesShapesVisible(series.getSeriesIndex(), false); renderer.setSeriesShape(series.getSeriesIndex(), null); } else { ((XYLineAndShapeRenderer) renderer).setSeriesShapesVisible(series.getSeriesIndex(), true); renderer.setSeriesShape(series.getSeriesIndex(), simb.getShapeAWT()); if (simb.getName().contains("empty")) { ((XYLineAndShapeRenderer) renderer).setSeriesShapesFilled(series.getSeriesIndex(), false); } else { ((XYLineAndShapeRenderer) renderer).setSeriesShapesFilled(series.getSeriesIndex(), true); } } series.setStyle( "color: " + strColor + ";width: " + editWidth.getText() + ";shape: " + strSimbolo + ";"); for (Node le : legendFrame.getChildren()) { if (le instanceof LegendAxis) { for (Node nn : ((LegendAxis) le).getChildren()) { if (nn instanceof Label) { if (((Label) nn).getText().equals(series.getKey().toString())) { ((Label) nn).setGraphic(simb.getShapeGraphic()); } } } } } return true; } }.show(); }
From source file:editeurpanovisu.EditeurPanovisu.java
/** * */// ww w . ja v a2 s . c o m private static void clickBtnValidePano() { TextField tfTitrePano = (TextField) getScnPrincipale().lookup("#txttitrepano"); if (tfTitrePano != null) { getPanoramiquesProjet()[getiPanoActuel()].setStrTitrePanoramique(tfTitrePano.getText()); Label lblTitre = (Label) apParametresVisite.lookup("#lvTitre" + iPanoActuel); if (lblTitre != null) { lblTitre.setText(tfTitrePano.getText().toUpperCase()); } for (int i = 0; i < ordPano.getCellulesPanoramiques().size(); i++) { if (ordPano.getCellulesPanoramiques().get(i).getiNumPano() == iPanoActuel) { ordPano.getCellulesPanoramiques().get(i).setStrTitrePanoramique(tfTitrePano.getText()); } } } }
From source file:editeurpanovisu.EditeurPanovisu.java
/** * *///ww w . j a v a 2 s . co m private static void valideHS() { for (int i = 0; i < getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspots(); i++) { ComboBox cbPanos = (ComboBox) vbOutils.lookup("#cbpano" + i); TextField tfTexteHS = (TextField) vbOutils.lookup("#txtHS" + i); if (tfTexteHS != null) { getPanoramiquesProjet()[getiPanoActuel()].getHotspot(i).setStrInfo(tfTexteHS.getText()); } if (cbPanos != null) { getPanoramiquesProjet()[getiPanoActuel()].getHotspot(i) .setStrFichierXML(cbPanos.getValue() + ".xml"); getPanoramiquesProjet()[getiPanoActuel()].getHotspot(i) .setNumeroPano(cbPanos.getSelectionModel().getSelectedIndex()); } CheckBox cbAnime = (CheckBox) vbOutils.lookup("#anime" + i); if (cbAnime != null) { getPanoramiquesProjet()[getiPanoActuel()].getHotspot(i).setAnime(cbAnime.isSelected()); } } for (int i = 0; i < getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspotImage(); i++) { TextField tfTexteHS = (TextField) vbOutils.lookup("#txtHSImage" + i); if (tfTexteHS != null) { getPanoramiquesProjet()[getiPanoActuel()].getHotspotImage(i).setStrInfo(tfTexteHS.getText()); } CheckBox cbAnime = (CheckBox) vbOutils.lookup("#animeImage" + i); if (cbAnime != null) { getPanoramiquesProjet()[getiPanoActuel()].getHotspotImage(i).setAnime(cbAnime.isSelected()); } } for (int i = 0; i < getPanoramiquesProjet()[getiPanoActuel()].getNombreHotspotHTML(); i++) { TextField tfTexteHS = (TextField) vbOutils.lookup("#txtHSHTML" + i); if (tfTexteHS != null) { getPanoramiquesProjet()[getiPanoActuel()].getHotspotHTML(i).setStrInfo(tfTexteHS.getText()); } CheckBox cbAnime = (CheckBox) vbOutils.lookup("#animeHTML" + i); if (cbAnime != null) { getPanoramiquesProjet()[getiPanoActuel()].getHotspotHTML(i).setAnime(cbAnime.isSelected()); } } for (int i = 0; i < getPanoramiquesProjet()[getiPanoActuel()].getiNombreHotspotDiapo(); i++) { TextField tfTexteHS = (TextField) vbOutils.lookup("#txtDIA" + i); if (tfTexteHS != null) { getPanoramiquesProjet()[getiPanoActuel()].getHotspotDiapo(i).setStrInfo(tfTexteHS.getText()); } CheckBox cbAnime = (CheckBox) vbOutils.lookup("#animeDIA" + i); if (cbAnime != null) { getPanoramiquesProjet()[getiPanoActuel()].getHotspotDiapo(i).setbAnime(cbAnime.isSelected()); } } }
From source file:patientmanagerv1.HomeController.java
public void printAdv() { final Stage dialog = new Stage(); dialog.initModality(Modality.APPLICATION_MODAL); final TextField textField = new TextField(); Button submit = new Button(); Button cancel = new Button(); final Label label = new Label(); cancel.setText("Cancel"); cancel.setAlignment(Pos.CENTER);/*from w ww. j a v a 2s . c om*/ submit.setText("Submit"); submit.setAlignment(Pos.BOTTOM_RIGHT); final VBox dialogVbox = new VBox(20); dialogVbox.getChildren().add(new Text("Enter the master password: ")); dialogVbox.getChildren().add(textField); dialogVbox.getChildren().add(submit); dialogVbox.getChildren().add(cancel); dialogVbox.getChildren().add(label); Scene dialogScene = new Scene(dialogVbox, 300, 200); dialog.setScene(dialogScene); dialog.setTitle("Security/Physician Authentication"); dialog.show(); submit.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent anEvent) { String password = textField.getText(); if (password.equalsIgnoreCase("protooncogene")) { dialog.close(); writeEvalToDocX(false, ""); //OPENS the document for printing: try { if (Desktop.isDesktopSupported()) { Desktop.getDesktop() .open(new File(installationPath + "/userdata/" + firstName + lastName + dob + "/" + firstName + lastName + dob + "psychiatricevaluation.docx")); } } catch (IOException ioe) { ioe.printStackTrace(); } } else { label.setText("The password you entered is incorrect. Please try again."); } //adds files to file tracker } }); cancel.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent anEvent) { dialog.close(); //close the window here } }); }
From source file:editeurpanovisu.EditeurPanovisu.java
/** * * @throws IOException Exception d'entre sortie *///from w w w . j av a 2 s . com private static void sauveFichierProjet() throws IOException { setStrRepertoireProjet(fileProjet.getParent()); bRepertSauveChoisi = true; File fileFichierProjet = new File(fileProjet.getAbsolutePath()); if (!fileFichierProjet.exists()) { fileFichierProjet.createNewFile(); } setbDejaSauve(true); getStPrincipal() .setTitle("Panovisu v" + strNumVersion.split("-")[0] + " : " + fileProjet.getAbsolutePath()); String strContenuFichier = ""; TextField tfVisite = (TextField) getVbChoixPanoramique().lookup("#titreVisite"); if (!tfVisite.getText().equals("")) { strContenuFichier += "[titreVisite=>" + tfVisite.getText() + "]\n"; } if (!strPanoEntree.equals("")) { strContenuFichier += "[PanoEntree=>" + strPanoEntree + "]\n"; } strContenuFichier += "[introLP=>" + isbIntroPetitePlanete() + "]\n"; strContenuFichier += "[arDemarre=>" + isbAutoRotationDemarre() + "]\n"; strContenuFichier += "[arVitesse=>" + getiAutoRotationVitesse() + "]\n"; strContenuFichier += "[atDemarre=>" + isbAutoTourDemarre() + "]\n"; strContenuFichier += "[atVitesse=>" + getiAutoTourLimite() + "]\n"; strContenuFichier += "[atDemarrage=>" + getiAutoTourDemarrage() + "]\n"; strContenuFichier += "[atType=>" + getStrAutoTourType() + "]\n"; strOrdrePanos = ""; ordPano.getStrPanos().stream().forEach((strOrd) -> { strOrdrePanos += strOrd + ","; }); strOrdrePanos = strOrdrePanos.substring(0, strOrdrePanos.length() - 1); strContenuFichier += "[OrdrePanos=>" + strOrdrePanos + "]\n"; for (int i = 0; i < getiNombrePanoramiques(); i++) { strContenuFichier += "[Panoramique=>" + "fichier:" + strEncodeFichier(getPanoramiquesProjet()[i].getStrNomFichier()) + ";nb:" + getPanoramiquesProjet()[i].getNombreHotspots() + ";nbImg:" + getPanoramiquesProjet()[i].getNombreHotspotImage() + ";nbHTML:" + getPanoramiquesProjet()[i].getNombreHotspotHTML() + ";nbDiapo:" + getPanoramiquesProjet()[i].getiNombreHotspotDiapo() + ";titre:" + getPanoramiquesProjet()[i].getStrTitrePanoramique() + "" + ";type:" + getPanoramiquesProjet()[i].getStrTypePanoramique() + ";afficheInfo:" + getPanoramiquesProjet()[i].isAfficheInfo() + ";afficheTitre:" + getPanoramiquesProjet()[i].isAfficheTitre() + ";regardX:" + getPanoramiquesProjet()[i].getRegardX() + ";regardY:" + getPanoramiquesProjet()[i].getRegardY() + ";minLat:" + getPanoramiquesProjet()[i].getMinLat() + ";maxLat:" + getPanoramiquesProjet()[i].getMaxLat() + ";bMinLat:" + getPanoramiquesProjet()[i].isbMinLat() + ";bMaxLat:" + getPanoramiquesProjet()[i].isbMaxLat() + ";fov:" + (getPanoramiquesProjet()[i].getChampVisuel() * 2) + ";minfov:" + (getPanoramiquesProjet()[i].getFovMin() * 2) + ";maxfov:" + (getPanoramiquesProjet()[i].getFovMax() * 2) + ";zeroNord:" + getPanoramiquesProjet()[i].getZeroNord() + ";affichePlan:" + getPanoramiquesProjet()[i].isAffichePlan() + ";numeroPlan:" + getPanoramiquesProjet()[i].getNumeroPlan(); if (getPanoramiquesProjet()[i].getMarqueurGeolocatisation() != null) { strContenuFichier += ";longitudeGeo:" + getPanoramiquesProjet()[i].getMarqueurGeolocatisation().getLongitude() + ";latitudeGeo:" + getPanoramiquesProjet()[i].getMarqueurGeolocatisation().getLatitude(); } strContenuFichier += "]\n"; for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspots(); j++) { HotSpot HS = getPanoramiquesProjet()[i].getHotspot(j); strContenuFichier += " [hotspot==>" + "longitude:" + HS.getLongitude() + ";latitude:" + HS.getLatitude() + ";image:" + HS.getStrFichierImage() + ";xml:" + HS.getStrFichierXML() + ";numXML:" + HS.getNumeroPano() + ";info:" + HS.getStrInfo().replace(";", "&pv").replace(":", "&dp") + ";anime:" + HS.isAnime(); if (HS.getRegardX() != 1000) { strContenuFichier += ";regardX:" + HS.getRegardX(); } if (HS.getRegardY() != 1000) { strContenuFichier += ";regardY:" + HS.getRegardY(); } if (HS.getChampVisuel() != 0) { strContenuFichier += ";champVisuel:" + (HS.getChampVisuel() * 2); } strContenuFichier += "]\n"; } for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspotImage(); j++) { HotspotImage HS = getPanoramiquesProjet()[i].getHotspotImage(j); strContenuFichier += " [hotspotImage==>" + "longitude:" + HS.getLongitude() + ";latitude:" + HS.getLatitude() + ";image:" + HS.getStrFichierImage() + ";img:" + HS.getStrLienImg() + ";urlImg:" + HS.getStrUrlImage() + ";couleur:" + HS.getStrCouleurFond() + ";opacite:" + HS.getOpacite() + ";info:" + HS.getStrInfo().replace(";", "&pv").replace(":", "&dp") + ";anime:" + HS.isAnime() + "]\n"; } for (int j = 0; j < getPanoramiquesProjet()[i].getiNombreHotspotDiapo(); j++) { HotspotDiaporama HS = getPanoramiquesProjet()[i].getHotspotDiapo(j); strContenuFichier += " [hotspotDiapo==>" + "longitude:" + HS.getLongitude() + ";latitude:" + HS.getLatitude() + ";numDiapo:" + HS.getiNumDiapo() + ";info:" + HS.getStrInfo().replace(";", "&pv").replace(":", "&dp") + ";anime:" + HS.isbAnime() + "]\n"; } for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspotHTML(); j++) { HotspotHTML HS = getPanoramiquesProjet()[i].getHotspotHTML(j); strContenuFichier += " [hotspotHTML==>" + "longitude:" + HS.getLongitude() + ";latitude:" + HS.getLatitude() + ";lienExterieur:" + HS.isbLienExterieur() + ";url:" + HS.getStrURLExterieure() + ";info:" + HS.getStrInfo().replace(";", "&pv").replace(":", "&dp") + ";anime:" + HS.isAnime() + ";position:" + HS.getStrPositionHTML() + ";couleur:" + HS.getStrCouleurHTML() + ";opacite:" + HS.getOpaciteHTML() + ";largeur:" + HS.getLargeurHTML() + "]\n"; } } for (int i = 0; i < getiNombreDiapo(); i++) { strContenuFichier += "[Diaporama=>" + "nom:" + diaporamas[i].getStrNomDiaporama() + ";fichier:" + diaporamas[i].getStrFichierDiaporama() + ";opacite:" + diaporamas[i].getOpaciteDiaporama() + ";nbImages:" + diaporamas[i].getiNombreImages() + ";delai:" + diaporamas[i].getDelaiDiaporama() + ";coul:" + diaporamas[i].getStrCouleurFondDiaporama() + "]\n"; for (int j = 0; j < diaporamas[i].getiNombreImages(); j++) { strContenuFichier += " [imageDiapo==>" + "fichierImage:" + diaporamas[i].getStrFichiersImage(j) + ";fichiers:" + diaporamas[i].getStrFichiers(j) + ";libelles:" + diaporamas[i].getStrLibellesImages(j).replace("\n", ""); strContenuFichier += "]\n"; } } strContenuFichier += "[Interface=>\n" + getGestionnaireInterface().strGetTemplate() + "]\n"; strContenuFichier += getGestionnairePlan().getTemplate(); for (int i = 0; i < getiNombrePanoramiques(); i++) { for (int j = 0; j < getPanoramiquesProjet()[i].getNombreHotspotHTML(); j++) { if (!panoramiquesProjet[i].getHotspotHTML(j).isbLienExterieur()) { HotspotHTML HS = getPanoramiquesProjet()[i].getHotspotHTML(j); strContenuFichier += "[pageHTML=>" + "numPano:" + i + "\n" + "numHSHTML:" + j + "\n" + "texteHTML:" + HS.getStrTexteHTML().replace("\n", "&nl").replace(":", "&dp").replace(";", "&pv") + "\n" + "numImages:" + HS.getiNombreImages() + "\n"; for (int k = 0; k < HS.getiNombreImages(); k++) { strContenuFichier += "imagePath:" + HS.getImagesEditeur()[k].getStrImagePath() + "\n"; } strContenuFichier += "]\n"; } } } fileProjet.setWritable(true); OutputStreamWriter oswFichierPVU = new OutputStreamWriter(new FileOutputStream(fileProjet), "UTF-8"); try (BufferedWriter bwFichierPVU = new BufferedWriter(oswFichierPVU)) { bwFichierPVU.write(strContenuFichier); } Alert alert = new Alert(AlertType.INFORMATION); alert.setTitle(rbLocalisation.getString("main.dialog.sauveProjet")); alert.setHeaderText(null); alert.setContentText(rbLocalisation.getString("main.dialog.sauveProjetMessage")); alert.showAndWait(); }
From source file:patientmanagerv1.HomeController.java
public void assistantSign() { final Stage dialog = new Stage(); dialog.initModality(Modality.APPLICATION_MODAL); final TextField textField = new TextField(); Button submit = new Button(); Button cancel = new Button(); final Label label = new Label(); cancel.setText("Cancel"); cancel.setAlignment(Pos.CENTER);/*from w w w . ja v a 2s . c o m*/ submit.setText("Submit"); submit.setAlignment(Pos.BOTTOM_RIGHT); final VBox dialogVbox = new VBox(20); dialogVbox.getChildren().add(new Text("Please enter the physician's assistant password: ")); dialogVbox.getChildren().add(textField); dialogVbox.getChildren().add(submit); dialogVbox.getChildren().add(cancel); dialogVbox.getChildren().add(label); Scene dialogScene = new Scene(dialogVbox, 300, 200); dialog.setScene(dialogScene); dialog.setTitle("Security/Physician's Assistant Authentication"); dialog.show(); submit.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent anEvent) { String password = textField.getText(); if (password.equalsIgnoreCase("siberianplatypus")) { partnerSigned = true; dialog.close(); assistantsign.setVisible(false); saveButton.setDisable(true); //signature.setText("This document has been digitally signed by David Zhvikov MD"); //signature.setVisible(true); //signature2.setVisible(true); assistantsignature.setVisible(true); //update the "signed" status document here, checked the "signed" status in the initialize() method and enable/disable the buttons and message accordingly onLoad...when the signed document is first created, it should be set to false (f) by default try { File signedStatus = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/assistantsigned.txt"); FileWriter writ = new FileWriter(signedStatus, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append("true"); bw.close(); writ.close(); } catch (IOException e) { } ap.setDisable(true); //System.out.println(engaged.isSelected()); } else { label.setText("The password you entered is incorrect. Please try again."); } //adds files to file tracker } }); cancel.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent anEvent) { dialog.close(); //close the window here } }); }
From source file:patientmanagerv1.HomeController.java
public void signEvaluation() { final Stage dialog = new Stage(); dialog.initModality(Modality.APPLICATION_MODAL); final TextField textField = new TextField(); Button submit = new Button(); Button cancel = new Button(); final Label label = new Label(); cancel.setText("Cancel"); cancel.setAlignment(Pos.CENTER);//from w ww . ja v a2 s. c om submit.setText("Submit"); submit.setAlignment(Pos.BOTTOM_RIGHT); final VBox dialogVbox = new VBox(20); dialogVbox.getChildren() .add(new Text("Only the physician can sign this document. Please enter the master password: ")); dialogVbox.getChildren().add(textField); dialogVbox.getChildren().add(submit); dialogVbox.getChildren().add(cancel); dialogVbox.getChildren().add(label); Scene dialogScene = new Scene(dialogVbox, 300, 200); dialog.setScene(dialogScene); dialog.setTitle("Security/Physician Authentication"); dialog.show(); submit.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent anEvent) { String password = textField.getText(); if (password.equalsIgnoreCase("protooncogene")) { dccSigned = true; dialog.close(); sign.setVisible(false); saveButton.setDisable(true); signature.setText("This document has been digitally signed by David Zhvikov MD"); signature.setVisible(true); signature2.setVisible(true); //update the "signed" status document here, checked the "signed" status in the initialize() method and enable/disable the buttons and message accordingly onLoad...when the signed document is first created, it should be set to false (f) by default try { File signedStatus = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/signed.txt"); FileWriter writ = new FileWriter(signedStatus, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append("true"); bw.close(); writ.close(); } catch (IOException e) { } ap.setDisable(true); //System.out.println(engaged.isSelected()); } else { label.setText("The password you entered is incorrect. Please try again."); } //adds files to file tracker } }); cancel.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent anEvent) { dialog.close(); //close the window here } }); //"save as document" (exporting) should become enabled after signing? (ask dcc if he wants this) --> it should automatically convert the generated word document to a pdf }
From source file:patientmanagerv1.HomeController.java
public void enableBackdoorModifications() { final Stage dialog = new Stage(); dialog.initModality(Modality.APPLICATION_MODAL); final TextField textField = new TextField(); Button submit = new Button(); Button cancel = new Button(); final Label label = new Label(); cancel.setText("Cancel"); cancel.setAlignment(Pos.CENTER);/*from w w w. ja v a 2s . c o m*/ submit.setText("Submit"); submit.setAlignment(Pos.BOTTOM_RIGHT); final VBox dialogVbox = new VBox(20); dialogVbox.getChildren().add(new Text( "Only the physician can open this document for modification. Please Enter the master password: ")); dialogVbox.getChildren().add(textField); dialogVbox.getChildren().add(submit); dialogVbox.getChildren().add(cancel); dialogVbox.getChildren().add(label); Scene dialogScene = new Scene(dialogVbox, 300, 200); dialog.setScene(dialogScene); dialog.setTitle("Security/Physician Authentication"); dialog.show(); submit.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent anEvent) { String password = textField.getText(); if (password.equalsIgnoreCase("protooncogene")) { dialog.close(); sign.setVisible(true); saveButton.setDisable(false); signature.setText("This document has been digitally signed by David Zhvikov MD"); signature.setVisible(false); signature2.setVisible(false); //update the "signed" status document here, checked the "signed" status in the initialize() method and enable/disable the buttons and message accordingly onLoad...when the signed document is first created, it should be set to false (f) by default try { File signedStatus = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/signed.txt"); FileWriter writ = new FileWriter(signedStatus, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append("false"); bw.close(); writ.close(); } catch (IOException e) { } ap.setDisable(false); //System.out.println(engaged.isSelected()); } else if (password.equalsIgnoreCase("siberianplatypus")) { dialog.close(); sign.setVisible(true); assistantsign.setVisible(true); assistantsign.setDisable(false); saveButton.setDisable(false); //signature.setText("This document has been digitally signed by David Zhvikov MD"); assistantsignature.setVisible(false); signature.setVisible(false); signature2.setVisible(false); //update the "signed" status document here, checked the "signed" status in the initialize() method and enable/disable the buttons and message accordingly onLoad...when the signed document is first created, it should be set to false (f) by default try { File signedStatus = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/signed.txt"); FileWriter writ = new FileWriter(signedStatus, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append("false"); bw.close(); writ.close(); } catch (IOException e) { } try { File signedStatus = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/assistantsigned.txt"); FileWriter writ = new FileWriter(signedStatus, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append("false"); bw.close(); writ.close(); } catch (IOException e) { } ap.setDisable(false); //System.out.println(engaged.isSelected()); } else { label.setText("The password you entered is incorrect. Please try again."); } //adds files to file tracker } }); cancel.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent anEvent) { dialog.close(); //close the window here } }); }
From source file:patientmanagerv1.HomeController.java
@Override public void initialize(URL url, ResourceBundle rb) { //start with the forum and the common questions page, add-on the profile page and private messaging features //passLoaded = false; //sets the current Patient try {/* w w w .ja v a 2 s . c o m*/ String entireFileText = new Scanner(new File(installationPath + "/currentpatient.txt")) .useDelimiter("//A").next(); String[] nameArray = entireFileText.split(","); firstName = nameArray[0].toLowerCase(); lastName = nameArray[1].toLowerCase(); dob = nameArray[2]; } catch (Exception e) { } //checks the signed status try { FileReader reader = new FileReader( installationPath + "/userdata/" + firstName + lastName + dob + "/EvaluationForm/signed.txt"); //+ "/userdata/" + get.currentPatientFirstName + get.currentPatientLastName + "/EvaluationForm/first.txt"); BufferedReader br = new BufferedReader(reader); String signedStatus = br.readLine(); br.close(); reader.close(); if (signedStatus.equalsIgnoreCase("true")) { dccSigned = true; } else { dccSigned = false; } FileReader reader2 = new FileReader(installationPath + "/userdata/" + firstName + lastName + dob + "/EvaluationForm/assistantsigned.txt"); //+ "/userdata/" + get.currentPatientFirstName + get.currentPatientLastName + "/EvaluationForm/first.txt"); BufferedReader br2 = new BufferedReader(reader2); String assistantSigned = br2.readLine(); br2.close(); reader2.close(); if (assistantSigned.equalsIgnoreCase("true")) { partnerSigned = true; } else { partnerSigned = false; } /*saveButton.setDisable(false); sign.setVisible(true); sign.setDisable(true); signature.setVisible(false);*/ if (signedStatus.equalsIgnoreCase("false") && (assistantSigned.equalsIgnoreCase("false"))) { saveButton.setDisable(false); sign.setVisible(true); sign.setDisable(false); assistantsign.setVisible(true); assistantsign.setDisable(false); assistantsignature.setVisible(false); signature.setVisible(false); signature2.setVisible(false); ap.setDisable(false); } else if (signedStatus.equalsIgnoreCase("true") && (assistantSigned.equalsIgnoreCase("false"))) { saveButton.setDisable(true); sign.setVisible(false); assistantsign.setVisible(true); assistantsign.setDisable(false); assistantsignature.setVisible(false); signature.setVisible(true); signature2.setVisible(true); signature.setText("This document has been digitally signed by David Zhvikov MD"); ap.setDisable(true); } else if (signedStatus.equalsIgnoreCase("false") && (assistantSigned.equalsIgnoreCase("true"))) { saveButton.setDisable(true); sign.setVisible(true); assistantsign.setVisible(false); assistantsign.setDisable(true); assistantsignature.setVisible(true); signature.setVisible(false); signature2.setVisible(false); signature.setText("This document has been digitally signed by David Zhvikov MD"); ap.setDisable(true); } else { saveButton.setDisable(true); sign.setVisible(false); assistantsign.setVisible(false); assistantsign.setDisable(true); assistantsignature.setVisible(true); signature.setVisible(true); signature2.setVisible(true); signature.setText("This document has been digitally signed by David Zhvikov MD"); ap.setDisable(true); } } catch (Exception e) { } //loads the ListView try { FileReader r2 = new FileReader( installationPath + "/userdata/" + firstName + lastName + dob + "/ProgressReports.txt"); BufferedReader b2 = new BufferedReader(r2); String s; ArrayList progressNotes = new ArrayList(); while ((s = b2.readLine()) != null) { //System.out.println(s); progressNotes.add(s); } b2.close(); r2.close(); //Adds the Progress Notes to the ListView ObservableList<String> items = FXCollections.observableArrayList("Single", "Double"); items.clear(); for (int counter = 0; counter < progressNotes.size(); counter++) { items.add(progressNotes.get(counter).toString()); } listOfProgressReports.setItems(items); //String[] ethnicityArray = ethnicity.split(","); } catch (Exception e) { //System.out.println("file not found"); } //initializes the evaluation form [with the new patient's name] for the current patient fillName(); fillDOB(); fillAge(loaded); fillGender(); fillMaritalStatus(); fillEthnicity(); fillReferredBy(); fillReasonForReferral(); fillSourceOfInformation(); fillReliabilityOfInformation(); fillHistoryOfPresentIllness(); fillSignsSymptoms(); fillCurrentMedications(); fillPastPsychiatricHistory(); fillPastHistoryOf(); fillHistoryOfMedicationTrialsInThePast(); fillSubstanceUseHistory(); fillDeniesHistoryOf(); fillSocialHistory(); fillParentsSiblingsChildren(); fillFamilyHistoryOfMentalIllness(); fillEducation(); fillEmployment(); fillLegalHistory(); fillPastMedicalHistory(); fillAllergies(); fillAppearance(); fillEyeContact(); fillAttitude(); fillMotorActivity(); fillAffect(); fillMood(); fillSpeech(); fillThoughtProcess(); fillThoughtContent(); fillPerception(); fillSuicidality(); fillHomicidality(); fillOrientation(); fillShortTermMemory(); fillLongTermMemory(); fillGeneralFundOfKnowledge(); fillIntellect(); fillAbstraction(); fillJudgementAndInsight(); fillClinicalNotes(); fillTreatmentPlan(); fillSideEffects(); fillLabs(); fillEnd(); fillSignatureZone(); // currentPatientFirstName = get.currentPatientFirstName; // currentPatientLastName = get.currentPatientLastName; //sets the current patient /*try { String entireFileText = new Scanner(new File(installationPath + "/Patients.txt")).useDelimiter("//A").next(); String[] arrayOfNames = entireFileText.split(";"); System.out.println("Patient Name: " + arrayOfNames[arrayOfNames.length - 1]); String nameWithComma = arrayOfNames[arrayOfNames.length - 1]; String[] nameArray = nameWithComma.split(","); firstName = nameArray[0].toLowerCase(); lastName = nameArray[1].toLowerCase(); } catch(Exception e) {}*/ /*ArrayList progressNotes = new ArrayList(); for(int i = 0; i < listOfProgressReports.getItems().size(); i++) { progressNotes.add(listOfProgressReports.getItems().get(i)); }*/ //broken and betrayed //of the ecsts's you've shown me. //...for me, italicsmaster, she put emphasis/lingered on the word. "M" menu.getMenus().removeAll(); Menu file = new Menu("File"); Menu edit = new Menu("Edit"); Menu view = new Menu("View"); Menu help = new Menu("About"); Menu speech = new Menu("Speech Options"); MenuItem save = new MenuItem("Save"); MenuItem print = new MenuItem("Print"); MenuItem printWithSettings = new MenuItem("Print With Settings"); MenuItem export = new MenuItem("Export to"); MenuItem logout = new MenuItem("Return to Patient Selection"); MenuItem deleteThisPatient = new MenuItem("Delete This Patient"); MenuItem exit = new MenuItem("Exit"); MenuItem undo = new MenuItem("Undo (ctrl+z)"); MenuItem redo = new MenuItem("Redo (ctrl+y)"); MenuItem selectAll = new MenuItem("Select All (ctrl+A)"); MenuItem cut = new MenuItem("Cut (ctrl+x)"); MenuItem copy = new MenuItem("Copy (ctrl+c)"); MenuItem paste = new MenuItem("Paste (ctrl+v)"); MenuItem enableBackdoorModifications = new MenuItem("Enable Modification of this Evaluation Post-Signing"); Menu submenu1 = new Menu("Create"); Menu submenu2 = new Menu("Load"); Menu submenu3 = new Menu("New"); MenuItem createProgressReport = new MenuItem("Progress Report"); MenuItem loadProgressReport = new MenuItem("Progress Report"); MenuItem deleteProgressReport = new MenuItem("Delete selected progress report"); submenu1.getItems().add(submenu3); submenu3.getItems().add(createProgressReport); submenu2.getItems().add(loadProgressReport); MenuItem howToUse = new MenuItem("How to use patient manager"); MenuItem versionInfo = new MenuItem("About Patient Manager/Version Info"); /*MenuItem read = new MenuItem("Read to me"); MenuItem launch = new MenuItem("Launch Dictation");*/ //read to me menu, dictation menu- select a document to read aloud, read this passage aloud, launch windows in-built dictation, download brainac dictation online Menu read = new Menu("Read to me"); Menu launch = new Menu("Dictation"); Menu readPassageOrFormStartStop = new Menu("Read this passage/read this form"); MenuItem startReading1 = new MenuItem("Start"); MenuItem stopReading1 = new MenuItem("Stop"); MenuItem startReading2 = new MenuItem("Start"); MenuItem stopReading2 = new MenuItem("Stop"); Menu readUploadedDocument = new Menu("Select a document to read"); MenuItem launchWindowsDictation = new MenuItem("Launch Windows' Built-In Dictation"); MenuItem launchBrainacDictation = new MenuItem("Download Brainac Dictation"); startReading1.setDisable(true); stopReading1.setDisable(true); startReading2.setDisable(true); stopReading2.setDisable(true); readPassageOrFormStartStop.getItems().add(startReading1); readPassageOrFormStartStop.getItems().add(stopReading1); readUploadedDocument.getItems().add(startReading2); readUploadedDocument.getItems().add(stopReading2); readPassageOrFormStartStop.setDisable(true); readUploadedDocument.setDisable(true); launchBrainacDictation.setDisable(true); read.getItems().add(readPassageOrFormStartStop); read.getItems().add(readUploadedDocument); launch.getItems().add(launchWindowsDictation); launch.getItems().add(launchBrainacDictation); file.getItems().add(save); file.getItems().add(print); file.getItems().add(printWithSettings); file.getItems().add(export); file.getItems().add(logout); file.getItems().add(deleteThisPatient); file.getItems().add(exit); edit.getItems().add(undo); edit.getItems().add(redo); edit.getItems().add(selectAll); edit.getItems().add(cut); edit.getItems().add(copy); edit.getItems().add(paste); edit.getItems().add(enableBackdoorModifications); view.getItems().add(submenu1); view.getItems().add(submenu2); view.getItems().add(deleteProgressReport); help.getItems().add(howToUse); help.getItems().add(versionInfo); speech.getItems().add(read); speech.getItems().add(launch); menu.prefWidthProperty().bind(masterPane.widthProperty()); //menu.setStyle("-fx-padding: 0 20 0 20;"); //menu.getMenus().addAll(file, edit, view, help, speech); menu.getMenus().add(file); menu.getMenus().add(edit); menu.getMenus().add(view); menu.getMenus().add(speech); menu.getMenus().add(help); undo.setDisable(true); redo.setDisable(true); cut.setDisable(true); copy.setDisable(true); paste.setDisable(true); selectAll.setDisable(true); deleteThisPatient.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { int result = JOptionPane.showConfirmDialog(null, "Are you sure you want to delete this patient?", "Warning", JOptionPane.OK_CANCEL_OPTION); if (result == 2) { } if (result == 0) { int result2 = JOptionPane.showConfirmDialog(null, "Are you ABSOLUTELY sure you want to delete this patient?", "Warning", JOptionPane.OK_CANCEL_OPTION); if (result2 == 2) { } if (result2 == 0) { String patientToDelete = firstName + "," + lastName + "," + dob; //listOfProgressReports.getSelectionModel().getSelectedItem().toString(); // String currRepNoColons = currRep.replace(":", ""); // currRepNoColons = currRepNoColons.trim(); //1) removes the report from the list in the file try { FileReader r2 = new FileReader(installationPath + "/patients.txt"); BufferedReader b2 = new BufferedReader(r2); String s = b2.readLine(); String[] patients = s.split(";"); //String[] ssArray = ss.split(","); /*for(int i = 0; i < patients.size(); i++) { }*/ /*while((s = b2.readLine()) != null) { //System.out.println(s); if(!s.equalsIgnoreCase(patientToDelete)) {patients.add(s);} }*/ b2.close(); r2.close(); File fff = new File(installationPath + "/patients.txt"); FileWriter ddd = new FileWriter(fff, false); BufferedWriter bw = new BufferedWriter(ddd); ddd.append(""); bw.close(); ddd.close(); for (int i = 0; i < patients.length; i++) { File openProgressReportsList = new File(installationPath + "/patients.txt"); FileWriter fw = new FileWriter(openProgressReportsList, true); BufferedWriter bufferedwriter = new BufferedWriter(fw); if (!(patients[i].equalsIgnoreCase(patientToDelete))) { fw.append(patients[i].toLowerCase() + ";"); } bufferedwriter.close(); fw.close(); } } catch (Exception ex) { } /*try{ FileReader reader = new FileReader(installationPath + "/userdata/" + firstName + lastName + dob + "/ProgressReports.txt"); BufferedReader br = new BufferedReader(reader); String fileContents = br.readLine(); br.close(); reader.close(); fileContents = fileContents.replace(currRep, ""); //System.out.println("fc:" + fileContents); //writes the new contents to the file: //writes the new report to the list File openProgressReportsList = new File(installationPath + "/userdata/" + firstName + lastName + dob + "/ProgressReports.txt"); FileWriter fw = new FileWriter(openProgressReportsList, false); BufferedWriter bufferedwriter = new BufferedWriter(fw); fw.append(fileContents); bufferedwriter.close(); fw.close(); } catch(Exception e) { }*/ //2) Deletes the folder for that progress report try { File directory = new File(installationPath + "/userdata/" + firstName + lastName + dob + "/ProgressNotes"); File[] subdirs = directory.listFiles((FileFilter) DirectoryFileFilter.DIRECTORY); for (File dir : subdirs) { File deleteThis = new File(installationPath + "/userdata/" + firstName + lastName + dob + "/ProgressNotes/" + dir.getName()); //System.out.println("Directory: " + dir.getName()); File[] filez = deleteThis.listFiles(); for (int i = 0; i < filez.length; i++) { filez[i].delete(); } //the wedding nightmare: red, red, dark purple-brown; big-ol red wrap/red jacket deleteThis.delete(); } File path3 = new File(installationPath + "/userdata/" + firstName + lastName + dob + "/ProgressNotes"); File[] files3 = path3.listFiles(); for (int i = 0; i < files3.length; i++) { files3[i].delete(); } //the wedding nightmare: red, red, dark purple-brown; big-ol red wrap/red jacket path3.delete(); File path2 = new File(installationPath + "/userdata/" + firstName + lastName + dob + "/EvaluationForm"); File[] files2 = path2.listFiles(); for (int i = 0; i < files2.length; i++) { files2[i].delete(); } //the wedding nightmare: red, red, dark purple-brown; big-ol red wrap/red jacket path2.delete(); File path = new File(installationPath + "/userdata/" + firstName + lastName + dob); File[] files = path.listFiles(); for (int i = 0; i < files.length; i++) { files[i].delete(); } //the wedding nightmare: red, red, dark purple-brown; big-ol red wrap/red jacket path.delete(); //deleteDirectory(installationPath + "/userdata/" + firstName + lastName + dob + "/ProgressNotes/" + currRepNoColons); //Files.delete(installationPath + "/userdata/" + firstName + lastName + dob + "/ProgressNotes/" + currRepNoColons); //PUT A MESSAGE SAYING "DELETED" HERE JOptionPane.showMessageDialog(null, "Deleted!"); toPatientSelectionNoDialog.fire(); } catch (Exception exception) { } } } } }); save.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { save(); } }); versionInfo.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { JOptionPane.showMessageDialog(null, "Patient Manager Version 5.0.6 \n Compatible with: Windows 7"); } }); howToUse.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { JOptionPane.showMessageDialog(null, "Help: \n\n\n Print- sends the document to the default printer. Requires no passwords. \n\n Print with Settings- opens the evaluation or progress report in word so that the document can be printed using word's built-in dialog. Because the word document will be open to modification, 'print with settings' requires the physician's password. \n\n Export to- save an evaluation or progress note to the location of your choice, rather than to the default location. Requires the physician/admin's password. \n\n Enable Backdoor Modifications- allows the physician or physician's assistant(s) to reopen the forms for modification post-signing. If the physician's password is used, only his signature will become undone. If the physician's assistant(s)' password is used, both the physician's signature (if relevant) and the assitant's signature will become undone (since the physician will need to review the new modifications before re-signing his approval). \n\n Create/Load/Delete a progress note- the create & load functions are accessible directly from the interface. Deletion can only be accessed from the drop-down menu. Select a progress report prior to clicking 'load' or 'delete' \n\n Speech Options- most speech options are still a WIP, HOWEVER, you can click 'launch windows 7 native dictation' from either the interface OR the menu bar, in order to quickly access Windows' built-in dictation capabilities. \n\n Version info can be found in 'About' in the 'Help' drop-down menu on the main menu bar."); } }); launchWindowsDictation.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { launchSpeechRecognition(); } }); exit.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { int result = JOptionPane.showConfirmDialog(null, "Do you want to save any unsaved changes before exiting?", "Save changes?", JOptionPane.YES_NO_CANCEL_OPTION); if (result == 0) { saveEval(); //some idiocy goes here /*try { Audio audio = Audio.getInstance(); InputStream sound = audio.getAudio("Have a nice day!", Language.ENGLISH); audio.play(sound); } catch(Exception excep) {System.out.println(excep);}*/ System.exit(0); } if (result == 1) { //some idiocy goes here /*try { Audio audio = Audio.getInstance(); InputStream sound = audio.getAudio("Have a nice day!", Language.ENGLISH); audio.play(sound); } catch(Exception excep) {System.out.println(excep);}*/ System.exit(0); } if (result == 2) { } } }); enableBackdoorModifications.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { enableBackdoorModifications(); } }); deleteProgressReport.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { deleteProgressReport(); } }); //<MenuItem fx:id="loadProgressReport" onAction="#loadProgressReport" /> loadProgressReport.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { load.fire(); } }); createProgressReport.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { createPN.fire(); } }); //read to me menu, dictation menu- select a document to read aloud, read this passage aloud, launch windows in-built dictation, download brainac dictation online export.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final Stage dialog = new Stage(); dialog.initModality(Modality.APPLICATION_MODAL); final TextField textField = new TextField(); Button submit = new Button(); Button cancel = new Button(); final Label label = new Label(); cancel.setText("Cancel"); cancel.setAlignment(Pos.CENTER); submit.setText("Submit"); submit.setAlignment(Pos.BOTTOM_RIGHT); final VBox dialogVbox = new VBox(20); dialogVbox.getChildren().add(new Text("Enter the master password: ")); dialogVbox.getChildren().add(textField); dialogVbox.getChildren().add(submit); dialogVbox.getChildren().add(cancel); dialogVbox.getChildren().add(label); Scene dialogScene = new Scene(dialogVbox, 300, 200); dialog.setScene(dialogScene); dialog.setTitle("Security/Physician Authentication"); dialog.show(); submit.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent anEvent) { String password = textField.getText(); if (password.equalsIgnoreCase("protooncogene")) { dialog.close(); export(); } else { label.setText("The password you entered is incorrect. Please try again."); } } }); cancel.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent anEvent) { dialog.close(); //close the window here } }); } }); print.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { print(); } }); printWithSettings.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { printAdv(); } }); logout.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { toPatientSelection.fire(); } }); ///"sometime during s-y lol." }