From 944fb0771776aeb297264fca9e10a3624695831f Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 25 Oct 2017 15:14:17 +0100 Subject: [PATCH] JAL-2790 provide a cancel button for JABAWS and AACon jobs --- src/jalview/ws/jws2/AbstractJabaCalcWorker.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/jalview/ws/jws2/AbstractJabaCalcWorker.java b/src/jalview/ws/jws2/AbstractJabaCalcWorker.java index 26fe0a2..5961fc3 100644 --- a/src/jalview/ws/jws2/AbstractJabaCalcWorker.java +++ b/src/jalview/ws/jws2/AbstractJabaCalcWorker.java @@ -30,6 +30,7 @@ import jalview.datamodel.AnnotatedCollectionI; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; import jalview.gui.IProgressIndicator; +import jalview.gui.IProgressIndicatorHandler; import jalview.schemes.ResidueProperties; import jalview.workers.AlignCalcWorker; import jalview.ws.jws2.dm.AAConSettings; @@ -220,7 +221,26 @@ public abstract class AbstractJabaCalcWorker extends AlignCalcWorker progressId = System.currentTimeMillis()); } rslt = submitToService(seqs); + if (guiProgress != null) + { + guiProgress.registerHandler(progressId, + new IProgressIndicatorHandler() + { + @Override + public boolean cancelActivity(long id) + { + cancelCurrentJob(); + return true; + } + + @Override + public boolean canCancel() + { + return true; + } + }); + } boolean finished = false; long rpos = 0; do -- 1.7.10.2