Fix issue with graph progress bar.

This commit is contained in:
Mikael Capelle 2018-03-28 17:39:00 +02:00
parent 51e166600d
commit 4e541e67cf
2 changed files with 9 additions and 8 deletions

View File

@ -75,6 +75,7 @@ public class GraphReaderProgressBar extends JDialog implements GraphReaderObserv
@Override
public void notifyEndReading() {
setVisible(false);
dispose();
}
protected void initProgressBar(int index, int max) {

View File

@ -254,9 +254,8 @@ public class MainWindow extends JFrame {
}
});
cpPanel = new AlgorithmPanel(
this, CarPoolingAlgorithm.class, "Car-Pooling", new String[] { "Origin Car",
"Origin Pedestrian", "Destination Car", "Destination Pedestrian" },
cpPanel = new AlgorithmPanel(this, CarPoolingAlgorithm.class, "Car-Pooling", new String[]{
"Origin Car", "Origin Pedestrian", "Destination Car", "Destination Pedestrian" },
true);
psPanel = new AlgorithmPanel(this, PackageSwitchAlgorithm.class, "Car-Pooling",
@ -580,10 +579,10 @@ public class MainWindow extends JFrame {
reader.addObserver(progressBar);
try {
graph = reader.read();
System.out.flush();
}
catch (Exception exception) {
progressBar.setVisible(false);
progressBar.dispose();
progressBar = null;
JOptionPane.showMessageDialog(MainWindow.this,
"Unable to read graph from the selected file.");
@ -593,6 +592,7 @@ public class MainWindow extends JFrame {
// In case of....
progressBar.setVisible(false);
progressBar.dispose();
progressBar = null;
String info = graph.getMapId();