List of usage examples for org.apache.poi.xwpf.usermodel XWPFRun addBreak
public void addBreak()
From source file:eremeykin.pete.reports.ui.ReportAction.java
@Override public void actionPerformed(ActionEvent e) { resultChanged(null);//from www. j av a 2 s.co m if (model == null) { return; } XWPFDocument doc = new XWPFDocument(); XWPFParagraph p1 = doc.createParagraph(); p1.setAlignment(ParagraphAlignment.CENTER); p1.setVerticalAlignment(TextAlignment.TOP); XWPFRun r1 = p1.createRun(); r1.setBold(true); r1.setText(""); r1.setBold(true); r1.setFontFamily("Times New Roman"); r1.setFontSize(24); r1.setTextPosition(10); XWPFParagraph p2 = doc.createParagraph(); p2.setAlignment(ParagraphAlignment.LEFT); p2.setVerticalAlignment(TextAlignment.CENTER); XWPFRun r2 = p2.createRun(); r2.setText(" ? : "); r2.setBold(false); r2.setFontFamily("Times New Roman"); r2.setFontSize(14); r2.setTextPosition(10); XWPFTable table = doc.createTable(1, 2); table.getCTTbl().addNewTblPr().addNewTblW().setW(BigInteger.valueOf(9000)); ModelParameter root = model.getRoot(); int row = 1; Map.Entry<ModelParameter, Integer> kv = model.getParameterAndLevelByID(root, 0); ModelParameter parameter = kv.getKey(); Integer level = kv.getValue(); ArrayList<Integer> ids = new ArrayList(model.asMap().keySet()); Collections.sort(ids); for (Integer each : ids) { table.createRow(); String text = ""; kv = model.getParameterAndLevelByID(root, each); parameter = kv.getKey(); level = kv.getValue(); for (int c = 0; c < level; c++) { text += " "; } table.getRow(row - 1).getCell(0).setText(text + parameter.toString()); table.getRow(row - 1).getCell(1).setText(parameter.getValue()); row++; } table.setWidth(80); XWPFParagraph p3 = doc.createParagraph(); p3.setAlignment(ParagraphAlignment.LEFT); p3.setVerticalAlignment(TextAlignment.CENTER); XWPFRun r3 = p3.createRun(); r3.addBreak(); r3.setText("\n : "); r3.setBold(false); r3.setFontFamily("Times New Roman"); r3.setFontSize(14); File uPlotFile = new File(WorkspaceManager.INSTANCE.getWorkspace().getAbsolutePath() + "/uplot.png"); try { byte[] picbytes = IOUtils.toByteArray(new FileInputStream(uPlotFile)); doc.addPictureData(picbytes, XWPFDocument.PICTURE_TYPE_PNG); XWPFRun pr = doc.createParagraph().createRun(); pr.addPicture(new FileInputStream(uPlotFile), Document.PICTURE_TYPE_PNG, "plot.png", Units.toEMU(450), Units.toEMU(337)); pr.addCarriageReturn(); pr.addBreak(BreakType.PAGE); pr.addBreak(BreakType.TEXT_WRAPPING); } catch (Exception ex) { Exceptions.printStackTrace(ex); } XWPFParagraph p4 = doc.createParagraph(); p4.setAlignment(ParagraphAlignment.LEFT); p4.setVerticalAlignment(TextAlignment.CENTER); XWPFRun r4 = p4.createRun(); r4.addBreak(); r4.setText("\n ?: "); r4.setBold(false); r4.setFontFamily("Times New Roman"); r4.setFontSize(14); File sPlotFile = new File(WorkspaceManager.INSTANCE.getWorkspace().getAbsolutePath() + "/splot.png"); try { byte[] picbytes = IOUtils.toByteArray(new FileInputStream(sPlotFile)); doc.addPictureData(picbytes, XWPFDocument.PICTURE_TYPE_PNG); XWPFParagraph pp = doc.createParagraph(); pp.createRun().addPicture(new FileInputStream(sPlotFile), Document.PICTURE_TYPE_PNG, "plot.png", Units.toEMU(450), Units.toEMU(337)); } catch (Exception ex) { Exceptions.printStackTrace(ex); } File reportFile = new File("report.docx"); try (FileOutputStream out = new FileOutputStream(reportFile)) { doc.write(out); if (Desktop.isDesktopSupported()) { Desktop.getDesktop().edit(reportFile); } else { } } catch (IOException ex) { Exceptions.printStackTrace(ex); } }
From source file:library.Form_Library.java
private void btPrintReaderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btPrintReaderActionPerformed try {//from w ww .j ava2 s .com // TODO add your handling code here: FileOutputStream fos = new FileOutputStream(tfID.getText() + " - " + tfName.getText() + ".docx"); XWPFDocument doc = new XWPFDocument(); XWPFParagraph paraTit = doc.createParagraph(); paraTit.setAlignment(ParagraphAlignment.CENTER); XWPFRun paraTitRun = paraTit.createRun(); paraTitRun.setBold(true); paraTitRun.setText("Reader Information"); paraTitRun.setFontFamily("Times New Roman"); paraTitRun.setFontSize(20); String content = this.taPrintReader.getText(); XWPFRun paraTitRun2 = doc.createParagraph().createRun(); paraTitRun2.setFontFamily("Times New Roman"); paraTitRun2.setFontSize(16); if (content.contains("\n")) { String[] lines = content.split("\n"); paraTitRun2.setText(lines[0], 0); // set first line into XWPFRun for (int i = 1; i < lines.length; i++) { // add break and insert new text paraTitRun2.addBreak(); paraTitRun2.setText(lines[i]); } } else { paraTitRun2.setText(content, 0); } doc.write(fos); fos.close(); JOptionPane.showMessageDialog(null, "The document created successfully!!"); } catch (IOException ex) { JOptionPane.showMessageDialog(null, ex); } }
From source file:nl.detoren.ijc.io.OutputIntekenlijst.java
License:Open Source License
public boolean export(Groepen groepen) { try {//w ww . j a va 2 s . c om logger.log(Level.INFO, "Wedstrijden wegschrijven naar Excel"); FileInputStream file = new FileInputStream("Leeg.docx"); XWPFDocument document = new XWPFDocument(file); XWPFParagraph paragraph = document.getLastParagraph(); setDoubleLineSpacing(paragraph); XWPFRun run = paragraph.createRun(); run.setFontFamily("Courier New"); run.setFontSize(12); String result; result = "Intekenlijst aangemaakt met " + IJCController.c().appTitle + " voor " + IJCController.c().verenigingNaam; run.setText(result); run.addCarriageReturn(); // separate previous text from break for (int i = 0; i < groepen.getAantalGroepen(); ++i) { if (i >= 1) run.addBreak(); Groep groep = groepen.getGroepById(i); result = "Stand na " + groepen.getRonde() + "e ronde, " + groepen.getPeriode(); result += "e periode " + groep.getNaam() + " (" + groep.getSpelers().size() + ")\n"; run.setText(result); run.addBreak(); result = " Naam ini zw rating gespeeld tegen pnt\n"; run.setText(result); run.addBreak(); result = "-----------------------------------------------------------------------\n"; run.setText(result); run.addBreak(); for (Speler s : groep.getSpelers()) { result = s.toPrintableString(false); run.setText(result); run.addBreak(); } if (IJCController.c().exportDoorschuivers) { int ndoor = IJCController.c().bepaalAantalDoorschuiversVolgendeRonde(groep.getNiveau(), groepen.getPeriode(), groepen.getRonde()); if (i - 1 >= 0) { run.setText(IJCController.c().exportDoorschuiversStart + "\n"); run.addBreak(); Groep lager = groepen.getGroepById(i - 1); if (ndoor > 1) { for (int j = 0; j < ndoor; j++) { Speler s = lager.getSpelerByID(j + 1); run.setText(s.toPrintableString(false, true) + "\n"); run.addBreak(); } run.setText(IJCController.c().exportDoorschuiversStop + "\n" + "\n"); } else { // Bij n doorschuiver, alleen doorschuiven als // kampioen Speler s1 = lager.getSpelerByID(1); Speler s2 = lager.getSpelerByID(2); if ((s2 != null) && ((s1.getPunten() - s2.getPunten()) > 4)) { run.setText(s1.toPrintableString(false, true) + "\n"); run.addBreak(); } } } } run.addCarriageReturn(); // separate previous text from break run.addBreak(BreakType.PAGE); } // Close input file file.close(); // Store Excel to new file String dirName = "R" + groepen.getPeriode() + "-" + groepen.getRonde(); new File(dirName).mkdirs(); String filename = dirName + File.separator + "IntekenlijstR" + groepen.getPeriode() + "-" + groepen.getRonde() + ".docx"; File outputFile = new File(filename); FileOutputStream outFile = new FileOutputStream(outputFile); document.write(outFile); // Close output file document.close(); outFile.close(); // And open it in the system editor //Desktop.getDesktop().open(new File(outputFile)); return true; } catch (Exception ex) { logger.log(Level.WARNING, "Export mislukt :" + ex.getMessage()); Utils.stacktrace(ex); return false; } }
From source file:offishell.word.WordHeleper.java
License:MIT License
/** * <p>/* w w w .j a v a2 s . c o m*/ * Write the text. * </p> * * @param run * @param text */ public static void write(XWPFRun run, String text) { String[] lines = text.split("\n"); if (lines.length != 0) { run.setText(lines[0], 0); // set first line into XWPFRun for (int i = 1; i < lines.length; i++) { run.addBreak(); run.setText(lines[i]); } } }
From source file:org.cgiar.ccafs.marlo.utils.POISummary.java
License:Open Source License
private void addParagraphTextBreak(XWPFRun paragraphRun, String text) { if (text.contains("\n")) { String[] lines = text.split("\n"); paragraphRun.setText(lines[0], 0); // set first line into XWPFRun for (int i = 1; i < lines.length; i++) { // add break and insert new text paragraphRun.addBreak(); paragraphRun.setText(lines[i]); }//from w w w . ja v a2s.co m } else { paragraphRun.setText(text, 0); } }
From source file:org.eclipse.sw360.licenseinfo.outputGenerators.DocxUtils.java
License:Open Source License
public static void setText(XWPFRun run, String text) { String[] split = text.split("\n"); run.setText(split[0]);/*ww w . j a va 2s . c o m*/ for (int i = 1; i < split.length; i++) { run.addBreak(); run.setText(split[i]); } }
From source file:org.eclipse.sw360.licenseinfo.outputGenerators.DocxUtils.java
License:Open Source License
private static void replaceParagraph(XWPFParagraph paragraph, String placeHolder, String replaceText) { for (XWPFRun run : paragraph.getRuns()) { String text = run.getText(run.getTextPosition()); if (text != null && text.contains(placeHolder)) { text = text.replace(placeHolder, replaceText); String[] split = text.split("\n"); run.setText(split[0], 0);/*from w w w . j av a2 s. com*/ for (int i = 1; i < split.length; i++) { run.addBreak(); run.setText(split[i]); } } } }
From source file:org.obeonetwork.m2doc.generator.M2DocEvaluator.java
License:Open Source License
/** * Insert the given text into to given {@link XWPFRun}. This take care of new lines and tabulations. * //from w w w . ja v a2 s . c o m * @param srcRun * the {@link XWPFRun} to populate * @param text * the text * @return the last inserted {@link XWPFRun}. */ private XWPFRun insertString(XWPFRun srcRun, String text) { int fragmentStart = 0; XWPFRun inserted; for (int i = 0; i < text.length(); i++) { final char current = text.charAt(i); switch (current) { case '\n': inserted = insertFragment(srcRun, text.substring(fragmentStart, i)); inserted.addBreak(); fragmentStart = i + 1; break; case '\t': inserted = insertFragment(srcRun, text.substring(fragmentStart, i)); inserted.addTab(); fragmentStart = i + 1; break; case '\r': // CHECKSTYLE:OFF if (i + 1 < text.length() && text.charAt(i + 1) == '\n') { inserted = insertFragment(srcRun, text.substring(fragmentStart, i)); inserted.addBreak(); i++; fragmentStart = i + 1; } // CHECKSTYLE:ON break; default: break; } } return insertFragment(srcRun, text.substring(fragmentStart, text.length())); }
From source file:org.roiderh.machinetoolconfsheet.CreateMachineToolConfSheetAction.java
License:Open Source License
@Override public void actionPerformed(ActionEvent e) { BaseDocument doc = null;// www. ja v a2s . c o m JTextComponent ed = org.netbeans.api.editor.EditorRegistry.lastFocusedComponent(); if (ed == null) { JOptionPane.showMessageDialog(null, "Error: no open editor"); //NOI18N return; } FileObject fo = NbEditorUtilities.getFileObject(ed.getDocument()); String path = fo.getPath(); InputStream is = new ByteArrayInputStream(ed.getText().getBytes()); BufferedReader br; br = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8"))); //NOI18N ArrayList<String> lines = new ArrayList<>(); try { String line; while ((line = br.readLine()) != null) { lines.add(line); System.out.println(line); } } catch (IOException x) { JOptionPane.showMessageDialog(null, "Error: " + x.getLocalizedMessage()); //NOI18N } TreeMap<Integer, Tool> tools = new TreeMap<>(); ArrayList<String> programs = new ArrayList<>(); int activ_tool = -1; // Read all Tools with comments: for (int i = lines.size() - 1; i >= 0; i--) { String line = lines.get(i).trim(); Matcher tool_change_command = Pattern.compile("(T)([0-9])+").matcher(line); //NOI18N if (line.startsWith("(") || line.startsWith(";")) { //NOI18N if (activ_tool >= 0) { Tool t = tools.get(activ_tool); if (line.startsWith("(")) { //NOI18N line = line.substring(1, line.length() - 1); } else { line = line.substring(1, line.length()); } t.text.add(line); tools.put(activ_tool, t); } } else if (line.trim().startsWith("%")) { //NOI18N activ_tool = -1; } else if (tool_change_command.find()) { String ts = line.substring(tool_change_command.start() + 1, tool_change_command.end()); activ_tool = Integer.parseInt(ts); if (!tools.containsKey(activ_tool)) { tools.put(activ_tool, new Tool()); } } else if (line.contains("M30") || line.contains("M17") || line.contains("M2") || line.contains("M02") || line.contains("RET")) { //NOI18N activ_tool = -1; } else { activ_tool = -1; } //System.out.println("line=" + line); } boolean is_header = false; ArrayList<String> header = new ArrayList<>(); // Read the Comments at the beginning of the file: for (int i = 0; i < lines.size(); i++) { String line = lines.get(i).trim(); if (line.trim().startsWith("%")) { //NOI18N is_header = true; //programs.add(line.replaceAll(" ", "")); //NOI18N programs.add(this.parse_progname(line)); //header.add(line.replaceAll(" ", "")); //NOI18N } else if (line.trim().startsWith("(") || line.trim().startsWith(";")) { //NOI18N if (is_header) { if (line.trim().startsWith("(")) { //NOI18N line = line.trim().substring(1, line.length() - 1); } else { line = line.trim().substring(1, line.length()); } if (line.startsWith("$PATH=/_N_") || line.length() < 1) { //NOI18N } else { header.add(line.trim()); } } } else { is_header = false; } } try { Date dNow = new Date(); SimpleDateFormat ft = new SimpleDateFormat("dd.MM.yyyy"); //NOI18N System.out.println("Current Date: " + ft.format(dNow)); //NOI18N InputStream in = CreateMachineToolConfSheetAction.class .getResourceAsStream("/org/roiderh/machinetoolconfsheet/resources/base_document.docx"); //NOI18N XWPFDocument document = new XWPFDocument(in); //Write the Document in file system File tempFile = File.createTempFile("NcToolSettings_", ".docx"); //NOI18N try (FileOutputStream out = new FileOutputStream(tempFile)) { XWPFTable table = document.getTableArray(0); XWPFParagraph title = document.getParagraphArray(0); XWPFRun run = title.createRun(); run.setText(org.openide.util.NbBundle.getMessage(CreateMachineToolConfSheetAction.class, "MachineToolConfSheet")); title = document.getParagraphArray(1); run = title.createRun(); run.setText(org.openide.util.NbBundle.getMessage(CreateMachineToolConfSheetAction.class, "Tools")); String prog = String.join(", ", programs); //NOI18N table.getRow(0).getCell(0).setText( org.openide.util.NbBundle.getMessage(CreateMachineToolConfSheetAction.class, "ProgNr")); table.getRow(0).getCell(1).setText(prog); table.getRow(1).getCell(0).setText( org.openide.util.NbBundle.getMessage(CreateMachineToolConfSheetAction.class, "Filename")); table.getRow(1).getCell(1).setText(path); table.getRow(2).getCell(0).setText( org.openide.util.NbBundle.getMessage(CreateMachineToolConfSheetAction.class, "Date")); table.getRow(2).getCell(1).setText(ft.format(dNow)); ArrayList<ArrayList<String>> table_text = new ArrayList<>(); for (int i = 0; i < header.size(); i++) { ArrayList<String> line = new ArrayList<>(); String name; // first column String desc; // second column int splitpos = header.get(i).indexOf(":");//NOI18N if (splitpos > 1 && splitpos < 25) { name = header.get(i).substring(0, splitpos).trim(); desc = header.get(i).substring(splitpos + 1).trim(); } else { name = "";//NOI18N desc = header.get(i).trim(); } line.add(name); line.add(desc); table_text.add(line); } XWPFTableRow tableRowHeader; //tableRowHeader = table.createRow(); tableRowHeader = null; XWPFRun run_table; String prev_name = "dummy_1234567890sadfsaf"; //NOI18N for (int i = 0; i < table_text.size(); i++) { String name = table_text.get(i).get(0); String desc = table_text.get(i).get(1); if (name.length() > 0) { tableRowHeader = table.createRow(); run_table = tableRowHeader.getCell(1).getParagraphs().get(0).createRun(); tableRowHeader.getCell(0).setText(name); run_table.setText(desc); } else if (prev_name.length() > 0 && name.length() == 0) { tableRowHeader = table.createRow(); run_table = tableRowHeader.getCell(1).getParagraphs().get(0).createRun(); tableRowHeader.getCell(0).setText(""); //NOI18N run_table.setText(desc); } else if (prev_name.length() == 0 && name.length() == 0) { if (tableRowHeader == null) { tableRowHeader = table.createRow(); } run_table = tableRowHeader.getCell(1).getParagraphs().get(0).createRun(); run_table.addBreak(); run_table.setText(desc); } prev_name = name; } table = document.getTableArray(1); boolean first_line = true; Set keys = tools.keySet(); for (Iterator i = keys.iterator(); i.hasNext();) { int toolnr = (Integer) i.next(); Tool t = tools.get(toolnr); XWPFTableRow tableRowTwo; if (first_line) { tableRowTwo = table.getRow(0); first_line = false; } else { tableRowTwo = table.createRow(); } tableRowTwo.getCell(0).setText("T" + String.valueOf(toolnr)); //NOI18N // The lines are in the reverse order, therfore reordering: for (int j = t.text.size() - 1; j >= 0; j--) { XWPFRun run_tool = tableRowTwo.getCell(1).getParagraphs().get(0).createRun(); run_tool.setText(t.text.get(j)); if (j > 0) { run_tool.addBreak(); } } } document.write(out); } System.out.println("create_table.docx written successully"); //NOI18N Runtime rt = Runtime.getRuntime(); String os = System.getProperty("os.name").toLowerCase();//NOI18N String[] command = new String[2]; //command[0] = "soffice"; Preferences pref = NbPreferences.forModule(WordProcessingProgramPanel.class); command[0] = pref.get("executeable", "").trim();//NOI18N command[1] = tempFile.getCanonicalPath(); File f = new File(command[0]); if (!f.exists()) { JOptionPane.showMessageDialog(null, "Error: program not found: " + command[0]); //NOI18N return; } Process proc = rt.exec(command); //NOI18N //System.out.println("ready created: " + tempFile.getCanonicalPath()); //NOI18N } catch (IOException | MissingResourceException ex) { JOptionPane.showMessageDialog(null, "Error: " + ex.getLocalizedMessage()); //NOI18N } }
From source file:patientmanagerv1.HomeController.java
public void writeEvalToDocX(boolean customPath, String path) { FileOutputStream outstream;/*from w w w. j a v a 2 s . c o m*/ try { if (customPath == false) { outstream = new FileOutputStream(installationPath + "/userdata/" + firstName + lastName + dob + "/" + firstName + lastName + dob + "psychiatricevaluation.docx"); } else { outstream = new FileOutputStream(path + ".docx"); } XWPFDocument doc = new XWPFDocument(); //due to the redirection of these e's, even physically, your str will begin to deteriorate. Corpse-like, in other words. /*XWPFParagraph para = doc.createParagraph(); para.setAlignment(ParagraphAlignment.CENTER); XWPFRun paraRun = para.createRun(); paraRun.setBold(true); paraRun.setFontSize(12); //paraRun.setFontSize(16); paraRun.setText("Hello World");*/ XWPFParagraph header = doc.createParagraph(); //Paragraph XWPFRun headerLabel = header.createRun(); //Where the text will be written from header.setAlignment(ParagraphAlignment.CENTER); headerLabel.setFontFamily("16"); headerLabel.setBold(true); headerLabel.setText("Advanced Psychiatric Associates"); headerLabel.addBreak(); headerLabel.setText("Psychiatric Evaluation"); headerLabel.addBreak(); XWPFParagraph p = doc.createParagraph(); //Paragraph XWPFRun run = p.createRun(); //Where the text will be written from XWPFRun run2 = p.createRun(); XWPFRun run3 = p.createRun(); XWPFRun run4 = p.createRun(); XWPFRun run5 = p.createRun(); XWPFRun run6 = p.createRun(); XWPFRun run7 = p.createRun(); XWPFRun run8 = p.createRun(); XWPFRun run9 = p.createRun(); XWPFRun run10 = p.createRun(); XWPFRun run11 = p.createRun(); XWPFRun run12 = p.createRun(); XWPFRun run13 = p.createRun(); XWPFRun run14 = p.createRun(); XWPFRun run15 = p.createRun(); XWPFRun run16 = p.createRun(); XWPFRun run17 = p.createRun(); XWPFRun run18 = p.createRun(); XWPFRun anEdit1 = p.createRun(); XWPFRun run19 = p.createRun(); XWPFRun run20 = p.createRun(); XWPFRun run21 = p.createRun(); XWPFRun run22 = p.createRun(); XWPFRun run23 = p.createRun(); XWPFRun run24 = p.createRun(); XWPFRun run25 = p.createRun(); XWPFRun run26 = p.createRun(); XWPFRun run27 = p.createRun(); XWPFRun run28 = p.createRun(); XWPFRun run29 = p.createRun(); XWPFRun run30 = p.createRun(); XWPFRun run31 = p.createRun(); //Where the text will be written from XWPFRun run32 = p.createRun(); XWPFRun run33 = p.createRun(); XWPFRun run34 = p.createRun(); XWPFRun run35 = p.createRun(); XWPFRun run36 = p.createRun(); XWPFRun run37 = p.createRun(); XWPFRun run38 = p.createRun(); XWPFRun run39 = p.createRun(); XWPFRun run40 = p.createRun(); XWPFRun run41 = p.createRun(); XWPFRun run42 = p.createRun(); XWPFRun run42Bold = p.createRun(); XWPFRun runPre43 = p.createRun(); XWPFRun run43 = p.createRun(); XWPFRun run44 = p.createRun(); XWPFRun run45 = p.createRun(); XWPFRun run46 = p.createRun(); XWPFRun run47 = p.createRun(); XWPFRun run48 = p.createRun(); XWPFRun run49 = p.createRun(); XWPFRun run50 = p.createRun(); XWPFRun run51 = p.createRun(); XWPFRun run52 = p.createRun(); XWPFRun run53 = p.createRun(); XWPFRun run54 = p.createRun(); XWPFRun run55 = p.createRun(); XWPFRun run56 = p.createRun(); XWPFRun run57 = p.createRun(); XWPFRun run58 = p.createRun(); XWPFRun run59 = p.createRun(); XWPFRun run60 = p.createRun(); run.setBold(true); run2.setBold(false); run3.setBold(true); run4.setBold(false); run5.setBold(true); run6.setBold(false); run7.setBold(true); run8.setBold(false); run9.setBold(true); run10.setBold(false); run11.setBold(true); run12.setBold(false); run13.setBold(true); run14.setBold(false); run15.setBold(true); run16.setBold(false); run17.setBold(true); run18.setBold(false); run19.setBold(true); run20.setBold(false); run21.setBold(true); run22.setBold(false); run23.setBold(true); run24.setBold(false); run25.setBold(true); run26.setBold(false); run27.setBold(true); run28.setBold(false); run29.setBold(true); run30.setBold(false); /* @FXML AnchorPane ap; @FXML TextField first, last, ageText, dobText; @FXML TextField ethnicityothertext; @FXML RadioButton male, female; @FXML RadioButton single, engaged, married, seperated, divorced, commonlawspouse, cohabiting; @FXML CheckBox africanamerican, nativeamerican, hispanic, asian, caucasian, ethnicityother, ocd, bipolardisorder, socialphobia, panicdisorder, eatingdisorder, majordepressivedisorder, psychosis; @FXML RadioButton insurance, internet, pcp, cps, therapist, referredbyother; @FXML TextField referredbytherapisttext, referredbyothertext, reasonforreferralbox; @FXML Button sign, saveButton; @FXML Label signature; @FXML CheckBox patient, spouse, mother, father, othersourceofinformation, emp, unemp, disabilityincome; @FXML TextField othersourceofinformationbox, otherreliabilityofinformationbox; @FXML RadioButton good, fair, vague, minimizing, otherreliabilityofinformation, sano, sayes, physicalabuseno, physicalabuseyes, sexualabuseno, sexualabuseyes, violentaggressivebehaviorsno, violentaggressivebehaviorsyes, selfinjuriousbehaviorsno, selfinjuriousbehaviorsyes; @FXML TextArea historyofpresentillness, currentmedications, pastpsychiatrichistory, pasthistoryoftext, historyofmedicationtrialsinthepasttable, historyofmedicationtrialsinthepastcomments, substanceusehistory; @FXML ListView listOfProgressReports; @FXML CheckBox significantwithdrawals, dts, withdrawalseizures, historyofdetox, outpatient, inpatient, na, aa, substancetreatmentprogram, nkda, environmental; @FXML TextField inpatientbox, parents, siblings, children, education, allergiesdescriptionbox; @FXML TextArea socialhistorygeneral, familyhistoryofmentalillness, legalhistory, pastmedicalhistory; @FXML RadioButton fhomiNO, fhomiYES, eyecontactgood, eyecontactpoor, eyecontactvariable; @FXML TextField appearanceotherbox, attitudeotherbox, motoractivityotherbox; @FXML CheckBox wellgroomed, casual, disheveled, bizarre, inappropriate, appearanceother, cooperative, guarded, suspicious, withdrawn, uncooperative, hostile, defensive, attitudeother; @FXML CheckBox normal, agitated, motorretardation, hyperactive, catatonia, tremorstics, motoractivityother; @FXML CheckBox appropriate, labile, expansive, constricted, affecthappy, affectsad, blunted, flat, masking, affectnormalrange; @FXML CheckBox euthymic, depressed, dysphoric, anxious, euphoric, angry, irritable, moodsad; @FXML CheckBox normal2, delayed, soft, loud, slurred, excessive, pressured, perseverating, rapid, rambling, incoherent, disorganized, decreasedproductivity; @FXML CheckBox intact, circumstantial, loa, tangential, foi, logicalgoaldirected, thoughtblocking, ruminating, racingthoughts, thoughtinsertionwithdrawalbroadcast; */ //alternative solution: so I guess, a seperate run for each form element, followed by an if statement //run is created here if(divorced.isSelected == "true"){run.setBold(true); run.setText("divorced");} else {run.setBold(false); run.setText("divorced")} //single, engaged, married, seperated, divorced, commonlawspouse, cohabiting; //greater: MM, gbits, (much) lesser: id'ing run.setText("Patient Name: "); //doc.write(outstream); //outstream.close(); // doc.createParagraph().createRun().setBold(true); //run.setBold(false); //run.setText("Ciel Phantomhive"); run2.setText(first.getText() + " " + last.getText()); run3.setText(" Age: "); //run2.setTextPosition(run2.getTextPosition()); run4.setText(ageText.getText()); run5.setText(" DOB: "); run6.setText(dobText.getText()); run6.addBreak(); run6.addBreak(); run7.setBold(false); run7.setText("Marital Status: "); //single, engaged, married, seperated, divorced, commonlawspouse, cohabiting; if (single.isSelected()) { run7.setText(" Single"); } if (engaged.isSelected()) { run7.setText(" Engaged"); } if (married.isSelected()) { run7.setText(" Married"); } if (seperated.isSelected()) { run7.setText(" Seperated"); } if (divorced.isSelected()) { run7.setText(" Divorced"); } if (commonlawspouse.isSelected()) { run7.setText(" Common Law Spouse"); } if (cohabiting.isSelected()) { run7.setText(" Cohabiting"); } run7.addBreak(); run7.setText("Ethnicity: "); //africanamerican, nativeamerican, hispanic, asian, caucasian, ethnicityother, ocd, bipolardisorder, socialphobia, panicdisorder, eatingdisorder, majordepressivedisorder, psychosis; if (africanamerican.isSelected()) { run7.setText(" African American"); } if (nativeamerican.isSelected()) { run7.setText(" Native American"); } if (hispanic.isSelected()) { run7.setText(" Hispanic"); } if (asian.isSelected()) { run7.setText(" Asian"); } if (caucasian.isSelected()) { run7.setText(" Caucasian"); } if (ethnicityother.isSelected()) { run7.setText(" " + ethnicityothertext.getText()); } run7.addBreak(); run7.setText("Sex: "); if (male.isSelected()) { run7.setText(" Male"); } if (female.isSelected()) { run7.setText(" Female"); } run7.addBreak(); run7.setText("Referred By: "); //insurance, internet, pcp, cps, therapist, referredbyother if (insurance.isSelected()) { run7.setText(" Insurance"); } if (internet.isSelected()) { run7.setText(" Internet"); } if (pcp.isSelected()) { run7.setText(" PCP"); } if (cps.isSelected()) { run7.setText(" CPS"); } if (therapist.isSelected()) { run7.setText(" therapist- " + referredbytherapisttext.getText()); } if (referredbyother.isSelected()) { run7.setText(" " + referredbyothertext.getText()); } run7.addBreak(); run7.setText("Reason for Referral: "); if (reasonforreferralpsychiatricevaluation.isSelected()) { run7.setText(" Psychiatric Evaluation"); } if (reasonforreferralmedicationmanagement.isSelected()) { run7.setText(" Medication Management"); } run7.addBreak(); run7.setText("Source of Information: "); //insurance, internet, pcp, cps, therapist, referredbyother if (patient.isSelected()) { run7.setText(" Patient"); } if (spouse.isSelected()) { run7.setText(" Spouse"); } if (mother.isSelected()) { run7.setText(" Mother"); } if (father.isSelected()) { run7.setText(" Father"); } if (othersourceofinformation.isSelected()) { run7.setText(" " + othersourceofinformationbox.getText()); } run7.addBreak(); run7.setText("Reliability of Information: "); //insurance, internet, pcp, cps, therapist, referredbyother if (good.isSelected()) { run7.setText(" Good"); } if (fair.isSelected()) { run7.setText(" Fair"); } if (vague.isSelected()) { run7.setText(" Vague"); } if (minimizing.isSelected()) { run7.setText(" Minimizing"); } if (otherreliabilityofinformation.isSelected()) { run7.setText(" " + otherreliabilityofinformationbox.getText()); } run7.setText(" (Options: good, fair, vague, minimizing, other)"); run7.addBreak(); run7.addBreak(); run8.setBold(true); run8.setUnderline(UnderlinePatterns.SINGLE); run8.setText("History of Present Illness"); run8.addBreak(); run9.setBold(false); run9.setText(historyofpresentillness.getText()); run9.addBreak(); run9.addBreak(); run10.setBold(true); run10.setText("Patient denied signs or symptoms of: "); run11.setBold(false); //ocd, bipolardisorder, socialphobia, panicdisorder, eatingdisorder, majordepressivedisorder, psychosis if (ocd.isSelected() == true) { run11.setText(" OCD"); } if (bipolardisorder.isSelected() == true) { run11.setText(" Bipolar Disorder"); } if (socialphobia.isSelected() == true) { run11.setText(" Social Phobia"); } if (panicdisorder.isSelected() == true) { run11.setText(" Panic Disorder"); } if (eatingdisorder.isSelected() == true) { run11.setText(" Eating Disorder"); } if (majordepressivedisorder.isSelected() == true) { run11.setText(" Major Depressive Disorder"); } if (psychosis.isSelected() == true) { run11.setText(" Psychosis"); } run11.addBreak(); run11.addBreak(); run12.setUnderline(UnderlinePatterns.SINGLE); run12.setBold(true); run12.setText("Current Medications (including over-the-counter medications and vitamins)"); run12.addBreak(); run13.setBold(false); run13.setText(currentmedications.getText()); run13.addBreak(); run13.addBreak(); run14.setUnderline(UnderlinePatterns.SINGLE); run14.setBold(true); run14.setText("Past Psychiatric History"); run14.addBreak(); run15.setBold(false); run15.setText(pastpsychiatrichistory.getText()); run15.addBreak(); run15.addBreak(); run16.setBold(true); run16.setText("Past History Of"); run16.addBreak(); run17.setBold(false); run17.setText("Suicide Attempts: "); //past history of if (sano.isSelected() == true) { run17.setText("No"); } else if (sayes.isSelected() == true) { run17.setText("Yes"); } run17.addBreak(); if (physicalabuseno.isSelected() == true) { run17.setText("Physical Abuse: No"); } else if (physicalabuseyes.isSelected() == true) { run17.setText("Physical Abuse: Yes"); } run17.addBreak(); if (sexualabuseno.isSelected() == true) { run17.setText("Sexual Abuse: No"); } else if (sexualabuseyes.isSelected() == true) { run17.setText("Sexual Abuse: Yes"); } run17.addBreak(); if (violentaggressivebehaviorsno.isSelected() == true) { run17.setText("Violent/Aggressive Behaviors: No"); } else if (violentaggressivebehaviorsyes.isSelected() == true) { run17.setText("Violent/Aggressive Behaviors: Yes"); } run17.addBreak(); if (selfinjuriousbehaviorsno.isSelected() == true) { run17.setText("Self-Injurious Behaviors: No"); } else if (selfinjuriousbehaviorsyes.isSelected() == true) { run17.setText("Self-Injurious Behaviors: Yes"); } run17.addBreak(); run17.setText(pasthistoryoftext.getText()); run17.addBreak(); run17.addBreak(); run18.setUnderline(UnderlinePatterns.SINGLE); run18.setBold(true); run18.setText("History of Medication Trials in the Past"); run18.addBreak(); anEdit1.setBold(true); anEdit1.setText( "Medication Dosage Duration"); anEdit1.addBreak(); run19.setBold(false); String fulltext = historyofmedicationtrialsinthepasttable.getText(); String[] lines = fulltext.split("\n"); for (int i = 0; i < lines.length; i++) { String[] modifyThis = lines[i].split(" "); for (int j = 0; j < modifyThis.length; j++) { run19.setText(modifyThis[j].trim() + " "); } //run19.setText(lines[i]); run19.addBreak(); } //run19.setText(lines[0]); run19.addBreak(); run19.addBreak(); run19.setText("Comments: " + historyofmedicationtrialsinthepastcomments.getText()); run19.addBreak(); run19.addBreak(); run20.setBold(true); run20.setText("Substance Use History:"); run20.addBreak(); run21.setBold(false); run21.setText(substanceusehistory.getText()); run21.addBreak(); //run21.setText("Denies history of: "); String denies = ""; if (significantwithdrawals.isSelected() == true) { denies = denies + "Significant Withdrawals, "; } if (dts.isSelected() == true) { denies = denies + "DTS, "; } if (withdrawalseizures.isSelected() == true) { denies = denies + "Withdrawal Seizures, "; } if (historyofdetox.isSelected() == true) { denies = denies + "History Of Detox, "; } if (outpatient.isSelected() == true) { denies = denies + "Outpatient, "; } if (inpatient.isSelected() == true) { denies = denies + "Inpatient, "; } if (na.isSelected() == true) { denies = denies + "NA, "; } if (aa.isSelected() == true) { denies = denies + "AA, "; } if (substancetreatmentprogram.isSelected() == true) { denies = denies + "Substance Treatment Program, "; } if (denies.length() > 2) { denies = denies.substring(0, denies.length() - 2); denies = denies.trim(); } //Fandom Follower- anonomously discuss your fandom //select/create/add a new fandom group to the list/search //browse fanart, view fandom updates, add materials to your local board run21.setText("Denies History Of: " + denies); run21.addBreak(); run21.addBreak(); run22.setUnderline(UnderlinePatterns.SINGLE); run22.setBold(true); run22.setText("Social History: "); run22.addBreak(); //y the fm, m homu cov e's, ah chained, ank snk // //ASP.NET in visual studio, eclipse, netbeans //dk y lol run23.setBold(false); run23.setText(socialhistorygeneral.getText()); run23.addBreak(); run23.addBreak(); run23.setText("Parents: " + parents.getText()); run23.addBreak(); run23.setText("Siblings: " + siblings.getText()); run23.addBreak(); run23.setText("Children: " + children.getText()); run23.addBreak(); String faHist; if (fhomiNO.isSelected() == true) { faHist = "No"; } else { faHist = "Yes"; } run23.setText("Family History of Mental Illness? " + faHist); run23.addBreak(); run23.setText(familyhistoryofmentalillness.getText()); run23.addBreak(); run23.addBreak(); run23.setText(education.getText()); run23.addBreak(); String e = ""; if (emp.isSelected() == true) { e = e + "Employed, "; } if (unemp.isSelected() == true) { e = e + "Unemployed, "; } if (disabilityincome.isSelected() == true) { e = e + "Disability Income, "; } if (e.length() > 2) { e = e.substring(0, e.length() - 2); e = e.trim(); } run23.setText("Employment: " + e); run23.addBreak(); run23.setText(legalhistory.getText()); run23.addBreak(); run23.addBreak(); run24.setUnderline(UnderlinePatterns.SINGLE); run24.setBold(true); run24.setText("Past Medical History"); run24.addBreak(); run25.setBold(false); run25.setText(pastmedicalhistory.getText()); run25.addBreak(); run26.setBold(true); run26.setText("Allergies: "); String allergies = " "; if (nkda.isSelected() == true) { allergies = allergies + "nkda, "; } if (environmental.isSelected() == true) { allergies = allergies + "environmental, "; } if (allergies.length() > 2) { allergies = allergies.substring(0, allergies.length() - 2); allergies = allergies.trim(); } run27.setBold(false); run27.setText(allergies); run27.addBreak(); run27.setText(allergiesdescriptionbox.getText()); run27.addBreak(); run27.addBreak(); run28.setUnderline(UnderlinePatterns.SINGLE); run28.setBold(true); run28.setText("Mental Status Examination:"); run29.addBreak(); run30.setBold(false); String appearance = " "; if (wellgroomed.isSelected() == true) { appearance = appearance + "Well Groomed, "; } if (casual.isSelected() == true) { appearance = appearance + "Casual, "; } if (disheveled.isSelected() == true) { appearance = appearance + "Disheveled, "; } if (bizarre.isSelected() == true) { appearance = appearance + "Bizarre, "; } if (inappropriate.isSelected() == true) { appearance = appearance + "Inappropriate,"; } if (appearanceother.isSelected() == true) { appearance = appearance + "Other: "; } if (appearance.length() > 2) { appearance = appearance.substring(0, appearance.length() - 2); appearance = appearance.trim(); } run30.setText("Appearance: " + appearance); if (appearanceother.isSelected()) { run30.setText(" - " + appearanceotherbox.getText()); } run30.addBreak(); String eC = "blah"; if (eyecontactgood.isSelected() == true) { eC = "Good"; } if (eyecontactpoor.isSelected() == true) { eC = "Poor"; } if (eyecontactvariable.isSelected() == true) { eC = "Variable"; } run30.setText("Eye Contact: " + eC); run30.addBreak(); String attitude = " "; if (cooperative.isSelected() == true) { attitude = attitude + "Cooperative, "; } if (guarded.isSelected() == true) { attitude = attitude + "Guarded, "; } if (suspicious.isSelected() == true) { attitude = attitude + "Suspicious, "; } if (withdrawn.isSelected() == true) { attitude = attitude + "Withdrawn, "; } if (uncooperative.isSelected() == true) { attitude = attitude + "Uncooperative, "; } if (hostile.isSelected() == true) { attitude = attitude + "Hostile, "; } if (defensive.isSelected() == true) { attitude = attitude + "Defensive, "; } if (attitudeother.isSelected() == true) { attitude = attitude + "Other: "; } if (attitude.length() > 2) { attitude = attitude.substring(0, attitude.length() - 2); attitude = attitude.trim(); } run30.setText("Attitude: " + attitude); if (attitudeother.isSelected()) { run30.setText(" - " + attitudeotherbox.getText()); } run30.addBreak(); String motoractivity = " "; if (normal.isSelected() == true) { motoractivity = motoractivity + "Normal, "; } if (agitated.isSelected() == true) { motoractivity = motoractivity + "Agitated, "; } if (motorretardation.isSelected() == true) { motoractivity = motoractivity + "Motor Retardation, "; } if (hyperactive.isSelected() == true) { motoractivity = motoractivity + "Hyperactive, "; } if (catatonia.isSelected() == true) { motoractivity = motoractivity + "Catatonia, "; } if (tremorstics.isSelected() == true) { motoractivity = motoractivity + "Tremors/Tics, "; } if (motoractivityother.isSelected() == true) { motoractivity = motoractivity + "Other: "; } if (motoractivity.length() > 2) { motoractivity = motoractivity.substring(0, motoractivity.length() - 2); motoractivity = motoractivity.trim(); } run30.setText("Motor Activity: " + motoractivity); if (motoractivityother.isSelected()) { run30.setText(" - " + motoractivityotherbox.getText()); } run30.addBreak(); String affect = " "; if (appropriate.isSelected() == true) { affect = affect + "Appropriate, "; } if (labile.isSelected() == true) { affect = affect + "Labile, "; } if (expansive.isSelected() == true) { affect = affect + "Expansive, "; } if (constricted.isSelected() == true) { affect = affect + "Constricted, "; } if (affecthappy.isSelected() == true) { affect = affect + "Happy, "; } if (affectsad.isSelected() == true) { affect = affect + "Sad, "; } if (blunted.isSelected() == true) { affect = affect + "Blunted, "; } if (flat.isSelected() == true) { affect = affect + "Flat, "; } if (masking.isSelected() == true) { affect = affect + "Masking, "; } if (affectnormalrange.isSelected() == true) { affect = affect + "Normal Range, "; } if (affect.length() > 2) { affect = affect.substring(0, affect.length() - 2); affect = affect.trim(); } run30.setText("Affect: " + affect); run30.addBreak(); String mood = " "; if (euthymic.isSelected() == true) { mood = mood + "Euthymic, "; } if (depressed.isSelected() == true) { mood = mood + "Depressed, "; } if (dysphoric.isSelected() == true) { mood = mood + "Dysphoric, "; } if (anxious.isSelected() == true) { mood = mood + "Anxious, "; } if (euphoric.isSelected() == true) { mood = mood + "Euphoric, "; } if (angry.isSelected() == true) { mood = mood + "Angry, "; } if (irritable.isSelected() == true) { mood = mood + "Irritable, "; } if (moodsad.isSelected() == true) { mood = mood + "Sad, "; } if (mood.length() > 2) { mood = mood.substring(0, mood.length() - 2); mood = mood.trim(); } run30.setText("Mood: " + mood); run30.addBreak(); String speech = " "; if (normal2.isSelected() == true) { speech = speech + "Normal, "; } if (delayed.isSelected() == true) { speech = speech + "Delayed, "; } if (soft.isSelected() == true) { speech = speech + "Soft, "; } if (loud.isSelected() == true) { speech = speech + "Loud, "; } if (slurred.isSelected() == true) { speech = speech + "Slurred, "; } if (excessive.isSelected() == true) { speech = speech + "Excessive, "; } if (pressured.isSelected() == true) { speech = speech + "Pressured, "; } if (perseverating.isSelected() == true) { speech = speech + "Perseverating, "; } if (rapid.isSelected() == true) { speech = speech + "Rapid, "; } if (rambling.isSelected() == true) { speech = speech + "Rambling, "; } if (incoherent.isSelected() == true) { speech = speech + "Incoherent, "; } if (disorganized.isSelected() == true) { speech = speech + "Disorganized, "; } if (decreasedproductivity.isSelected() == true) { speech = speech + "Decreased Productivity, "; } if (speech.length() > 2) { speech = speech.substring(0, speech.length() - 2); speech = speech.trim(); } run30.setText("Speech: " + speech); run30.addBreak(); String per = " "; if (visualhallucinations.isSelected() == true) { per = per + "Visual Hallucinations, "; } if (auditoryhallucinations.isSelected() == true) { per = per + "Auditory Hallucinations, "; } if (depersonalization.isSelected() == true) { per = per + "Depersonalization, "; } if (derealization.isSelected() == true) { per = per + "Derealization, "; } if (commandah.isSelected() == true) { per = per + "Command AH, "; } if (delusions2.isSelected() == true) { per = per + "Delusions, "; } if (illusions.isSelected() == true) { per = per + "Illusions, "; } if (perceptionnoimpairment.isSelected() == true) { per = per + "No Impairment, "; } if (per.length() > 2) { per = per.substring(0, per.length() - 2); per = per.trim(); } run30.setText("Perception: " + per); run30.addBreak(); String thoughtProcess = " "; if (intact.isSelected() == true) { thoughtProcess = thoughtProcess + "Intact, "; } if (circumstantial.isSelected() == true) { thoughtProcess = thoughtProcess + "Circumstantial, "; } if (loa.isSelected() == true) { thoughtProcess = thoughtProcess + "LOA, "; } if (tangential.isSelected() == true) { thoughtProcess = thoughtProcess + "Tangential, "; } if (foi.isSelected() == true) { thoughtProcess = thoughtProcess + "FOI, "; } if (logicalgoaldirected.isSelected() == true) { thoughtProcess = thoughtProcess + "Logical Goal Directed, "; } if (thoughtblocking.isSelected() == true) { thoughtProcess = thoughtProcess + "Thought Blocking, "; } if (ruminating.isSelected() == true) { thoughtProcess = thoughtProcess + "Ruminating, "; } if (racingthoughts.isSelected() == true) { thoughtProcess = thoughtProcess + "Racing Thoughts, "; } if (thoughtinsertionwithdrawalbroadcast.isSelected() == true) { thoughtProcess = thoughtProcess + "Thought Insertion/Withdrawal/Broadcast, "; } if (thoughtProcess.length() > 2) { thoughtProcess = thoughtProcess.substring(0, thoughtProcess.length() - 2); thoughtProcess = thoughtProcess.trim(); } run30.setText("Thought Process: " + thoughtProcess); run30.addBreak(); String thoughtContent = ""; //hummus/tahini, "steak", p seeds/walnuts, k p + sm papr; curry, hazelnut meal + a fig + 1tsp pb + 1tsp white flour + a few drops of maple syrup //get some (pepper) A1!!! //bbq sauce if (logicalcoherent.isSelected() == true) { thoughtContent = thoughtContent + "Logical Coherent, "; } if (povertyofcontent.isSelected() == true) { thoughtContent = thoughtContent + "Poverty Of Content, "; } if (ideasofreference.isSelected() == true) { thoughtContent = thoughtContent + "Ideas Of Reference, "; } if (obsessions.isSelected() == true) { thoughtContent = thoughtContent + "Obsessions, "; } if (phobias.isSelected() == true) { thoughtContent = thoughtContent + "Phobias, "; } if (paranoidideation.isSelected() == true) { thoughtContent = thoughtContent + "Paranoid Ideation, "; } if (delusions.isSelected() == true) { thoughtContent = thoughtContent + "Delusions, "; } if (thoughtContent.length() > 2) { thoughtContent = thoughtContent.substring(0, thoughtContent.length() - 2); thoughtContent = thoughtContent.trim(); } run30.setText("Thought Content: " + thoughtContent); if (delusions.isSelected()) { run30.setText(" - " + delusionsbox.getText()); } run30.addBreak(); String suicidality = " "; if (suicidalitydenied.isSelected() == true) { suicidality = suicidality + "Suicidality Denied, "; } if (suicidalityideation.isSelected() == true) { suicidality = suicidality + "Suicidality Ideation, "; } if (suicidalityintent.isSelected() == true) { suicidality = suicidality + "Suicidality Intent, "; } if (suicidalityplan.isSelected() == true) { suicidality = suicidality + "Suicidality Plan: "; } if (suicidality.length() > 2) { suicidality = suicidality.substring(0, suicidality.length() - 2); suicidality = suicidality.trim(); } run30.setText("Suicidality: " + suicidality); if (suicidalityplan.isSelected()) { run30.setText(" - " + suicidalityplanbox.getText()); } run30.addBreak(); String homicidality = " "; if (homicidalitydenied.isSelected() == true) { homicidality = homicidality + "Homicidality Denied, "; } if (homicidalityideation.isSelected() == true) { homicidality = homicidality + "Homicidality Ideation, "; } if (homicidalityintent.isSelected() == true) { homicidality = homicidality + "Homicidality Intent, "; } if (homicidalityplan.isSelected() == true) { homicidality = homicidality + "Homicidality Plan: "; } if (homicidality.length() > 2) { homicidality = homicidality.substring(0, homicidality.length() - 2); homicidality = homicidality.trim(); } run30.setText("Homicidality: " + homicidality); if (homicidalityplan.isSelected()) { run30.setText(" - " + homicidalityplanbox.getText()); } run30.addBreak(); if (suicidalityhomicidalitycomments.getText().length() >= 2) { run30.setText(" \t Comments - " + suicidalityhomicidalitycomments.getText()); } run30.addBreak(); String orientation = " "; if (fullyoriented.isSelected() == true) { orientation = orientation + "Fully Oriented, "; } if (disoriented.isSelected() == true) { orientation = orientation + "Disoriented: "; } if (person.isSelected() == true) { orientation = orientation + "Person, "; } if (place.isSelected() == true) { orientation = orientation + "Place, "; } if (time.isSelected() == true) { orientation = orientation + "Time, "; } if (orientation.length() > 2) { orientation = orientation.substring(0, orientation.length() - 2); orientation = orientation.trim(); } run30.setText("Orientation: " + orientation); run30.addBreak(); String stm = " "; //shorttermmemorywithinnormallimits, shorttermmermorydeficits, longtermmemorywithinnormallimits,longtermmemorydeficits, shorttermmemorydeficitsbox, longtermmemorydeficitsbox if (shorttermmemorywithinnormallimits.isSelected() == true) { stm = stm + "Within Normal Limits, "; } if (shorttermmemorydeficits.isSelected() == true) { stm = stm + "Deficits, "; } if (stm.length() > 2) { stm = stm.substring(0, stm.length() - 2); stm = stm.trim(); } run30.setText("Short Term Memory: " + stm); if (shorttermmemorydeficits.isSelected() == true) { run30.setText(" - " + shorttermmemorydeficitsbox.getText()); } run30.addBreak(); String ltm = " "; if (longtermmemorywithinnormallimits.isSelected() == true) { ltm = ltm + "Within Normal Limits, "; } if (longtermmemorydeficits.isSelected() == true) { ltm = ltm + "Deficits, "; } if (ltm.length() > 2) { ltm = ltm.substring(0, ltm.length() - 2); ltm = ltm.trim(); } run30.setText("Long Term Memory: " + ltm); if (longtermmemorydeficits.isSelected() == true) { run30.setText(" - " + longtermmemorydeficitsbox.getText()); } run30.addBreak(); String gfok = " "; if (generalfundofknowledgewithinnormallimits.isSelected() == true) { gfok = gfok + "Within Normal Limits, "; } if (generalfundofknowledgedeficits.isSelected() == true) { gfok = gfok + "Deficits, "; } if (gfok.length() > 2) { gfok = gfok.substring(0, gfok.length() - 2); gfok = gfok.trim(); } run30.setText("General Fund of Knowledge: " + gfok); if (generalfundofknowledgedeficits.isSelected() == true) { run30.setText(" - " + generalfundofknowledgedeficitsbox.getText()); } run30.addBreak(); String intellect = " "; if (intellectaboveaverage.isSelected() == true) { intellect = intellect + "Above Average, "; } if (intellectaverage.isSelected() == true) { intellect = intellect + "Average, "; } if (intellectbelowaverage.isSelected() == true) { intellect = intellect + "Below Average, "; } if (intellect.length() > 2) { intellect = intellect.substring(0, intellect.length() - 2); intellect = intellect.trim(); } run30.setText("Intellect: " + intellect); if (intellectbelowaverage.isSelected() == true) { run30.setText(" - " + intellectbelowaveragebox.getText()); } run30.addBreak(); String abstraction = " "; if (abstractionintact.isSelected() == true) { abstraction = abstraction + "Intact, "; } if (abstractionconcrete.isSelected() == true) { abstraction = abstraction + "Concrete, "; } if (abstractionidiosyncratic.isSelected() == true) { abstraction = abstraction + "Idiosyncratic, "; } if (abstraction.length() > 2) { abstraction = abstraction.substring(0, abstraction.length() - 2); abstraction = abstraction.trim(); } run30.setText("Abstraction: " + abstraction); run30.addBreak(); String judgement = " "; if (judgementintact.isSelected() == true) { judgement = judgement + "Intact, "; } if (judgementimpaired.isSelected() == true) { judgement = judgement + "Impaired - "; } if (judgementminimal.isSelected() == true) { judgement = judgement + "Minimal, "; } if (judgementmoderate.isSelected() == true) { judgement = judgement + "Moderate, "; } if (judgementsevere.isSelected() == true) { judgement = judgement + "Severe, "; } if (judgement.length() > 2) { judgement = judgement.substring(0, judgement.length() - 2); judgement = judgement.trim(); } run30.setText("Judgement: " + judgement); run30.addBreak(); String insight = " "; if (insightintact.isSelected() == true) { insight = insight + "Intact, "; } if (insightimpaired.isSelected() == true) { insight = insight + "Impaired - "; } if (insightminimal.isSelected() == true) { insight = insight + "Minimal, "; } if (insightmoderate.isSelected() == true) { insight = insight + "Moderate, "; } if (insightsevere.isSelected() == true) { insight = insight + "Severe, "; } if (insight.length() > 2) { insight = insight.substring(0, insight.length() - 2); insight = insight.trim(); } run30.setText("Insight: " + insight); run30.addBreak(); run30.addBreak(); run31.setUnderline(UnderlinePatterns.SINGLE); run31.setBold(true); run31.setText("Clinical Notes pertaining to MSE"); run31.addBreak(); run32.setBold(false); run32.setText(clinicalnotes.getText()); run32.addBreak(); run32.addBreak(); run33.setBold(true); run33.setText("Diagnosis: "); run33.addBreak(); run34.setBold(false); run34.setText("Axis I: " + axis1.getText()); run34.addBreak(); run34.setText("Axis II: " + axis2.getText()); run34.addBreak(); run34.setText("Axis III: " + axis3.getText()); run34.addBreak(); run34.setText("Axis IV: " + axis4.getText()); run34.addBreak(); String a4cb = " "; if (a4none.isSelected() == true) { a4cb = a4cb + "None, "; } if (a4primarysupportgroup.isSelected() == true) { a4cb = a4cb + "Primary Support Group, "; } if (a4partnerrelationalproblems.isSelected() == true) { a4cb = a4cb + "Partner Relational Problems, "; } if (a4parentchildrelationalproblems.isSelected() == true) { a4cb = a4cb + "Parent Child Relational Problems, "; } if (a4socialenvironment.isSelected() == true) { a4cb = a4cb + "Social Environment, "; } //a4occupation, a4economics, a4legalsystem, a4education, a4housing, //a4noncompliancewithtreatment, a4other, axis5none; if (a4occupation.isSelected() == true) { a4cb = a4cb + "Occupation, "; } if (a4economics.isSelected() == true) { a4cb = a4cb + "Economics, "; } if (a4legalsystem.isSelected() == true) { a4cb = a4cb + "Legal System, "; } if (a4education.isSelected() == true) { a4cb = a4cb + "Education, "; } if (a4housing.isSelected() == true) { a4cb = a4cb + "Housing, "; } if (a4noncompliancewithtreatment.isSelected() == true) { a4cb = a4cb + "Noncompliance With Treatment, "; } if (a4other.isSelected() == true) { a4cb = a4cb + "Other, "; } if (a4cb.length() > 2) { a4cb = a4cb.substring(0, a4cb.length() - 2); a4cb = a4cb.trim(); } run34.setText(a4cb); if (a4other.isSelected() == true) { run34.setText(" - " + axis4otherbox.getText()); } run34.addBreak(); run34.setText("Axis V: GAF " + "Current: " + axis5current.getText() + " Highest in Past Year: " + axis5highestinpastyear.getText()); if (axis5none.isSelected() == true) { run34.setText(" None"); } run34.addBreak(); run34.addBreak(); run35.setUnderline(UnderlinePatterns.SINGLE); run35.setBold(true); run35.setText("Reccommendations and Plans"); run35.addBreak(); run36.setBold(false); run36.setText("Diagnosis and treatment options discussed with the patient? - "); if (treatmentplancheckbox1.isSelected() == true) { run36.setText("Yes"); } else { run36.setText("No"); } run36.addBreak(); run36.addBreak(); //run36.setText("Treatment Plan: " + treatmentplanbox1.getText()); run36.setText("Treatment Plan: "); String[] tpLines = treatmentplanbox1.getText().split("\n"); for (int i = 0; i < tpLines.length; i++) { run36.setText(tpLines[i]); run36.addBreak(); } run36.addBreak(); run36.addBreak(); run36.setText( "Discussed that any overuse or abuse of prescription Benzodiazepines could result in patient being discharged from the practice. - "); if (treatmentplancheckbox2.isSelected() == true) { run36.setText("Yes"); } else { run36.setText("No"); } run36.addBreak(); run36.setText("Nevada Prescription Monitoring Board Reviewed? - "); if (treatmentplancheckbox3.isSelected() == true) { run36.setText("Yes"); } else { run36.setText("No"); } run36.addBreak(); run36.setText(treatmentplantextfield.getText()); run36.addBreak(); run36.addBreak(); run37.setUnderline(UnderlinePatterns.SINGLE); run37.setItalic(true); run37.setText("Medication Prescribed"); run37.addBreak(); run38.setBold(false); run38.setText(treatmentplanbox2.getText()); run38.addBreak(); run38.addBreak(); run39.setUnderline(UnderlinePatterns.SINGLE); run39.setBold(true); run39.setText("Side Effects Discussed: "); run39.addBreak(); run40.setBold(false); String se = " "; if (riskforreboundhypertension.isSelected() == true) { se = se + "Risk For Rebound Hypertension, "; } if (complexsleeprelatedbehavior.isSelected() == true) { se = se + "Complex Sleep Related Behavior, "; } if (ssoftoxicity.isSelected() == true) { se = se + "S/S of Toxicity, "; } if (withdrawalsyndrome.isSelected() == true) { se = se + "Withdrawal Syndrome, "; } if (riskforaddiction.isSelected() == true) { se = se + "Risk for Addiction, "; } if (seizures.isSelected() == true) { se = se + "Seizures, "; } if (prolongedqtc.isSelected() == true) { se = se + "Prolonged QTC, "; } if (tardivedyskinesiadystonia.isSelected() == true) { se = se + "Tardive Dyskinesia/Dystonia, "; } if (acuteneurologicalse.isSelected() == true) { se = se + "Acute Neurological SE, "; } if (metabolicsyndrome.isSelected() == true) { se = se + "Metabolic Syndrome, "; } //decreasedeffectivenessofobc, teratogenicity, hyponatremia, hypothyroidism, rashsjsyndrome, //weightgainloss, constipation, drymouth, increasedriskofsi, hyperprolactinemia, serotoninsyndrome, //hairloss, hypotension, htn, dizziness, insomnia, sedation, sexual, gi; if (decreasedeffectivenessofobc.isSelected() == true) { se = se + "Decreased Effectiveness of OBC, "; } if (teratogenicity.isSelected() == true) { se = se + "Teratogenicity- "; se = se + sebox2.getText() + ", "; } if (hyponatremia.isSelected() == true) { se = se + "Hyponatremia, "; } if (hypothyroidism.isSelected() == true) { se = se + "Hypothyroidism, "; } if (rashsjsyndrome.isSelected() == true) { se = se + "Rash - SJ Syndrome- "; se = se + sebox1.getText() + ", "; } if (weightgainloss.isSelected() == true) { se = se + "Weight Gain/Loss, "; } if (constipation.isSelected() == true) { se = se + "Constipation, "; } if (drymouth.isSelected() == true) { se = se + "Dry Mouth, "; } if (increasedriskofsi.isSelected() == true) { se = se + "Increased Risk of SI, "; } if (hyperprolactinemia.isSelected() == true) { se = se + "Hyperprolactinemia, "; } if (serotoninsyndrome.isSelected() == true) { se = se + "Serotonin Syndrome, "; } if (hairloss.isSelected() == true) { se = se + "Hair Loss, "; } if (hypotension.isSelected() == true) { se = se + "Hypotension, "; } if (htn.isSelected() == true) { se = se + "HTN, "; } if (dizziness.isSelected() == true) { se = se + "Dizziness, "; } if (insomnia.isSelected() == true) { se = se + "Insomnia, "; } if (sedation.isSelected() == true) { se = se + "Sedation, "; } if (sexual.isSelected() == true) { se = se + "Sexual, "; } if (gi.isSelected() == true) { se = se + "GI, "; } if (se.length() > 2) { se = se.substring(0, se.length() - 2); se = se.trim(); } run40.setText(se); run40.addBreak(); run40.addBreak(); run41.setUnderline(UnderlinePatterns.SINGLE); run41.setBold(true); run41.setText("Labs:"); run41.addBreak(); run42.setBold(false); String labs = " "; if (vitd.isSelected() == true) { labs = labs + "Vit D, "; } if (hivscreen.isSelected() == true) { labs = labs + "HIV Screen, "; } if (vitaminb12folicacid.isSelected() == true) { labs = labs + "Vitamin B12/Folic Acid, "; } if (ua.isSelected() == true) { labs = labs + "UA, "; } if (uds.isSelected() == true) { labs = labs + "UDS, "; } if (selectrolyte.isSelected() == true) { labs = labs + "S Electrolyte, "; } if (lithium.isSelected() == true) { labs = labs + "Lithium, "; } if (lamictallevel.isSelected() == true) { labs = labs + "Lamictal Level, "; } if (trileptallevel.isSelected() == true) { labs = labs + "Trileptal Level, "; } if (depakotelevel.isSelected() == true) { labs = labs + "Depakote Level, "; } if (bmp.isSelected() == true) { labs = labs + "BMP, "; } if (tft.isSelected() == true) { labs = labs + "TFT, "; } if (lft.isSelected() == true) { labs = labs + "LFT, "; } if (hgba1c.isSelected() == true) { labs = labs + "HGB A1C, "; } if (lipidprofile.isSelected() == true) { labs = labs + "Lipid Profile, "; } if (cmp.isSelected() == true) { labs = labs + "CMP, "; } if (cbc.isSelected() == true) { labs = labs + "CBC, "; } if (blanklabs.isSelected() == true) { labs = labs + labstextfield.getText() + ", "; } if (labs.length() > 2) { labs = labs.substring(0, labs.length() - 2); labs = labs.trim(); } run42.setText(labs); run42.addBreak(); run42.addBreak(); run42Bold.setBold(true); run42Bold.setText( "Verbal informed consent obtained from patient for trial of " + ebox1.getText() + ": "); if (yes1.isSelected() == true) { run42Bold.setText("Yes"); } if (no1.isSelected() == true) { run42Bold.setText("No"); } run42Bold.addBreak(); run42Bold.setText("Risks/benefits of prescribed medications discussed with patient: "); if (yes2.isSelected() == true) { run42Bold.setText("Yes"); } if (no2.isSelected()) { run42Bold.setText("No"); } run42Bold.addBreak(); run42Bold.addBreak(); String end = "", end2 = ""; if (riskofsuicidelow.isSelected() == true) { end = end + "Low, "; } if (riskofsuicidemoderate.isSelected() == true) { end = end + "Moderate, "; } if (riskofsuicidehigh.isSelected() == true) { end = end + "High, "; } if (riskofsuicidemodifiableriskfactorsaddressed.isSelected() == true) { end = end + "Modifiable Risk Factors Addressed, "; } if (dangertootherslow.isSelected() == true) { end2 = end2 + "Low, "; } if (dangertoothersmoderate.isSelected() == true) { end2 = end2 + "Moderate, "; } if (dangertoothershigh.isSelected() == true) { end2 = end2 + "High, "; } if (dangertoothersmodifiableriskfactorsaddressed.isSelected() == true) { end2 = end2 + "Modifiable Risk Factors Addressed, "; } if (end.length() > 2) { end = end.substring(0, end.length() - 2); end = end.trim(); } if (end2.length() > 2) { end2 = end2.substring(0, end2.length() - 2); end2 = end2.trim(); } run42Bold.setText("Risk of Suicide/Self-Harm: " + end); run42Bold.addBreak(); run42Bold.setText("Danger to others: " + end2); run42Bold.addBreak(); run42Bold.addBreak(); run42Bold.addBreak(); run42Bold.addBreak(); if (partnerSigned == true) { if (businesscardprovided.isSelected()) { runPre43.setText("Business Card Provided: Yes"); runPre43.addBreak(); } else { runPre43.setText("Business Card Provided: No"); runPre43.addBreak(); } if (discussedassistant.isSelected()) { if (who.getText() != null || who.getText() != "" || who.getText() != " ") { runPre43.setText("Discussed with [" + who.getText() + "] accompanying the patient that I am a physician assistant"); runPre43.addBreak(); } else { runPre43.setText("Discussed with patient that I am a physician assistant"); runPre43.addBreak(); } } else { } //runPre43.addBreak(); //runPre43.addBreak(); run43.setBold(true); run43.setText( "Signature: This Document Has Been Digitally Signed By Izabella Ostolski, PA-C Date: "); DateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy"); Date date = new Date(); String alpha = dateFormat.format(date); run43.setText(alpha); } if (dccSigned == true) { run44.addBreak(); run44.addBreak(); run44.addBreak(); run44.setBold(false); run44.setItalic(true); //run44.setTextPosition(20); run44.setText("I have reviewed and discussed the case. I agree with the current treatment plan."); run44.addBreak(); //run44.setText(signaturenotes.getText()); //run44.addBreak(); run46.setBold(true); run46.setText( "Signature: This Document Has Been Digitally Signed By David Zhvikov MD Date: "); DateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy"); Date date = new Date(); String alpha = dateFormat.format(date); run46.setText(alpha); try { //code prac'k wrkoxx /*FileInputStream is = new FileInputStream("C:/Users/Quiggy/Desktop/javascript-based psych forms/sig.bmp"); //doc.addPictureData(IOUtils.toByteArray(is), doc.PICTURE_TYPE_BMP) XWPFParagraph title = doc.createParagraph(); XWPFRun imageRun = title.createRun(); imageRun.setText("Fig.1 A Natural Scene"); imageRun.setBold(true); title.setAlignment(ParagraphAlignment.CENTER); imageRun.addPicture(is, XWPFDocument.PICTURE_TYPE_BMP, "sig.bmp", 300, 200);*/ //String picId = "C:/Users/Quiggy/Desktop/javascript-based psych forms/sig1.png"; //doc.addPictureData(new FileInputStream("C:/Users/Quiggy/Desktop/javascript-based psych forms/sig1.png"), XWPFDocument.PICTURE_TYPE_PNG); //doc.add //doc.createPicture(picId, doc.getNextPicNameNumber(XWPFDocument.PICTURE_TYPE_PNG), 200, 150); //String imgFile = "C:/Users/Quiggy/Desktop/javascript-based psych forms/sig1.png"; //FileInputStream is = new FileInputStream(picId); //run43.addBreak(); //run43.addPicture(is, XWPFDocument.PICTURE_TYPE_PNG, picId, 200, 300); // 200x200 pixels //run43.addPicture(is, XWPFDocument.PICTURE_TYPE_JPEG, null, 0, 100); //run43.add //is.close(); } catch (Exception anException) { //System.out.println(anException); //add the selected ones to the arraylist, and remove these from the second array list. print the first arraylist in bold, and then print the second arraylist unbolded. } } //Find: laundry bags(3), black pants (cargos), 2nd scientific calculator, iPAD mini CHARGER //Daskin NOW 36C //Masi pants //google jacket model number //dcc's old phone (with the lb, lx, & a lockscreen pic:) //"Enter the Physician's Assistant Passcode OR the Physician's Passcode to enable/unlock editing" //general-access password: dolphin-->dolphin92 //Isabella's Password: siberianplatypus //Your Password: protooncogene-->protooncogene6 //the "go-to" choice for disorganized writers/authors //also make an xml and php -based web chat application to complement f f //code this in visual studio with ASP.NET //that IBM? tutorial with the "free website" thing /*if(single.isSelected()) { run8.setItalic(true); run8.setBold(true); run8.setText(" Single"); } else { run8.setItalic(false); run8.setBold(false); run8.setText(" Single"); } if(engaged.isSelected()) { run9.setItalic(true); run9.setBold(true); run9.setText(" Engaged"); } else { run9.setBold(false); run9.setItalic(false); run9.setText(" Engaged"); } //but not (both AT THE SAME TIME/ARE TRUE/HOLD) if(married.isSelected()) { run10.setItalic(true); run10.setBold(true); run10.setText(" Married"); }//nightmares, when they occurred, were less terrifying, somehow. else { run10.setItalic(false); run10.setBold(false); run10.setText(" Married"); }//is fundamentally incomprehensible from the level of c at which you've considered it //because NEITHER are true //there is no if(seperated.isSelected()) { run11.setItalic(true); run11.setBold(true); run11.setText(" Seperated"); } else { run11.setItalic(false); run11.setBold(false); run11.setText(" Seperated"); } if(divorced.isSelected()) { run12.setItalic(true); run12.setBold(true); run12.setText(" Divorced"); }//there is only choice...choice is the only thing left to identify/indicate [that] individuality [exists indeed] else { run12.setItalic(false); run12.setBold(false); run12.setText(" Divorced"); } if(commonlawspouse.isSelected()) { run13.setItalic(true); run13.setBold(true); run13.setText(" Common Law Spouse"); } else { run13.setItalic(false); run13.setBold(false); run13.setText(" Common Law Spouse"); } if(cohabiting.isSelected()) { run14.setItalic(true); run14.setBold(true); run14.setText(" Cohabiting"); } else { run14.setItalic(false); run14.setBold(false); run14.setText(" Cohabiting"); }*/ //run is created here if(divorced.isSelected == "true"){run.setBold(true); run.setText("divorced");} else {run.setBold(false); run.setText("divorced")} //single, engaged, married, seperated, divorced, commonlawspouse, cohabiting; //printDOB(doc); //one (not-so-great) solution to the numerous runs problem: list everything to be bolded first (array 1- run 1), and then everything else (array 2- run 2) //doc.createParagraph().createRun().setText(" " + paragraphs.get(c).toString()); //doc.createParagraph().createRun().addBreak(); doc.write(outstream); outstream.close(); //paraRun.setText(Primary.getText()); //doc.createParagraph().createRun().addBreak(); //inserts a line break //doc.createParagraph().createRun().setText("blah"); //creates another paragraph /*for(int c = 0; c < paragraphs.size(); c++) { /*XWPFParagraph p = doc.createParagraph(); //Paragraph XWPFRun run = p.createRun(); //Where the text will be written from run.setText("\t");*/ /* XWPFParagraph p = doc.createParagraph(); //Paragraph XWPFRun run = p.createRun(); //Where the text will be written from String currentParagraph = paragraphs.get(c).toString(); for(int d = 0; d < currentParagraph.length(); d++) { if(currentParagraph.charAt(d) == '@') { currentParagraph = currentParagraph.substring(d+1, currentParagraph.length() - 2); run.setBold(true); } else { //run.setBold(false); } } run.setText(" " + currentParagraph); //doc.createParagraph().createRun().setText(" " + paragraphs.get(c).toString()); //doc.createParagraph().createRun().addBreak(); } doc.write(outstream); outstream.close(); //JOptionPane.showConfirmDialog(null, "Are you sure you want to create the word document?"); //Makes the chapter titles bold and removes the "@" & "-" JOptionPane.showMessageDialog(null, "Document Successfully Created. The program/AA will now exit"); System.exit(0);*/ } catch (Exception e) { } }