public void writeHTMLHeader(HTMLFile file, String title) { file.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"); file.println("<HTML><HEAD><TITLE>" + title + "</TITLE>"); file.println("<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"); file.println("</HEAD>"); }
public void writeHTMLHeaderWithScript(HTMLFile file, String title) { file.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"); file.println("<HTML>\n<HEAD>\n <TITLE>" + title + "</TITLE>"); file.println("<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"); file.println(" <script type=\"text/javascript\">\n <!--"); file.println(" function ZweiFrames(URL1,F1,URL2,F2)\n {"); file.println(" parent.frames[F1].location.href=URL1;"); file.println(" parent.frames[F2].location.href=URL2;\n }\n //-->"); file.println(" </script>\n</HEAD>"); }
private int writeFrames(int i, AllMatches match) throws jplag.ExitException { HTMLFile f = openHTMLFile(root, "match" + i + ".html"); writeHTMLHeader(f, TagParser.parse(msg.getString("Report.Matches_for_X1_AND_X2"), new String[] { match.subName(0), match.subName(1) })); f.println("<FRAMESET ROWS=\"130,*\">\n <FRAMESET COLS=\"30%,70%\">"); f.println(" <FRAME SRC=\"match" + i + "-link.html\" NAME=\"link\" " + "FRAMEBORDER=0>"); f.println(" <FRAME SRC=\"match" + i + "-top.html\" NAME=\"top\" " + "FRAMEBORDER=0>"); f.println(" </FRAMESET>"); f.println(" <FRAMESET COLS=\"50%,50%\">"); f.println(" <FRAME SRC=\"match" + i + "-0.html\" NAME=\"0\">"); f.println(" <FRAME SRC=\"match" + i + "-1.html\" NAME=\"1\">"); f.println(" </FRAMESET>\n</FRAMESET>\n</HTML>"); f.close(); return f.bytesWritten(); }
public int makeDendrograms(File root, Cluster clustering) throws jplag.ExitException { HTMLFile f = this.program.report.openHTMLFile(root, "dendro.html"); f.println("<!DOCTYPE HTML PUBLIC \"-//DTD HTML 3.2//EN\">"); f.println("<HTML>\n<HEAD>\n<TITLE>" + msg.getString("Clusters.Dendrogram") + "</TITLE>\n" + "<script language=\"JavaScript\" type=\"text/javascript\" " + "src=\"fields.js\">\n</script>\n</HEAD>\n<BODY>"); f.println("<H1>" + msg.getString("Clusters.Dendrogram") + "</H1>"); f.println("<form name=\"data\" action=\"\">"); f.println("<table border=\"0\">"); f.println("<tr><td>" + msg.getString("Clusters.Cluster_size") + ":</td>" + "<td><input type=\"text\" readonly name=\"size\" size=\"5\"></td>"); f.println("<td rowspan=\"3\">" + msg.getString("Clusters.Themewords") + ":</td><td rowspan=\"3\"><textarea cols=\"80\" rows=\"3\" readonly " + "name=\"theme\"></textarea></td></tr>"); f.println("<tr><td>" + msg.getString("Clusters.Threshold") + ":</td><td><input type=\"text\" readonly name=\"thresh\" " + "size=\"6\"></td></tr>"); f.println("<tr><td>" + msg.getString("Clusters.Documents") + ":</td><td><input type=\"text\" readonly name=\"docs\" " + "size=\"30\"></td></tr>"); f.println("</table>\n</form>"); f.println(paintDendrogram(new File(root, "dendro.gif"), clustering)); f.println("<P><IMG SRC=\"dendro.gif\" ALT=\"" + msg.getString("Clusters.Dendrogram_picture") + "\" USEMAP=\"#Dendrogram\"></P>"); f.println("</BODY>\n</HTML>");
private int copySubmissions() throws jplag.ExitException { int bytes = 0; for (Iterator<Submission> i = program.clusters.neededSubmissions.iterator(); i.hasNext();) { Submission sub = i.next(); int index = this.program.clusters.submissions.indexOf(sub); HTMLFile f = openHTMLFile(root, "submission" + index + ".html"); writeHTMLHeader(f, sub.name); f.println("<BODY BGCOLOR=\"#ffffff\">"); String[] files = sub.files; String text[][] = sub.readFiles(files); for (int j = 0; j < files.length; j++) { f.println("<HR>\n<H3><CENTER>" + files[j] + "</CENTER></H3><HR>"); if (this.language.isPreformated()) f.println("<PRE>"); for (int k = 0; k < text[j].length; k++) { f.print(text[j][k]); if (!this.language.isPreformated()) f.println("<BR>"); else f.println(); } if (language.isPreformated()) f.println("</PRE>"); } f.println("</BODY>\n</HTML>"); f.close(); bytes += f.bytesWritten(); } return bytes; }
private void writeDistribution(HTMLFile f) { // Die Verteilung: int max = 0; for (int i = 0; i < 10; i++) if (dist[i] > max) max = dist[i]; f.println("<H4>" + this.msg.getString("Report.Distribution") + ":</H4>\n<CENTER>"); f.println("<TABLE CELLPADDING=1 CELLSPACING=1>"); for (int i = 9; i >= 0; i--) { f.print("<TR BGCOLOR=" + color(i * 10 + 10, 128, 192, 128, 192, 255, 255) + "><TD ALIGN=center>" + (i * 10) + "% - " + (i * 10 + 10) + "%" + "</TD><TD ALIGN=right>" + dist[i] + "</TD><TD>"); for (int j = (dist[i] * bar_length / max); j > 0; j--) f.print("#"); if (dist[i] * bar_length / max == 0) { if (dist[i] == 0) f.print("."); else f.print("#"); } f.println("</TD></TR>"); } f.println("</TABLE></CENTER>\n<P>\n<HR>"); }
private int writeTop(int i, AllMatches match) throws jplag.ExitException { HTMLFile f = openHTMLFile(root, "match" + i + "-top.html"); writeHTMLHeaderWithScript(f, "Top"); f.println("<BODY BGCOLOR=\"#ffffff\">"); if (this.program.use_externalSearch()) { f.println("<A HREF=\"match" + i + "-dist.html\" TARGET=\"_top\">" + msg.getString("Report.Distribution") + "</A><P>"); } match.HTMLreport(f, i, this.program); f.println("</BODY>\n</HTML>\n"); f.close(); return f.bytesWritten(); }
private int writeLink(int i, AllMatches match) throws jplag.ExitException { HTMLFile f = openHTMLFile(root, "match" + i + "-link.html"); writeHTMLHeader(f, msg.getString("Report.Links")); f.println("<BODY>\n <H3 ALIGN=\"center\">" + TagParser.parse(msg.getString("Report.Matches_for_X1_AND_X2"), new String[] { match.subName(0), match.subName(1) }) + "</H3>"); f.println(" <H1 align=\"center\">" + match.roundedPercent() + "%</H1>\n<CENTER>"); f.println(" <A HREF=\"index.html#matches\" TARGET=\"_top\">" + msg.getString("Report.INDEX") + "</A> - "); f.println(" <A HREF=\"help-" + program.getCountryTag() + ".html\" TARGET=\"_top\">" + msg.getString("Report.HELP") + "</A></CENTER>"); f.println("</BODY>\n</HTML>"); f.close(); return f.bytesWritten(); }
private int writeDist(int i, AllMatches match) throws jplag.ExitException { HTMLFile f = openHTMLFile(root, "match" + i + "-dist.html"); writeHTMLHeader(f, msg.getString("Report.Token_Distribution")); f.println("<BODY>"); match.distributionReport(f, msg); f.println("</BODY>\n</HTML>"); f.close(); return f.bytesWritten(); }
f.println("<TABLE CELLPADDING=2 CELLSPACING=2>"); f.println("<TR><TH ALIGN=center BGCOLOR=#8080ff>" + msg.getString("Clusters.Cluster_number") + "<TH ALIGN=center BGCOLOR=#8080ff>" f.println("<TD ALIGN=left BGCOLOR=#c0c0ff>" + ThemeGenerator.generateThemes(sortedSubmissions, this.program.get_themewords(), true,this.program)); } else { f.println("<TD ALIGN=left BGCOLOR=#c0c0ff>-"); f.println("</TR>"); f.println("</TABLE>\n<P>\n"); f.println("<H5>" + msg.getString("Clusters.Distribution_of_cluster_size") + ":</H5>");
f.println(headerStr + " (<a href=\"help-sim-" + program.getCountryTag() + ".html\"><small><font color=\"#000088\">" + msg.getString("Report.WhatIsThis") + "</font></small></a>):</H4>"); f.println("<p><a href=\"" + csvfile + "\">download csv</a></p>"); f.println("<TABLE CELLPADDING=3 CELLSPACING=2>"); f.println("</TD></TR>"); f.println("</TABLE><P>\n"); f.println("<!---->"); // important for front end
f.println("<BODY BGCOLOR=\"#ffffff\"" + (j == 1 ? " style=\"margin-left:25\">" : ">")); f.println("<HR>\n<H3><CENTER>" + files[x] + "</CENTER></H3><HR>"); if (this.language.isPreformated()) f.println("<PRE>"); for (int y = 0; y < text[x].length; y++) { f.print(text[x][y]); if (!this.language.isPreformated()) f.println("<BR>"); else f.println(); f.println("</PRE>"); f.println("\n</BODY>\n</HTML>"); f.close(); return f.bytesWritten();
writeHTMLHeader(f, msg.getString("Report.Clustering_Results")); String clustertype = msg.getString("Report.Type") + ": " + program.clusters.getType(); f.println("<BODY>\n<H2>" + msg.getString("Report.Clustering_Results") + " (" + clustertype + ")</H2>"); f.println("<H3><A HREF=\"dendro.html\">" + msg.getString("Report.Dendrogram") + "</A></H3>"); bytes += this.program.clusters.makeDendrograms(root, clustering); String clustertitle = TagParser.parse(msg.getString("Report.Clusters_for_Xpercent_treshold"), new String[] { threshold + "" }); f.println("<H3><A HREF=\"cluster" + threshold + ".html\">" + clustertitle + "</A></H3>"); HTMLFile f2 = openHTMLFile(root, "cluster" + threshold + ".html"); writeHTMLHeader(f2, clustertitle); f2.println("<BODY>\n<H2>" + clustertitle + " (" + clustertype + ")</H2>"); String text = program.clusters.printClusters(clustering, threshold, f2); f2.println("</BODY>\n</HTML>"); f2.close(); bytes += f2.bytesWritten(); String clustertitle = TagParser.parse(msg.getString("Report.Clusters_for_Xpercent_treshold"), new String[] { threshold + "" }); f.println("<H3><A HREF=\"cluster" + (int) threshold + ".html\">" + clustertitle + "</A></H3>"); HTMLFile f2 = openHTMLFile(root, "cluster" + (int) threshold + ".html"); writeHTMLHeader(f2, clustertitle); f2.println("<BODY>\n<H2>" + clustertitle + " (" + clustertype + ")</H2>"); String text = program.clusters.printClusters(clustering, (int) threshold, f2); f2.println("</BODY>\n</HTML>"); f2.close(); bytes += f2.bytesWritten(); f.println("</BODY>\n</HTML>");
public void writeIndexBegin(HTMLFile f, String title) { writeHTMLHeader(f, title); f.println("<BODY BGCOLOR=#ffffff LINK=#000088 VLINK=#000000 TEXT=#000000>"); f.println("<TABLE ALIGN=center CELLPADDING=2 CELLSPACING=1>"); f.println("<TR VALIGN=middle ALIGN=center BGCOLOR=#ffffff><TD>" + "<IMG SRC=\"logo.gif\" ALT=\"JPlag\" BORDER=0></TD>"); f.println("<TD><H1><BIG>" + title + "</BIG></H1></TD></TR>"); f.println("<TR BGCOLOR=\"#aaaaff\" VALIGN=\"top\"><TD>" + "<BIG><BIG>" + msg.getString("Report.Title") + ":</BIG></BIG><TD><BIG><BIG><CODE>" + program.get_title() + "</CODE></BIG></BIG></TD></TR>"); if (program.get_original_dir() != null) f.println("<TR BGCOLOR=#aaaaff VALIGN=top><TD>" + "<BIG>" + msg.getString("Report.Directory") + ":</BIG></TD><TD><BIG><CODE>" + program.get_original_dir() + (program.get_sub_dir() == null ? "" : File.separator + "*" + File.separator + program.get_sub_dir()) } else { if (this.program.get_original_dir() == null) f.println("<TR BGCOLOR=#aaaaff VALIGN=top><TD>" + "<BIG><BIG>" + msg.getString("Report.Directory") + ":</BIG></BIG><TD><BIG><BIG><CODE>" + msg.getString("Report.Not_available") + "</CODE></BIG></BIG></TD></TR>"); else f.println("<TR BGCOLOR=#aaaaff VALIGN=top><TD>" + "<BIG><BIG>" + msg.getString("Report.Directory") + ":</BIG></BIG></TD><TD><BIG><BIG><CODE>" + program.get_original_dir() + (program.get_sub_dir() == null ? "" : File.separator + "*" + File.separator + program.get_sub_dir()) f.println("<TR BGCOLOR=#aaaaff VALIGN=top><TD>" + msg.getString("Report.Programs") + ":</TD><TD>"); f.println("<CODE>" + program.allValidSubmissions(" - ") + "</CODE></TD></TR>"); f.println("<TR BGCOLOR=#aaaaff VALIGN=top><TD>" + msg.getString("Report.Language") + ":</TD><TD>" + this.language.name() + "</TD></TR>"); f.print("<TR BGCOLOR=#aaaaff VALIGN=top><TD>" + msg.getString("Report.Submissions") + ":</TD><TD>" + TagParser.parse(msg.getString("Report.X_have_not_been_parsed_successfully"), new String[] { program.getErrors()
f.println("<P><A NAME=\"matches\"><H4>Matches:</H4><P>"); f.println("<TABLE CELLPADDING=3 CELLSPACING=2>"); boolean once = true; for (Iterator<AllMatches> iter = matches.iterator(); iter.hasNext(); ) { match = iter.next(); if (once) { f.println("<TR><TD BGCOLOR=" + this.report.color(match.percent(), 128, 192, 128, 192, 255, 255) + ">" + s1.name + "<TD WIDTH=\"10\">->"); once = false; f.println(" <TD BGCOLOR=" + this.report.color(match.percent(), 128, 192, 128, 192, 255, 255) + " ALIGN=center><A HREF=\"match" + matchIndex + ".html\">" + match.subName(other) + "</A><BR><FONT COLOR=\"" + this.report.color(match.percent(), 0, 255, 0, 0, 0, 0) + "\"><B>(" + match.roundedPercent() + "%)</B></FONT>"); this.report.writeMatch(root, matchIndex++, match); f.println("</TR>"); f.println("</TABLE><P>\n"); f.println("<!---->"); this.report.writeIndexEnd(f); f.close();
f.println("<BODY BGCOLOR=\"#ffffff\"" + (j == 1 ? " style=\"margin-left:25\">" : ">")); f.println("<HR>\n<H3><CENTER>" + files[x] + "</CENTER></H3><HR>"); if (this.language.isPreformated()) f.println("<PRE>"); for (int y = 0; y < text[x].length; y++) { f.print(text[x][y]); if (!this.language.isPreformated()) f.println("<BR>"); else f.println(); f.println("</PRE>"); f.println("</BODY>\n</HTML>"); f.close(); return f.bytesWritten();
f.println("<HR><H4><A HREF=\"cluster.html\">" + msg.getString("Report.Clustering_Results") + "</A></H4>"); f.println("directory" + "\t" + program.get_original_dir() + (program.get_sub_dir() != null ? File.separator + "*" + File.separator + program.get_sub_dir() : "")); f.println("language" + "\t" + language.name()); f.println("submissions" + "\t" + program.validSubmissions()); f.println("errors" + "\t" + program.getErrors()); f.close();