JAL-1641 cherry-picked changes into develop compatible branch
[jalview.git] / src / jalview / io / AlignFile.java
index 2962cb2..b2f8b2b 100755 (executable)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -22,13 +22,17 @@ package jalview.io;
 
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
 import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
 import jalview.util.MessageManager;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.Hashtable;
+import java.util.List;
 import java.util.Vector;
 
 /**
@@ -51,7 +55,12 @@ public abstract class AlignFile extends FileParse
   /**
    * annotation to be added to generated alignment object
    */
-  protected Vector annotations;
+  protected Vector<AlignmentAnnotation> annotations;
+
+  /**
+   * SequenceGroups to be added to the alignment object
+   */
+  protected List<SequenceGroup> seqGroups;
 
   /**
    * Properties to be added to generated alignment object
@@ -165,6 +174,11 @@ public abstract class AlignFile extends FileParse
     return seqs;
   }
 
+  public List<SequenceGroup> getSeqGroups()
+  {
+    return seqGroups;
+  }
+
   /**
    * Return the Sequences in the seqs Vector as an array of Sequences
    */
@@ -206,6 +220,12 @@ public abstract class AlignFile extends FileParse
 
   }
 
+  public void addSeqGroups(AlignmentI al)
+  {
+    this.seqGroups = al.getGroups();
+
+  }
+
   /**
    * Add any additional information extracted from the file to the alignment
    * properties.
@@ -269,6 +289,7 @@ public abstract class AlignFile extends FileParse
   {
     seqs = new Vector();
     annotations = new Vector();
+    seqGroups = new ArrayList<SequenceGroup>();
     parseCalled=false;
   }