From bcb9faa6b291655299a6a442d187df7e5182446b Mon Sep 17 00:00:00 2001 From: Mikael Capelle Date: Wed, 28 Feb 2018 20:10:43 +0100 Subject: [PATCH] Fix issue in ProgressBar when number of nodes/descs/arcs was less than 100. --- src/main/org/insa/graphics/GraphReaderProgressBar.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/org/insa/graphics/GraphReaderProgressBar.java b/src/main/org/insa/graphics/GraphReaderProgressBar.java index 9899737..eaf8eef 100644 --- a/src/main/org/insa/graphics/GraphReaderProgressBar.java +++ b/src/main/org/insa/graphics/GraphReaderProgressBar.java @@ -38,7 +38,7 @@ public class GraphReaderProgressBar extends JDialog implements GraphReaderObserv private final JProgressBar[] progressBars = new JProgressBar[3]; // Current element read, and modulo. - private int[] counters = new int[] { 0, 0, 0 }; + private int[] counters = new int[]{ 0, 0, 0 }; private int[] modulos = new int[3]; public GraphReaderProgressBar(JFrame owner) { @@ -85,7 +85,7 @@ public class GraphReaderProgressBar extends JDialog implements GraphReaderObserv protected void initProgressBar(int index, int max) { progressBars[index].setMaximum(max); - modulos[index] = max / 100; + modulos[index] = Math.max(max / 100, 1); } protected void incCounter(int index) {