List of usage examples for javafx.scene.layout VBox VBox
public VBox(Node... children)
From source file:Main.java
private void createClipList(GridPane grid) { final VBox vbox = new VBox(30); vbox.setAlignment(Pos.TOP_CENTER);//from w w w.j ava 2 s .c om final Label clipLabel = new Label("Code Monkey To-Do List:"); clipLabel.setId("clipLabel"); final Button getUpButton = new Button("Get Up, Get Coffee"); getUpButton.setPrefWidth(300); getUpButton.setOnAction(createPlayHandler(coffeeClip)); final Button goToJobButton = new Button("Go to Job"); goToJobButton.setPrefWidth(300); goToJobButton.setOnAction(createPlayHandler(jobClip)); final Button meetingButton = new Button("Have Boring Meeting"); meetingButton.setPrefWidth(300); meetingButton.setOnAction(createPlayHandler(meetingClip)); final Hyperlink link = new Hyperlink("About Code Monkey..."); link.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { WebView wv = new WebView(); wv.getEngine().load("http://www.jonathancoulton.com/2006/04/14/" + "thing-a-week-29-code-monkey/"); Scene scene = new Scene(wv, 720, 480); Stage stage = new Stage(); stage.setTitle("Code Monkey"); stage.setScene(scene); stage.show(); } }); vbox.getChildren().addAll(clipLabel, getUpButton, goToJobButton, meetingButton, link); GridPane.setHalignment(vbox, HPos.CENTER); GridPane.setHgrow(vbox, Priority.ALWAYS); GridPane.setVgrow(vbox, Priority.ALWAYS); grid.add(vbox, 0, 0, GridPane.REMAINING, 1); }
From source file:User.java
@Override public void start(Stage primaryStage) { this.primaryStage = primaryStage; user = new User(); primaryStage.initStyle(StageStyle.TRANSPARENT); root = new Group(); Scene scene = new Scene(root, 320, 112, Color.rgb(0, 0, 0, 0)); primaryStage.setScene(scene);/* w w w. jav a 2 s .c om*/ Rectangle background = this.drawRectangleBackground(); HBox row1 = this.drawRow1(); HBox row2 = this.drawRow2(); VBox formLayout = new VBox(4); // spacing formLayout.setLayoutX(12); formLayout.setLayoutY(12); formLayout.getChildren().addAll(row1, row2); root.getChildren().addAll(background, formLayout); primaryStage.show(); }
From source file:com.mycompany.pfinanzaspersonales.BuscadorController.java
@FXML private void btnBuscar(ActionEvent event) throws IOException { String desde_t = "", hasta_t = ""; if (input_desde.getValue() != null) { desde_t = input_desde.getValue().toString(); }/*from w w w . j a va 2 s . c om*/ if (input_hasta.getValue() != null) { hasta_t = input_hasta.getValue().toString(); } final String desde = desde_t; final String hasta = hasta_t; final Task<Void> tarea = new Task<Void>() { @Override protected Void call() throws Exception { HttpResponse response; List<NameValuePair> parametros = new ArrayList<NameValuePair>(); parametros.add(new BasicNameValuePair("tipo", cbb_tipo.getValue().toString())); parametros.add(new BasicNameValuePair("pago", cbb_pago.getValue().toString())); parametros.add(new BasicNameValuePair("desde", desde)); parametros.add(new BasicNameValuePair("hasta", hasta)); System.out.println(desde); response = JSON.request(Config.URL + "usuarios/buscar.json", parametros); JSONObject jObject = JSON.JSON(response); tabla_json = new ArrayList<TablaBuscar>(); try { editar.setCellValueFactory(new PropertyValueFactory<TablaBuscar, String>("editar")); eliminar.setCellValueFactory(new PropertyValueFactory<TablaBuscar, String>("eliminar")); fecha.setCellValueFactory(new PropertyValueFactory<TablaBuscar, String>("fecha")); categoria.setCellValueFactory(new PropertyValueFactory<TablaBuscar, String>("categoria")); tpago.setCellValueFactory(new PropertyValueFactory<TablaBuscar, String>("pago")); tmonto.setCellValueFactory(new PropertyValueFactory<TablaBuscar, String>("monto")); ttipo.setCellValueFactory(new PropertyValueFactory<TablaBuscar, String>("tipo")); tabla_json = new ArrayList<TablaBuscar>(); if (!jObject.get("data").equals(null)) { JSONArray jsonArr = jObject.getJSONArray("data"); for (int i = 0; i < jsonArr.length(); i++) { JSONObject data_json = jsonArr.getJSONObject(i); tabla_json.add(new TablaBuscar(data_json.get("idgastos").toString(), data_json.get("idgastos").toString(), data_json.get("idgastos").toString(), data_json.get("monto").toString(), data_json.get("fecha").toString(), data_json.get("nom_mediopago").toString(), data_json.get("categoria").toString(), data_json.get("tipo").toString())); } } tabla_buscador.setItems(FXCollections.observableArrayList(tabla_json)); } catch (Exception e) { e.printStackTrace(); } return null; } @Override protected void succeeded() { super.succeeded(); eliminar.setCellFactory(new Callback<TableColumn<String, String>, TableCell<String, String>>() { @Override public TableCell<String, String> call(TableColumn<String, String> p) { return new TableCell<String, String>() { @Override public void updateItem(String item, boolean empty) { super.updateItem(item, empty); if (!isEmpty() && !empty) { final VBox vbox = new VBox(5); Image image = new Image(getClass().getResourceAsStream("/Imagenes/delete.png")); final Button boton = new Button("", new ImageView(image)); boton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { Action response = Dialogs.create().title("Eliminar Gasto") .message("Ests seguro que desaeas eliminar el gasto?") .showConfirm(); if (response == Dialog.ACTION_YES) { TablaBuscar tabla = tabla_json.get(getTableRow().getIndex()); List<NameValuePair> parametros = new ArrayList<NameValuePair>(); String url = ""; if (tabla.getTipo() == "Gastos") { parametros .add(new BasicNameValuePair("idgastos", tabla.getId())); url = Config.URL + "gastos/eliminar.json"; } else { parametros.add( new BasicNameValuePair("idingresos", tabla.getId())); url = Config.URL + "ingresos/eliminar.json"; } HttpResponse responseJSON = JSON.request(url, parametros); JSONObject jObject = JSON.JSON(responseJSON); int code = Integer.parseInt(jObject.get("code").toString()); if (code == 201) { int selectdIndex = getTableRow().getIndex(); tabla_json.remove(selectdIndex); tabla_buscador.getItems().remove(selectdIndex); } else { Dialogs.create().title("Error sincronizacin").message( "Hubo un error al intentar eliminar . ERROR: 301") .showInformation(); } } } }); vbox.getChildren().add(boton); setGraphic(vbox); } else { setGraphic(null); } } }; } }); editar.setCellFactory(new Callback<TableColumn<String, String>, TableCell<String, String>>() { @Override public TableCell<String, String> call(TableColumn<String, String> p) { return new TableCell<String, String>() { @Override public void updateItem(String item, boolean empty) { super.updateItem(item, empty); if (!isEmpty() && !empty) { final VBox vbox = new VBox(5); Image image = new Image(getClass().getResourceAsStream("/Imagenes/edit.png")); final Button boton = new Button("", new ImageView(image)); boton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { TablaBuscar tabla = tabla_json.get(getTableRow().getIndex()); Parent parent = null; if (tabla.getTipo() == "Gastos") { AgregarGastos AG = AgregarGastos.getInstance(); AG.setID(tabla.getId()); AG.setMonto(tabla.getMonto()); AG.setCategoria(tabla.getCategoria()); AG.setPago(tabla.getPago()); AG.setActualizacion(true); try { parent = FXMLLoader.load(this.getClass() .getResource("/fxml/AgregarGastos.fxml")); } catch (IOException ex) { Logger.getLogger(FXMLController.class.getName()) .log(Level.SEVERE, null, ex); } } else { AgregarIngresos AI = AgregarIngresos.getInstance(); AI.setID(tabla.getId()); AI.setMonto(tabla.getMonto()); AI.setCategoria(tabla.getCategoria()); AI.setPago(tabla.getPago()); AI.setActualizar(true); try { parent = FXMLLoader.load(this.getClass() .getResource("/fxml/AgregarIngresos.fxml")); } catch (IOException ex) { Logger.getLogger(FXMLController.class.getName()) .log(Level.SEVERE, null, ex); } } Stage stage = new Stage(); Scene scene = new Scene(parent); stage.setScene(scene); stage.show(); } }); vbox.getChildren().add(boton); setGraphic(vbox); } else { setGraphic(null); } } }; } }); } }; new Thread(tarea).start(); }
From source file:Main.java
private static VBox createVBox(final double spacing, final Node... children) { final VBox vbox = new VBox(spacing); vbox.getChildren().addAll(children); return vbox;/*from w ww .ja va2 s . c o m*/ }
From source file:com.github.drbookings.ui.controller.UpcomingController.java
private void addEvents(final LocalDate date, final Collection<BookingEntry> upcomingBookings, final Collection<CleaningEntry> upcomingCleanings) { final VBox box = new VBox(4); if (date.equals(LocalDate.now())) { box.getStyleClass().add("first-day"); } else if (date.equals(LocalDate.now().plusDays(1))) { box.getStyleClass().add("second-day"); } else if (date.isAfter(LocalDate.now().plusDays(1))) { box.getStyleClass().add("later"); }//from w w w . j a va 2s. c o m if (upcomingBookings.stream().filter(b -> b.isCheckIn() || b.isCheckOut()).collect(Collectors.toList()) .isEmpty() && upcomingCleanings.isEmpty()) { final Text t0 = new Text(getDateString(date)); final Text t1 = new Text(" there are no events."); t0.getStyleClass().add("emphasis"); final TextFlow tf = new TextFlow(); tf.getChildren().addAll(t0, t1); box.getChildren().addAll(tf); } else { final List<CheckInOutDetails> checkInNotes = Collections.synchronizedList(new ArrayList<>()); final List<CheckInOutDetails> checkOutNotes = Collections.synchronizedList(new ArrayList<>()); upcomingBookings.forEach(b -> { if (b.isCheckIn()) { String note = ""; if (b.getElement().getCheckInNote() != null) { note = b.getElement().getCheckInNote(); } if (b.getElement().getSpecialRequestNote() != null) { note = note + "\n" + b.getElement().getSpecialRequestNote(); } checkInNotes.add(new CheckInOutDetails(b.getRoom().getName(), b.getElement().getBookingOrigin().getName(), note)); } else if (b.isCheckOut()) { checkOutNotes.add(new CheckInOutDetails(b.getRoom().getName(), b.getElement().getBookingOrigin().getName(), b.getElement().getCheckOutNote())); } }); Collections.sort(checkInNotes); Collections.sort(checkOutNotes); addGeneralSummary(date, box, checkInNotes); addCheckOutSummary(date, box, checkOutNotes); addCheckOutNotes(date, box, checkOutNotes); addCheckInSummary(date, box, checkInNotes); addCheckInNotes(date, box, checkInNotes); addCleaningSummary(date, box, upcomingCleanings); addCleanings(date, box, upcomingCleanings); } this.box.getChildren().add(box); }
From source file:com.github.drbookings.ui.controller.BookingDetailsController.java
private void addBookingEntry(final BookingBean be) { // System.err.println("Adding entry for " + be); final VBox box = new VBox(4); // box.setPadding(new Insets(4)); addRow0(box, be);//from ww w. j av a 2 s . c om box.getChildren().add(new Separator()); addRowNetEarnings(box, be); box.getChildren().add(new Separator()); addRowFees(box, be); box.getChildren().add(new Separator()); addRow4(box, be); box.getChildren().add(new Separator()); addRow5(box, be); box.getChildren().add(new Separator()); addRow1(box, be); addRow2(box, be); addModifyButton(box, be); content.getChildren().add(box); }
From source file:de.pixida.logtest.designer.testrun.TestRunEditor.java
private void insertConfigItemsIntoGrid(final GridPane gp, final List<Triple<String, Node, String>> formItems) { for (int i = 0; i < formItems.size(); i++) { final String title = formItems.get(i).getLeft(); final Node inputElement = formItems.get(i).getMiddle(); final String description = formItems.get(i).getRight(); // Put text flow object into cell. If a Text instance is used only, it will grab the whole cell size and center the text // (horizontally and vertically). Therefore, the table cell alignment does not work. final TextFlow titleText = new TextFlow(new Text(title)); titleText.setStyle("-fx-font-weight: bold;"); final TextFlow fieldName = new TextFlow(titleText); fieldName.autosize();/* ww w . j ava2s . com*/ fieldName.setMinWidth(fieldName.getWidth()); gp.add(fieldName, 0, i); final VBox vbox = new VBox(inputElement); if (StringUtils.isNotBlank(description)) { vbox.getChildren().add(new TextFlow(new Text(description))); } gp.add(vbox, 1, i); } }
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 {//from w w w. j a 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." }
From source file:editeurpanovisu.EditeurPanovisu.java
/** * * @param lstPano// w ww. j a v a2 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: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 www . j a 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 } }); }