beginnings of view definition capability for annotations file
authorjprocter <Jim Procter>
Wed, 31 Oct 2007 15:11:12 +0000 (15:11 +0000)
committerjprocter <Jim Procter>
Wed, 31 Oct 2007 15:11:12 +0000 (15:11 +0000)
src/jalview/io/AnnotationFile.java

index 577b7e4..6285cf1 100755 (executable)
@@ -33,11 +33,42 @@ public class AnnotationFile
       "JALVIEW_ANNOTATION\n"\r
       + "# Created: "\r
       + new java.util.Date() + "\n\n");\r
-\r
+  /**\r
+   * convenience method for pre-2.4 feature files which have no view, hidden columns or hidden row keywords.\r
+   * @param annotations\r
+   * @param groups\r
+   * @param properties\r
+   * @return feature file as a string.\r
+   */\r
   public String printAnnotations(AlignmentAnnotation[] annotations,\r
                                  Vector groups,\r
                                  Hashtable properties)\r
   {\r
+    return printAnnotations(annotations, groups,\r
+            properties, null);\r
+\r
+  }\r
+  /**\r
+   * hold all the information about a particular view definition\r
+   * read from or written out in an annotations file.\r
+   */\r
+  public class ViewDef {\r
+    public String viewname;\r
+    public HiddenSequences hidseqs;\r
+    public ColumnSelection hiddencols;\r
+    public Vector visibleGroups;\r
+    public ViewDef(String viewname, HiddenSequences hidseqs,\r
+            ColumnSelection hiddencols)\r
+    {\r
+      this.viewname = viewname;\r
+      this.hidseqs = hidseqs;\r
+      this.hiddencols = hiddencols;\r
+    }\r
+  }\r
+  public String printAnnotations(AlignmentAnnotation[] annotations,\r
+          Vector groups,\r
+          Hashtable properties, ViewDef[] views)\r
+  {\r
     if (annotations != null)\r
     {\r
       boolean oneColour = true;\r
@@ -221,7 +252,7 @@ public class AnnotationFile
       }\r
 \r
     }\r
-\r
+    \r
     return text.toString();\r
   }\r
 \r