JAL-4446 allow progress bar to become indeterminate after pairwise alignment step
authorJim Procter <jprocter@dundee.ac.uk>
Mon, 19 Aug 2024 16:03:29 +0000 (17:03 +0100)
committerJim Procter <jprocter@dundee.ac.uk>
Mon, 19 Aug 2024 16:03:29 +0000 (17:03 +0100)
src/jalview/gui/PaSiMapPanel.java
src/jalview/gui/PairwiseAlignPanel.java

index bb7bf11..8f45410 100644 (file)
@@ -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);
   }
 
index bffaec5..36c1f01 100755 (executable)
@@ -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;