X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fapi%2FAlignCalcWorkerI.java;h=b51b94ec098203f2845b125d736e25eb129b08c8;hb=772f645f8a2cb3c5d25eab36d875f2e09ceca48f;hp=00f967a6ff1cde6ecc89e69648b457ff311b5ef0;hpb=285069b142906cbc1bd18b09b61ddb996aeb1617;p=jalview.git diff --git a/src/jalview/api/AlignCalcWorkerI.java b/src/jalview/api/AlignCalcWorkerI.java index 00f967a..b51b94e 100644 --- a/src/jalview/api/AlignCalcWorkerI.java +++ b/src/jalview/api/AlignCalcWorkerI.java @@ -1,11 +1,68 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.api; +import java.util.concurrent.Callable; + import jalview.datamodel.AlignmentAnnotation; -public interface AlignCalcWorkerI extends Runnable +/** + * Interface describing a worker that calculates alignment annotation(s). The + * main (re-)calculation should be performed by the inherited run() method. + */ +public interface AlignCalcWorkerI { + /** + * Answers true if this worker updates the given annotation (regardless of its + * current state) + * + * @param annot + * @return + */ + boolean involves(AlignmentAnnotation annot); - public boolean involves(AlignmentAnnotation annot); + /** + * Updates the display of calculated annotation values (does not recalculate + * the values). This allows a quick redraw of annotations when display + * settings are changed. + */ + void updateAnnotation(); - public void updateAnnotation(); + /** + * Removes any annotation(s) managed by this worker from the alignment + */ + void removeAnnotation(); + + /** + * The main calculation happens here + * @throws Throwable + */ + public void run() throws Throwable; + + /** + * Answers true if the worker should be deleted entirely when its annotation + * is deleted from the display, or false if it should continue to run. Some + * workers are required to run for their side-effects. + * + * @return + */ + boolean isDeletable(); }