JAL-1503 update version in GPL header
[jalview.git] / src / jalview / datamodel / Alignment.java
index ed65dd5..5d97fe3 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
  * Copyright (C) 2014 The Jalview Authors
  * 
  * This file is part of Jalview.
@@ -371,7 +371,7 @@ public class Alignment implements AlignmentI
             return;
           }
         }
-
+        sg.setContext(this);
         groups.add(sg);
       }
     }
@@ -446,6 +446,9 @@ public class Alignment implements AlignmentI
       {
         removeAnnotationForGroup(null);
       }
+      for (SequenceGroup sg:groups) {
+        sg.setContext(null);
+      }
       groups.clear();
     }
   }
@@ -460,6 +463,7 @@ public class Alignment implements AlignmentI
       {
         removeAnnotationForGroup(g);
         groups.remove(g);
+        g.setContext(null);
       }
     }
   }
@@ -1498,4 +1502,14 @@ public int getStartRes()
 {
   return 0;
 }
+
+/* In the case of AlignmentI - returns the dataset for the alignment, if set
+ * (non-Javadoc)
+ * @see jalview.datamodel.AnnotatedCollectionI#getContext()
+ */
+@Override
+public AnnotatedCollectionI getContext()
+{
+  return dataset;
+}
 }