X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fworkers%2FAlignCalcWorker.java;h=f1b30194df3c1ec5050c1172309bfe4b35dde2ad;hb=3eef76298c55f3def21eed2516b5ace4405bed0a;hp=19a92fb7140ace2499ee48cb525fb108c33fa6f3;hpb=fcd5e2c2998725ebbea42d08f02eaf13206f7585;p=jalview.git diff --git a/src/jalview/workers/AlignCalcWorker.java b/src/jalview/workers/AlignCalcWorker.java index 19a92fb..f1b3019 100644 --- a/src/jalview/workers/AlignCalcWorker.java +++ b/src/jalview/workers/AlignCalcWorker.java @@ -10,6 +10,7 @@ import jalview.api.AlignCalcWorkerI; import jalview.api.AlignViewportI; import jalview.api.AlignmentViewPanel; import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.AlignmentI; /** * Base class for alignment calculation workers @@ -47,7 +48,24 @@ public abstract class AlignCalcWorker implements AlignCalcWorkerI { return ourAnnots!=null && ourAnnots.contains(i); } - + + /** + * permanently remove from the alignment all annotation rows managed by this worker + */ + @Override + public void removeOurAnnotation() + { + if (ourAnnots!=null && alignViewport!=null) + { + AlignmentI alignment=alignViewport.getAlignment(); + synchronized (ourAnnots) { + for (AlignmentAnnotation aa:ourAnnots) + { + alignment.deleteAnnotation(aa, true); + } + } + } + } // TODO: allow GUI to query workers associated with annotation to add items to annotation label panel popup menu }