X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignment.java;h=10e2766580e9b93626d49e15f965b50b379d717d;hb=1a6fbadeec90e7524075ed6e37bbe4b7bba97a94;hp=86d2c0e4e2ca02264b95132d26eedef5618ecb8a;hpb=cd1ded4a9a6f3478f3b704c9c97fd323ac5dbdd7;p=jalview.git diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 86d2c0e..10e2766 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -13,6 +13,10 @@ public class Alignment implements AlignmentI protected Vector groups = new Vector(); protected ArrayList superGroup = new ArrayList(); protected char gapCharacter = '-'; + public AlignmentAnnotation [] annotations; + public Conservation conservation; + + public boolean featuresAdded = false; /** Make an alignment from an array of Sequences. * @@ -503,8 +507,52 @@ public class Alignment implements AlignmentI return false; return true; + } + + public void deleteAnnotation(AlignmentAnnotation aa) + { + int aSize = 1; + if(annotations!=null) + aSize = annotations.length; + + AlignmentAnnotation [] temp = new AlignmentAnnotation [aSize-1]; + + int tIndex = 0; + for (int i = 0; i < aSize; i++) + { + if(annotations[i]==aa) + continue; + + + temp[tIndex] = annotations[i]; + tIndex++; + } + + annotations = temp; + } + + public void addAnnotation(AlignmentAnnotation aa) + { + int aSize = 1; + if(annotations!=null) + aSize = annotations.length+1; + + AlignmentAnnotation [] temp = new AlignmentAnnotation [aSize]; + int i=0; + if (aSize > 1) + for (i = 0; i < aSize-1; i++) + temp[i] = annotations[i]; + + temp[i] = aa; + + annotations = temp; } + public AlignmentAnnotation[] getAlignmentAnnotation() + { + return annotations; + } + }