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 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; }
f.print("<A NAME=\"" + perm[index - 1] + "\"></A>"); f.print("<FONT color=\"" + Colors.getColor(perm[index - 1]) + "\"><B>"); f.print("<"); } else if (buffer[charNr] == '>') { f.print(">"); } else if (buffer[charNr] == '\n') { f.print("<br>\n"); } else f.print(buffer[charNr]); f.print("</B></FONT>");
continue; f.print("<TR><TD ALIGN=center BGCOLOR=#8080ff>" + i + "<TD ALIGN=center BGCOLOR=#c0c0ff>" + cluster.size() + "<TD ALIGN=center BGCOLOR=#c0c0ff>" + cluster.getSimilarity() Submission sub = iter.next(); int index = submissions.indexOf(sub); f.print("<A HREF=\"submission"+index+".html\">"+sub.name+"</A>"); if (iter.hasNext()) f.print(", "); f.print(text); return text;
if (!header) { // only print header when necessary! header = true; f.print("<TR><TD BGCOLOR=" + color(helper.getPercent(match), 128, 192, 128, 192, 255, 255) + ">" + name + "</TD><TD><nobr>-></nobr>"); f.print("</TD><TD BGCOLOR=" + color(percent, 128, 192, 128, 192, 255, 255) + " ALIGN=center><A HREF=\"match" + getMatchIndex(output) + ".html\">" + output.subName(other) + "</A><BR><FONT COLOR=\"" + color(percent, 0, 255, 0, 0, 0, 0) + "\">(" + (((int) (percent * 10)) / (float) 10) + "%)</FONT>");
f.println("<PRE>"); for (int y = 0; y < text[x].length; y++) { f.print(text[x][y]); if (!this.language.isPreformated()) f.println("<BR>");
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>" + this.program.validSubmissions()); if (program.getErrors() != 0) { if (this.program.getErrors() == 1) f.print(" <b>(" + msg.getString("Report.1_has_not_been_parsed_successfully") + ")</b>"); else if (this.program.getErrors() > 1) f.print(" <b>(" + TagParser.parse(msg.getString("Report.X_have_not_been_parsed_successfully"), new String[] { program.getErrors() + "" }) + ")</b>"); f.print("<TR BGCOLOR=#aaaaff VALIGN=top><TD>" + msg.getString("Report.Basecode_submission") + ":</TD>" + "<TD>" + this.program.get_basecode() + "</TD></TR>"); f.print(this.program.get_suffixes()[i] + (i < this.program.get_suffixes().length - 1 ? ", " : "</TD></TR>\n")); f.println("</TABLE>\n<HR>");
f.println("<PRE>"); for (int y = 0; y < text[x].length; y++) { f.print(text[x][y]); if (!this.language.isPreformated()) f.println("<BR>");