From 1a09df2fbacbdaf9a76ee5fe3b25925742bc78d9 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 5 Aug 2024 18:41:40 +0100 Subject: [PATCH] JAL-4446 .. missing methods for cancellable pasimap --- src/jalview/analysis/PaSiMap.java | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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 -- 1.7.10.2