From a4e7a6f708e9b5adb3621a0b0cde12752e266bd3 Mon Sep 17 00:00:00 2001 From: Holt59 Date: Wed, 28 Feb 2018 21:06:08 +0100 Subject: [PATCH] Fix issue with NodesInputPanel getting enable when clearing threads. --- src/main/org/insa/graphics/MainWindow.java | 7 +++---- src/main/org/insa/graphics/NodesInputPanel.java | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/org/insa/graphics/MainWindow.java b/src/main/org/insa/graphics/MainWindow.java index ede35cc..df8e4d0 100644 --- a/src/main/org/insa/graphics/MainWindow.java +++ b/src/main/org/insa/graphics/MainWindow.java @@ -123,7 +123,6 @@ public class MainWindow extends JFrame { // Log stream and print stream private StreamCapturer logStream; - @SuppressWarnings("unused") private PrintStream printStream; // Current running thread @@ -142,6 +141,8 @@ public class MainWindow extends JFrame { setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); setLayout(new BorderLayout()); + setMinimumSize(new Dimension(800, 600)); + // Create drawing and action listeners... this.basicDrawing = new BasicDrawing(); this.mapViewDrawing = new MapViewDrawing(); @@ -272,9 +273,6 @@ public class MainWindow extends JFrame { threadTimer.stop(); threadPanel.setVisible(false); currentThread.setThread(null); - if (spPanel != null) { - spPanel.setEnabled(true); - } } private void displayShortestPathSolution(ShortestPathSolution solution) { @@ -376,6 +374,7 @@ public class MainWindow extends JFrame { public void run() { ShortestPathSolution solution = spAlgorithm.run(); displayShortestPathSolution(solution); + spPanel.setEnabled(true); } }); } diff --git a/src/main/org/insa/graphics/NodesInputPanel.java b/src/main/org/insa/graphics/NodesInputPanel.java index 7326798..83844ea 100644 --- a/src/main/org/insa/graphics/NodesInputPanel.java +++ b/src/main/org/insa/graphics/NodesInputPanel.java @@ -337,7 +337,6 @@ public class NodesInputPanel extends JPanel public void onDrawingLoaded(Drawing oldDrawing, Drawing newDrawing) { if (newDrawing != drawing) { this.drawing = newDrawing; - } }