From: Jim Procter Date: Mon, 23 Sep 2019 08:38:33 +0000 (+0100) Subject: JAL-3070 detect presence of existing JABA RNAAliFold client X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b3eead416d4a16141910b7dae1eda4eaf2272b6a;p=jalview.git JAL-3070 detect presence of existing JABA RNAAliFold client --- diff --git a/src/jalview/ws/jws2/SequenceAnnotationWSClient.java b/src/jalview/ws/jws2/SequenceAnnotationWSClient.java index 493a73b..58478d6 100644 --- a/src/jalview/ws/jws2/SequenceAnnotationWSClient.java +++ b/src/jalview/ws/jws2/SequenceAnnotationWSClient.java @@ -83,9 +83,24 @@ public class SequenceAnnotationWSClient extends Jws2Client // columns List clnts = alignFrame.getViewport() - .getCalcManager().getRegisteredWorkersOfClass(clientClass); - AbstractJabaCalcWorker worker; - if (clnts == null || clnts.size() == 0) + .getCalcManager() + .getRegisteredWorkersOfClass(AbstractJabaCalcWorker.class); + + AbstractJabaCalcWorker worker = null; + if (clnts != null) + { + for (AlignCalcWorkerI _worker : clnts) + { + worker = (AbstractJabaCalcWorker) _worker; + if (worker.hasService() + && worker.getService().getClass().equals(clientClass)) + { + break; + } + worker = null; + } + } + if (worker == null) { if (!processParams(sh, editParams)) { @@ -108,7 +123,6 @@ public class SequenceAnnotationWSClient extends Jws2Client } else { - worker = (AbstractJabaCalcWorker) clnts.get(0); if (editParams) { paramset = worker.getArguments();