JAL-2591 Hidden columns regions can be output to string + test
[jalview.git] / src / jalview / io / AnnotationFile.java
index 2b78cb6..b669ee5 100755 (executable)
@@ -171,21 +171,9 @@ public class AnnotationFile
     if (cs != null && cs.hasHiddenColumns())
     {
       text.append("VIEW_HIDECOLS\t");
-      boolean comma = false;
-      for (int[] r : cs.getHiddenRegions())
-      {
-        if (!comma)
-        {
-          comma = true;
-        }
-        else
-        {
-          text.append(",");
-        }
-        text.append(r[0]);
-        text.append("-");
-        text.append(r[1]);
-      }
+
+      String regions = cs.regionsToString(",", "-");
+      text.append(regions);
       text.append("\n");
     }
     // TODO: allow efficient recovery of annotation data shown in several