*/
package jalview.workers;
+import java.awt.Color;
+import java.util.ArrayList;
+import java.util.List;
+
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import jalview.datamodel.AlignmentAnnotation;
import jalview.util.ColorUtils;
import jalview.util.Comparison;
-import java.awt.Color;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* A class to compute alignment annotations with column counts for a set of
* properties of interest on positions in an alignment. <br>
return annotationAdded;
}
+ void removeOldAnnotations(String[] annotDescs)
+ {
+ // TODO use the commented out code once JAL-2075 is fixed
+ // to get adequate performance on genomic length sequence
+ AlignmentI alignment = alignViewport.getAlignment();
+ ArrayList<AlignmentAnnotation> toRemove = new ArrayList<AlignmentAnnotation>();
+ for (String toRemoveDesc : annotDescs)
+ {
+ for (AlignmentAnnotation aa : ourAnnots)
+ {
+ if (toRemoveDesc.equals(aa.getCalcId()))
+ toRemove.add(aa);
+ }
+ }
+ for (AlignmentAnnotation deleted : toRemove)
+ {
+ alignment.deleteAnnotation(deleted);
+ }
+ }
+
/**
* Returns a count of any feature types present at the specified position of
* the alignment