public AboutDialog(MainGUI gui, BufferedImage bufferedImage, Border border) { aboutDialogLogger.entry(); try { bufferedIcon = ImageIO.read(MainGUI.class.getResource("/icon.png")); } catch (IOException e) { aboutDialogLogger.error("Error In Loading \"background.jpg\"", e); ExceptionLogger.loggerIOException(aboutDialogLogger, e); } this.setTitle("About " + FileNames.PROGRAM_NAME); this.bufferedImage = bufferedImage; this.border = border; initialize(); themeing(); addComponents(); addEvents(); textToArea(); this.setResizable(false); this.setAlwaysOnTop(true); this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); this.pack(); this.setLocationRelativeTo(gui); this.setVisible(true); aboutDialogLogger.exit(LoggerValues.SUCCESSFUL_EXIT); }
private static void removeLicense(File tempFile) { RemoveLicense.removeLicenseLogger.entry(); File temp = new File(tempFile.getParent() + FileNames.SEPARATOR + "TEMPfile"); try { BufferedWriter tempwriter = new BufferedWriter(new FileWriter(temp)); BufferedReader sourceReader = new BufferedReader(new FileReader(tempFile)); String line; boolean found = false; while ((line = sourceReader.readLine()) != null) { if (line.trim().startsWith(RemoveLicense.STARTING_PATTERN) && !found) { found = true; while ((line = sourceReader.readLine()) != null) { if (line.trim().contains(RemoveLicense.ENDING_PATTERN)) { line = sourceReader.readLine(); break; } } } tempwriter.write(line + "\n"); tempwriter.flush(); } tempwriter.close(); sourceReader.close(); tempFile.delete(); temp.renameTo(tempFile); RemoveLicense.removeLicenseLogger.exit(LoggerValues.SUCCESSFUL_EXIT); } catch (IOException e) { RemoveLicense.removeLicenseLogger.error("Error In Removing License", e); ExceptionLogger.loggerIOException(RemoveLicense.removeLicenseLogger, e); RemoveLicense.removeLicenseLogger.exit(LoggerValues.UNSUCCESSFUL_EXIT); } }
private void textToArea() { aboutDialogLogger.entry(); StringBuilder builder = new StringBuilder(""); developerPane.setContentType("text/html"); licenseTextArea.setText(""); builder.append("<HTML>"); BufferedReader reader = GenerateTempLicense.aboutSoft(); String line; try { while ((line = reader.readLine()) != null) { licenseTextArea.setText(licenseTextArea.getText() + line + "\n"); } reader.close(); } catch (IOException e) { aboutDialogLogger.error("Error In Creating Software License Stream", e); ExceptionLogger.loggerIOException(aboutDialogLogger, e); } if (!(FileNames.DEVELOPERS.length == 1 && FileNames.DEVELOPERS[0].trim().length() == 0)) { builder.append("\n\t<b><u>Developers</u> :</b>\n\t<br />\n\t<ul>"); for (int i = 0; i < FileNames.DEVELOPERS.length; ++i) { builder.append( "\n\t\t<li><b >" + FileNames.DEVELOPERS[i] + "</b> <<a href=\"http://mailto:" + FileNames.DEVELOPERS_EMAIL[i] + "\">" + FileNames.DEVELOPERS_EMAIL[i] + "</a>> <<a href=http://\"" + FileNames.DEVELOPERS_WEBSITE[i] + "\">" + FileNames.DEVELOPERS_WEBSITE[i] + "</a>></li>"); } builder.append("\n\t</font></ul>"); } if (!(FileNames.TESTERS.length == 1 && FileNames.TESTERS[0].trim().length() == 0)) { builder.append("\n\t<b><u>Testers</u> :</b>\n\t<br />\n\t<ul>"); for (int i = 0; i < FileNames.TESTERS.length; ++i) { builder.append( "\n\t\t<li color=\"red\">" + FileNames.TESTERS[i] + ", <<a href=\"mailto:" + FileNames.TESTERS_EMAIL[i] + "\">" + FileNames.TESTERS_EMAIL[i] + "</a>> <<a href=http://\"" + FileNames.TESTERS_WEBSITE[i] + "\">" + FileNames.TESTERS_WEBSITE[i] + "</a>></li>"); } builder.append("\n\t</ul>"); } if (!(FileNames.CONTRIBUTERS.length == 1 && FileNames.CONTRIBUTERS[0].trim().length() == 0)) { builder.append("\n\t<b><u>Contributers</u> :</b>\n\t<br />\n\t<ul>"); for (int i = 0; i < FileNames.CONTRIBUTERS.length; ++i) { builder.append( "\n\t\t<li>" + FileNames.CONTRIBUTERS[i] + ", <<a href=\"mailto:" + FileNames.CONTRIBUTERS_EMAIL[i] + "\">" + FileNames.CONTRIBUTERS_EMAIL[i] + "</a>> <<a href=http://\"" + FileNames.CONTRIBUTERS_WEBSITE[i] + "\">" + FileNames.CONTRIBUTERS_WEBSITE[i] + "</a>></li>"); } builder.append("\n\t</ul>"); } builder.append("\n</html>"); developerPane.setText(builder.toString()); aboutDialogLogger.exit(LoggerValues.SUCCESSFUL_EXIT); ; }