alignmentProperties added
[jalview.git] / src / jalview / datamodel / Alignment.java
index d26314e..34cc78f 100755 (executable)
@@ -40,6 +40,8 @@ public class Alignment
 
   HiddenSequences hiddenSequences = new HiddenSequences(this);
 
+  public Hashtable alignmentProperties;
+
   private void initAlignment(SequenceI[] seqs)
   {
     int i = 0;
@@ -149,7 +151,7 @@ public class Alignment
         // derive new sequence
         SequenceI adding = snew.deriveSequence();
         getDataset().addSequence(adding.getDatasetSequence());
-        snew = adding;        
+        snew = adding;
       }
     }
     if (sequences==null) {
@@ -466,6 +468,9 @@ public class Alignment
    */
   public void deleteAnnotation(AlignmentAnnotation aa)
   {
+    if(aa.sequenceRef!=null)
+      aa.sequenceRef.removeAlignmentAnnotation(aa);
+
     int aSize = 1;
 
     if (annotations != null)
@@ -699,4 +704,21 @@ public class Alignment
     return cal;
   }
 
+  public void setProperty(Object key, Object value)
+  {
+    if(alignmentProperties==null)
+      alignmentProperties = new Hashtable();
+
+    alignmentProperties.put(key,value);
+  }
+
+  public Object getProperty(Object key)
+  {
+    if(alignmentProperties!=null)
+      return alignmentProperties.get(key);
+    else
+      return null;
+  }
+
+
 }