X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fapi%2FAlignCalcManagerI.java;h=18605b88bd27f5dadd5c6f871c9f2adaac2878df;hb=37de9310bec3501cbc6381e0c3dcb282fcaad812;hp=2641c962015c70f6d23e8ac894408e66651aaa08;hpb=b2f9a8d7bce642ff4011bc6d49e02bb0569fbb11;p=jalview.git diff --git a/src/jalview/api/AlignCalcManagerI.java b/src/jalview/api/AlignCalcManagerI.java index 2641c96..18605b8 100644 --- a/src/jalview/api/AlignCalcManagerI.java +++ b/src/jalview/api/AlignCalcManagerI.java @@ -1,19 +1,21 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1) - * Copyright (C) 2014 The Jalview Authors + * 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. + * 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 . + * 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; @@ -33,17 +35,12 @@ public interface AlignCalcManagerI void notifyStart(AlignCalcWorkerI worker); /** - * check if a calculation of this type is already active - * - * @param worker - * @return - */ - boolean alreadyDoing(AlignCalcWorkerI worker); - - /** - * tell manager that worker is now processing data + * tell manager that a thread running worker's run() loop is ready to start + * processing data * * @param worker + * @return true if worker should start processing, false if another thread is + * in progress */ boolean notifyWorking(AlignCalcWorkerI worker); @@ -61,7 +58,7 @@ public interface AlignCalcManagerI * * @param worker */ - void workerCannotRun(AlignCalcWorkerI worker); + void disableWorker(AlignCalcWorkerI worker); /** * indicate that a worker like this may be run on the platform. @@ -69,7 +66,15 @@ public interface AlignCalcManagerI * @param worker * of class to be removed from the execution blacklist */ - void workerMayRun(AlignCalcWorkerI worker); + void enableWorker(AlignCalcWorkerI worker); + + /** + * Answers true if the worker is disabled from running + * + * @param worker + * @return + */ + boolean isDisabled(AlignCalcWorkerI worker); /** * launch a new worker @@ -81,7 +86,7 @@ public interface AlignCalcManagerI /** * * @param worker - * @return + * @return true if the worker is currently running */ boolean isWorking(AlignCalcWorkerI worker); @@ -118,7 +123,7 @@ public interface AlignCalcManagerI * * @param workerClass */ - void updateAnnotationFor(Class workerClass); + void updateAnnotationFor(Class workerClass); /** * return any registered workers of the given class @@ -126,17 +131,8 @@ public interface AlignCalcManagerI * @param workerClass * @return null or one or more workers of the given class */ - List getRegisteredWorkersOfClass(Class workerClass); - - /** - * start any workers of the given class - * - * @param workerClass - * @return false if no workers of given class were registered (note - - * blacklisted classes cannot be restarted, so this method will return - * true for blacklisted workers) - */ - boolean startRegisteredWorkersOfClass(Class workerClass); + List getRegisteredWorkersOfClass( + Class workerClass); /** * work out if there is an instance of a worker that is *waiting* to start @@ -154,6 +150,15 @@ public interface AlignCalcManagerI * * @param typeToRemove */ - void removeRegisteredWorkersOfClass(Class typeToRemove); + void removeRegisteredWorkersOfClass( + Class typeToRemove); + /** + * Removes the worker that produces the given annotation, provided it is + * marked as 'deletable'. Some workers may need to continue to run as the + * results of their calculations are needed, e.g. for colour schemes. + * + * @param ann + */ + void removeWorkerForAnnotation(AlignmentAnnotation ann); }