From 7a48562b8052a1ac9fb7c337d58b910f6f7fe0b5 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 22 May 2013 17:53:03 +0100 Subject: [PATCH] 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) --- src/jalview/io/AnnotationFile.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } -- 1.7.10.2