From: Jim Procter Date: Mon, 5 Aug 2024 17:41:40 +0000 (+0100) Subject: JAL-4446 .. missing methods for cancellable pasimap X-Git-Tag: Release_2_11_4_0~14^2~6^2~12 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1a09df2fbacbdaf9a76ee5fe3b25925742bc78d9;p=jalview.git JAL-4446 .. missing methods for cancellable pasimap --- diff --git a/src/jalview/analysis/PaSiMap.java b/src/jalview/analysis/PaSiMap.java index 5be8c7b..b2a17ac 100755 --- a/src/jalview/analysis/PaSiMap.java +++ b/src/jalview/analysis/PaSiMap.java @@ -60,6 +60,8 @@ public class PaSiMap implements Runnable * outputs */ final private PairwiseAlignPanel alignment; + + private boolean cancelled=false; private MatrixI pairwiseScores; @@ -230,6 +232,11 @@ public class PaSiMap implements Runnable { // alignment = new PairwiseAlignPanel(seqs, true, 100, 5); alignment.calculate(scoreMatrix); + if (alignment.isCancelled()) + { + cancel(); + return; + } float[][] scores = alignment.getAlignmentScores(); // bigger index first // -- eg scores[14][13] SequenceI[] iseqs = alignment.getInputSequences(); @@ -249,6 +256,22 @@ public class PaSiMap implements Runnable q.printStackTrace(); } } + + + + public void cancel() + { + if (alignment!=null) + { + alignment.cancel(); + } + cancelled=true; + } + + public boolean isCancelled() + { + return cancelled; + } /** * Returns a PrintStream that wraps (appends its output to) the given