From: jprocter Date: Thu, 3 Nov 2011 17:42:38 +0000 (+0000) Subject: (JAL-811) - workers hold references to generated annotation rows X-Git-Tag: Jalview_2_9~564^2~9 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=285069b142906cbc1bd18b09b61ddb996aeb1617;p=jalview.git (JAL-811) - workers hold references to generated annotation rows --- diff --git a/src/jalview/api/AlignCalcWorkerI.java b/src/jalview/api/AlignCalcWorkerI.java index 63e7bf9..00f967a 100644 --- a/src/jalview/api/AlignCalcWorkerI.java +++ b/src/jalview/api/AlignCalcWorkerI.java @@ -1,6 +1,11 @@ package jalview.api; +import jalview.datamodel.AlignmentAnnotation; + public interface AlignCalcWorkerI extends Runnable { + public boolean involves(AlignmentAnnotation annot); + + public void updateAnnotation(); } diff --git a/src/jalview/workers/AlignCalcWorker.java b/src/jalview/workers/AlignCalcWorker.java index 41022e5..50be3e4 100644 --- a/src/jalview/workers/AlignCalcWorker.java +++ b/src/jalview/workers/AlignCalcWorker.java @@ -3,10 +3,13 @@ */ package jalview.workers; +import java.util.List; + import jalview.api.AlignCalcManagerI; import jalview.api.AlignCalcWorkerI; import jalview.api.AlignViewportI; import jalview.api.AlignmentViewPanel; +import jalview.datamodel.AlignmentAnnotation; /** * Base class for alignment calculation workers @@ -21,7 +24,8 @@ public abstract class AlignCalcWorker implements AlignCalcWorkerI protected AlignViewportI alignViewport; protected AlignCalcManagerI calcMan; protected AlignmentViewPanel ap; - + protected List ourAnnots=null; + public AlignCalcWorker(AlignViewportI alignViewport, AlignmentViewPanel alignPanel) { @@ -39,6 +43,9 @@ public abstract class AlignCalcWorker implements AlignCalcWorkerI ap=null; } - + public boolean involves(AlignmentAnnotation i) + { + return ourAnnots!=null && ourAnnots.contains(i); + } }