From: Jim Procter Date: Wed, 22 May 2013 16:53:03 +0000 (+0100) Subject: fix for JAL-1297: COMBINE output now follows specification and all additional annotat... X-Git-Tag: Jalview_2_9~249^2~14 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7a48562b8052a1ac9fb7c337d58b910f6f7fe0b5;p=jalview.git fix for JAL-1297: COMBINE output now follows specification and all additional annotation rows included in output (not just the first one which wasn't hidden) --- diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index a94bd3c..d15e7c5 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -132,6 +132,7 @@ public class AnnotationFile StringBuffer graphLine = new StringBuffer(); StringBuffer rowprops = new StringBuffer(); Hashtable graphGroup = new Hashtable(); + BitSet graphGroupSeen = new BitSet(); java.awt.Color color; @@ -139,7 +140,7 @@ public class AnnotationFile { row = annotations[i]; - if (!row.visible && !row.hasScore()) + if (!row.visible && !row.hasScore() && !(row.graphGroup>-1 && graphGroupSeen.get(row.graphGroup))) { continue; } @@ -251,6 +252,7 @@ public class AnnotationFile if (row.graphGroup > -1) { + graphGroupSeen.set(row.graphGroup); String key = String.valueOf(row.graphGroup); if (graphGroup.containsKey(key)) { @@ -382,10 +384,10 @@ public class AnnotationFile text.append(graphLine.toString()); if (graphGroup.size() > 0) { - text.append("COMBINE\t"); Enumeration en = graphGroup.elements(); while (en.hasMoreElements()) { + text.append("COMBINE\t"); text.append(en.nextElement()); text.append(newline); }