From: amwaterhouse Date: Thu, 17 Nov 2005 15:17:08 +0000 (+0000) Subject: Now outputs features and groups, and wrapped alignment limits X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ff5993cdddf0e67bd8605060cab189b6902036cd;p=jalview.git Now outputs features and groups, and wrapped alignment limits --- diff --git a/src/jalview/io/HTMLOutput.java b/src/jalview/io/HTMLOutput.java index 257e9fa..7290828 100755 --- a/src/jalview/io/HTMLOutput.java +++ b/src/jalview/io/HTMLOutput.java @@ -30,12 +30,14 @@ public class HTMLOutput { AlignViewport av; SequenceRenderer sr; + FeatureRenderer fr; Color color; - public HTMLOutput(AlignViewport av) + public HTMLOutput(AlignViewport av, SequenceRenderer sr, FeatureRenderer fr) { this.av = av; - sr = new SequenceRenderer(av); + this.sr = sr; + this.fr = fr; JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache. getProperty( @@ -110,9 +112,7 @@ public class HTMLOutput "\n"); ////////////// - SequenceGroup[] groups; SequenceI seq; - ColourSchemeI cs = null; AlignmentI alignment = av.getAlignment(); // draws the top row, the measure rule @@ -132,7 +132,6 @@ public class HTMLOutput for (i = 0; i < alignment.getHeight(); i++) { seq = alignment.getSequenceAt(i); - groups = alignment.findAllGroups(seq); String id = seq.getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix()); @@ -142,25 +141,12 @@ public class HTMLOutput for (int res = 0; res < seq.getLength(); res++) { - cs = av.getGlobalColourScheme(); - if (groups != null) - { - for (int k = 0; k < groups.length; k++) - { - if ( (groups[k].getStartRes() <= res) && - (groups[k].getEndRes() >= res)) - { - cs = groups[k].cs; - - break; - } - } - } + color = sr.findSequenceColour(Color.white, seq, res); - color = sr.getResidueBoxColour(cs, seq, res); + color = fr.findFeatureColour(color, seq, res); - if (color.getRGB() < -1) + if (color.getRGB() < -1) { out.println(""); - out.println(""); - - for (int i = startRes + 10; i < endRes; i += 10) + if(av.getScaleAboveWrapped()) { - out.println(""); - } + out.println(""); - // out.println(""); - out.println(""); + if (av.getScaleLeftWrapped()) + out.println(""); + else + out.println(""); + + + for (int i = startRes + 10; i < endRes; i += 10) + { + out.println(""); + } + out.println(""); + } + + int startPos, endPos; for (int s = 0; s < al.getHeight(); s++) { out.println(""); seq = al.getSequenceAt(s); - groups = al.findAllGroups(seq); + + startPos = seq.findPosition( startRes ); + endPos = seq.findPosition( endRes )-1; String id = seq.getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix()); - out.println(""); - for (int res = startRes; res < endRes; res++) + if(av.getScaleLeftWrapped()) { - cs = av.getGlobalColourScheme(); + if(startPos > seq.getEnd() || endPos==0) + out.println(""); + else + out.println(""); + } - if (groups != null) - { - for (int k = 0; k < groups.length; k++) - { - if ( (groups[k].getStartRes() <= res) && - (groups[k].getEndRes() >= res)) - { - cs = groups[k].cs; - break; - } - } - } + for (int res = startRes; res < endRes; res++) + { + color = sr.findSequenceColour(Color.white, seq, res); - color = sr.getResidueBoxColour(cs, seq, res); + color = fr.findFeatureColour(color, seq, res); if (color.getRGB() < -1) { @@ -280,8 +269,25 @@ public class HTMLOutput { out.println(""); } + + + } + + if(av.getScaleRightWrapped() && + endRes < startRes + av.getWrappedWidth()) + { + out.println(""); + } + + + if(av.getScaleRightWrapped() && startPos " + endPos + + "  "); } + out.println(""); }
" + @@ -185,9 +171,7 @@ public class HTMLOutput //////////////////////////////////// /// How many sequences and residues can we fit on a printable page? AlignmentI al = av.getAlignment(); - SequenceGroup[] groups; SequenceI seq; - ColourSchemeI cs = null; String r; String g; String b; @@ -206,49 +190,54 @@ public class HTMLOutput endRes = al.getWidth(); } - out.println("
 " + i + "
|
" + i + - // "
|
  " + i + "
|
" + id + + out.println("" + id + "   " + startPos + + "  " + seq.getCharAt(res) + "" + +"