consensus held in residueColour
[jalview.git] / src / jalview / datamodel / Alignment.java
index 5adb70d..10e2766 100755 (executable)
@@ -13,6 +13,9 @@ public class Alignment implements AlignmentI
   protected Vector      groups = new Vector();\r
   protected ArrayList   superGroup = new ArrayList();\r
   protected char        gapCharacter = '-';\r
+  public AlignmentAnnotation [] annotations;\r
+  public Conservation conservation;\r
+\r
   public boolean featuresAdded = false;\r
 \r
   /** Make an alignment from an array of Sequences.\r
@@ -504,8 +507,52 @@ public class Alignment implements AlignmentI
         return false;\r
 \r
     return true;\r
+  }\r
+\r
+   public void deleteAnnotation(AlignmentAnnotation aa)\r
+   {\r
+     int aSize = 1;\r
+     if(annotations!=null)\r
+       aSize = annotations.length;\r
+\r
+     AlignmentAnnotation [] temp = new AlignmentAnnotation [aSize-1];\r
+\r
+     int tIndex = 0;\r
+     for (int i = 0; i < aSize; i++)\r
+      {\r
+        if(annotations[i]==aa)\r
+          continue;\r
+\r
+\r
+        temp[tIndex] = annotations[i];\r
+        tIndex++;\r
+      }\r
+\r
+     annotations = temp;\r
 \r
+   }\r
+\r
+  public void addAnnotation(AlignmentAnnotation aa)\r
+  {\r
+    int aSize = 1;\r
+    if(annotations!=null)\r
+      aSize = annotations.length+1;\r
+\r
+    AlignmentAnnotation [] temp = new AlignmentAnnotation [aSize];\r
+    int i=0;\r
+    if (aSize > 1)\r
+      for (i = 0; i < aSize-1; i++)\r
+        temp[i] = annotations[i];\r
+\r
+    temp[i] = aa;\r
+\r
+    annotations = temp;\r
   }\r
+  public AlignmentAnnotation[] getAlignmentAnnotation()\r
+  {\r
+    return annotations;\r
+  }\r
+\r
 }\r
 \r
 \r