Dispalys rule along top of output
authoramwaterhouse <Andrew Waterhouse>
Fri, 14 Jan 2005 15:46:32 +0000 (15:46 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 14 Jan 2005 15:46:32 +0000 (15:46 +0000)
src/jalview/io/HTMLOutput.java

index af6e255..d15a6e8 100755 (executable)
@@ -50,22 +50,41 @@ public class HTMLOutput
 \r
 \r
         //////////////\r
-        SequenceGroup group;\r
+        SequenceGroup [] groups;\r
         SequenceI seq;\r
-        ColourSchemeI cs;\r
+        ColourSchemeI cs = null;\r
         AlignmentI alignment = av.getAlignment();\r
         String r,g,b;\r
-        for (int i = 0; i < alignment.getHeight(); i++)\r
+\r
+      // draws the top row, the measure rule\r
+        out.println("<tr><td colspan=\"6\"></td>");\r
+        int i=0;\r
+        for(i=10; i<alignment.getWidth()-10; i+=10)\r
+          out.println("<td colspan=\"9\">"+i+"<br>|</td><td></td>");\r
+\r
+        out.println("<td colspan=\"3\"></td><td colspan=\"3\">"+i+"<br>|</td>");\r
+        out.println("</tr>");\r
+\r
+        for (i = 0; i < alignment.getHeight(); i++)\r
         {\r
           seq = alignment.getSequenceAt(i);\r
-          group = alignment.findGroup( seq );\r
+          groups = alignment.findAllGroups( seq );\r
           out.println("<tr><td nowrap>"+seq.getDisplayId()+"&nbsp;&nbsp;</td>");\r
+\r
+\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
+            cs = av.getGlobalColourScheme();\r
+\r
+            if(groups!=null)\r
+             {\r
+               for (int k = 0; k < groups.length; k++)\r
+                 if (groups[k].getStartRes() <= res && groups[k].getEndRes() >= res)\r
+                 {\r
+                   cs = groups[k].cs;\r
+                   break;\r
+                 }\r
+             }\r
 \r
 \r
             color = sr.getResidueBoxColour(cs, seq, res);\r