{\r
SequenceRenderer sr = new SequenceRenderer(null);\r
\r
- public HTMLOutput(AlignmentI alignment, ColourSchemeI cs)\r
+ public HTMLOutput(AlignViewport av)\r
{\r
Color color;\r
JFileChooser chooser = new JFileChooser(jalview.bin.Cache.LAST_DIRECTORY);\r
out.println("<HTML>");\r
out.println("<style type=\"text/css\">");\r
out.println("<!--");\r
- out.println("td {font-family: \"Courier New\", Courier, mono; font-size: medium;");\r
- out.println(" font-size: medium; text-align: center; }");\r
+ out.println("td {font-family: \"Courier New\", Courier, mono;; font-size: medium; text-align: center; }");\r
out.println("-->");\r
out.println("</style>");\r
out.println("<BODY>");\r
\r
\r
//////////////\r
+ SequenceGroup group;\r
+ SequenceI seq;\r
+ ColourSchemeI cs;\r
+ AlignmentI alignment = av.getAlignment();\r
+ String r,g,b;\r
for (int i = 0; i < alignment.getHeight(); i++)\r
{\r
- SequenceI seq = alignment.getSequenceAt(i);\r
+ seq = alignment.getSequenceAt(i);\r
+ group = alignment.findGroup( seq );\r
out.println("<tr><td>"+seq.getName()+" </td>");\r
for (int res = 0; res < seq.getLength(); res++)\r
{\r
+ if(group!=null && group.getStartRes()<=res && group.getEndRes()>=res)\r
+ cs = group.cs;\r
+ else\r
+ cs = av.getGlobalColourScheme();\r
+\r
color = sr.getResidueBoxColour(cs, seq, res);\r
\r
if(color.getRGB()<-1)\r
{\r
- out.println("<td bgcolor=\"#"\r
- + Integer.toHexString(color.getRed())\r
- + Integer.toHexString(color.getGreen())\r
- + Integer.toHexString(color.getBlue())\r
- + "\">"+seq.getCharAt(res)+"</td>");\r
+ r = Integer.toHexString(color.getRed());\r
+ if(r.length()<2)\r
+ r = "0"+r;\r
+ g = Integer.toHexString(color.getGreen());\r
+ if(g.length()<2)\r
+ g = "0"+g;\r
+ b = Integer.toHexString(color.getBlue());\r
+ if(b.length()<2)\r
+ b = "0"+b;\r
+ out.println("<td bgcolor=\"#"+ r + g + b + "\">"+seq.getCharAt(res)+"</td>");\r
}\r
else\r
out.println("<td>"+seq.getCharAt(res)+"</td>");\r