{\r
AlignViewport av;\r
SequenceRenderer sr;\r
+ FeatureRenderer fr;\r
Color color;\r
\r
- public HTMLOutput(AlignViewport av)\r
+ public HTMLOutput(AlignViewport av, SequenceRenderer sr, FeatureRenderer fr)\r
{\r
this.av = av;\r
- sr = new SequenceRenderer(av);\r
+ this.sr = sr;\r
+ this.fr = fr;\r
\r
JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache.\r
getProperty(\r
"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n");\r
\r
//////////////\r
- SequenceGroup[] groups;\r
SequenceI seq;\r
- ColourSchemeI cs = null;\r
AlignmentI alignment = av.getAlignment();\r
\r
// draws the top row, the measure rule\r
for (i = 0; i < alignment.getHeight(); i++)\r
{\r
seq = alignment.getSequenceAt(i);\r
- groups = alignment.findAllGroups(seq);\r
\r
String id = seq.getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix());\r
\r
\r
for (int res = 0; res < seq.getLength(); res++)\r
{\r
- cs = av.getGlobalColourScheme();\r
\r
- if (groups != null)\r
- {\r
- for (int k = 0; k < groups.length; k++)\r
- {\r
- if ( (groups[k].getStartRes() <= res) &&\r
- (groups[k].getEndRes() >= res))\r
- {\r
- cs = groups[k].cs;\r
-\r
- break;\r
- }\r
- }\r
- }\r
+ color = sr.findSequenceColour(Color.white, seq, res);\r
\r
- color = sr.getResidueBoxColour(cs, seq, res);\r
+ color = fr.findFeatureColour(color, seq, res);\r
\r
- if (color.getRGB() < -1)\r
+ if (color.getRGB() < -1)\r
{\r
out.println("<td bgcolor=\"#" +\r
jalview.util.Format.getHexString(color) + "\">" +\r
////////////////////////////////////\r
/// How many sequences and residues can we fit on a printable page?\r
AlignmentI al = av.getAlignment();\r
- SequenceGroup[] groups;\r
SequenceI seq;\r
- ColourSchemeI cs = null;\r
String r;\r
String g;\r
String b;\r
endRes = al.getWidth();\r
}\r
\r
- out.println("<tr>");\r
- out.println("<td colspan=\"6\"> </td>");\r
-\r
- for (int i = startRes + 10; i < endRes; i += 10)\r
+ if(av.getScaleAboveWrapped())\r
{\r
- out.println("<td colspan=\"9\">" + i + "<br>|</td><td></td>");\r
- }\r
+ out.println("<tr>");\r
\r
- // out.println("<td colspan=\"3\"></td><td colspan=\"3\">" + i +\r
- // "<br>|</td>");\r
- out.println("</tr>");\r
+ if (av.getScaleLeftWrapped())\r
+ out.println("<td colspan=\"7\"> </td>");\r
+ else\r
+ out.println("<td colspan=\"6\"> </td>");\r
+\r
+\r
+ for (int i = startRes + 10; i < endRes; i += 10)\r
+ {\r
+ out.println("<td colspan=\"9\">" + i + "<br>|</td><td></td>");\r
+ }\r
\r
+ out.println("</tr>");\r
+ }\r
+\r
+ int startPos, endPos;\r
for (int s = 0; s < al.getHeight(); s++)\r
{\r
out.println("<tr>");\r
seq = al.getSequenceAt(s);\r
- groups = al.findAllGroups(seq);\r
+\r
+ startPos = seq.findPosition( startRes );\r
+ endPos = seq.findPosition( endRes )-1;\r
\r
String id = seq.getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix());\r
\r
- out.println("<td nowrap>" + id +\r
+ out.println("<td nowrap>" + id +\r
" </td>");\r
\r
\r
- for (int res = startRes; res < endRes; res++)\r
+ if(av.getScaleLeftWrapped())\r
{\r
- cs = av.getGlobalColourScheme();\r
+ if(startPos > seq.getEnd() || endPos==0)\r
+ out.println("<td nowrap> </td>");\r
+ else\r
+ out.println("<td nowrap>" + startPos +\r
+ " </td>");\r
+ }\r
\r
- if (groups != null)\r
- {\r
- for (int k = 0; k < groups.length; k++)\r
- {\r
- if ( (groups[k].getStartRes() <= res) &&\r
- (groups[k].getEndRes() >= res))\r
- {\r
- cs = groups[k].cs;\r
\r
- break;\r
- }\r
- }\r
- }\r
+ for (int res = startRes; res < endRes; res++)\r
+ {\r
+ color = sr.findSequenceColour(Color.white, seq, res);\r
\r
- color = sr.getResidueBoxColour(cs, seq, res);\r
+ color = fr.findFeatureColour(color, seq, res);\r
\r
if (color.getRGB() < -1)\r
{\r
{\r
out.println("<td>" + seq.getCharAt(res) + "</td>");\r
}\r
+\r
+\r
+ }\r
+\r
+ if(av.getScaleRightWrapped() &&\r
+ endRes < startRes + av.getWrappedWidth())\r
+ {\r
+ out.println("<td colspan=\""+ (startRes+av.getWrappedWidth()-endRes) +"\">"\r
+ +" </td>");\r
+ }\r
+\r
+\r
+ if(av.getScaleRightWrapped() && startPos<endPos)\r
+ {\r
+ out.println("<td nowrap> " + endPos +\r
+ " </td>");\r
}\r
\r
+\r
out.println("</tr>");\r
}\r
\r