From b3eead416d4a16141910b7dae1eda4eaf2272b6a Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 23 Sep 2019 09:38:33 +0100 Subject: [PATCH] JAL-3070 detect presence of existing JABA RNAAliFold client --- .../ws/jws2/SequenceAnnotationWSClient.java | 22 ++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) 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(); -- 1.7.10.2