4 package jalview.workers;
8 import jalview.api.AlignCalcManagerI;
9 import jalview.api.AlignCalcWorkerI;
10 import jalview.api.AlignViewportI;
11 import jalview.api.AlignmentViewPanel;
12 import jalview.datamodel.AlignmentAnnotation;
13 import jalview.datamodel.AlignmentI;
16 * Base class for alignment calculation workers
21 public abstract class AlignCalcWorker implements AlignCalcWorkerI
24 * manager and data source for calculations
26 protected AlignViewportI alignViewport;
28 protected AlignCalcManagerI calcMan;
30 protected AlignmentViewPanel ap;
32 protected List<AlignmentAnnotation> ourAnnots = null;
34 public AlignCalcWorker(AlignViewportI alignViewport,
35 AlignmentViewPanel alignPanel)
37 this.alignViewport = alignViewport;
38 calcMan = alignViewport.getCalcManager();
42 protected void abortAndDestroy()
46 calcMan.workerComplete(this);
54 public boolean involves(AlignmentAnnotation i)
56 return ourAnnots != null && ourAnnots.contains(i);
60 * permanently remove from the alignment all annotation rows managed by this
64 public void removeOurAnnotation()
66 if (ourAnnots != null && alignViewport != null)
68 AlignmentI alignment = alignViewport.getAlignment();
69 synchronized (ourAnnots)
71 for (AlignmentAnnotation aa : ourAnnots)
73 alignment.deleteAnnotation(aa, true);
78 // TODO: allow GUI to query workers associated with annotation to add items to
79 // annotation label panel popup menu