From 23eabe997df728d46b1333cbfd01407acba70908 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 19 Aug 2024 17:03:29 +0100 Subject: [PATCH] JAL-4446 allow progress bar to become indeterminate after pairwise alignment step --- src/jalview/gui/PaSiMapPanel.java | 8 ++++++++ src/jalview/gui/PairwiseAlignPanel.java | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/jalview/gui/PaSiMapPanel.java b/src/jalview/gui/PaSiMapPanel.java index bb7bf11..8f45410 100644 --- a/src/jalview/gui/PaSiMapPanel.java +++ b/src/jalview/gui/PaSiMapPanel.java @@ -670,6 +670,7 @@ public class PaSiMapPanel extends GPaSiMapPanel /* * make the progressBar determinate and update its progress + * or indeterminate if progress<-1 or lengthOfTask < 0 */ public void updateProgressBar(int lengthOfTask, int progress) { @@ -684,6 +685,13 @@ public class PaSiMapPanel extends GPaSiMapPanel pBar.setValue(0); pBar.setIndeterminate(false); } + + if (progress<-1 || lengthOfTask<=0) + { + pBar.setIndeterminate(true); + pBar.repaint(); + return; + } updateProgressBar(progress); } diff --git a/src/jalview/gui/PairwiseAlignPanel.java b/src/jalview/gui/PairwiseAlignPanel.java index bffaec5..36c1f01 100755 --- a/src/jalview/gui/PairwiseAlignPanel.java +++ b/src/jalview/gui/PairwiseAlignPanel.java @@ -281,6 +281,9 @@ public class PairwiseAlignPanel extends GPairwiseAlignPanel } } alignmentScores[count - 1][count - 1] = Float.NaN; + // done - mark progress as indeterminate again + firePropertyChange(TOTAL, -1, -2); + this.scores = scores; this.alignmentScores = alignmentScores; -- 1.7.10.2