X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignment.java;h=10e2766580e9b93626d49e15f965b50b379d717d;hb=ac4bbf6dd2bfccdaae9067fb4765c73600dea729;hp=5adb70dc257b3b83711e814f8d7a3810ce77e5b9;hpb=e4132370d9c650072833b53b93a4dc8dcbf92bda;p=jalview.git diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 5adb70d..10e2766 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -13,6 +13,9 @@ 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. @@ -504,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; + } + }