From 8e6837777290a1eff3550d6034eaea9638548f5f Mon Sep 17 00:00:00 2001 From: Holt59 Date: Sat, 3 Mar 2018 15:45:21 +0100 Subject: [PATCH] Fix issue with nodes input panel getting enabled by indavertance. --- src/main/org/insa/graphics/MainWindow.java | 1 - src/main/org/insa/graphics/NodesInputPanel.java | 4 +++- src/main/org/insa/graphics/ShortestPathPanel.java | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/org/insa/graphics/MainWindow.java b/src/main/org/insa/graphics/MainWindow.java index 0f06cbd..3892970 100644 --- a/src/main/org/insa/graphics/MainWindow.java +++ b/src/main/org/insa/graphics/MainWindow.java @@ -285,7 +285,6 @@ public class MainWindow extends JFrame { threadTimer.stop(); threadPanel.setVisible(false); currentThread.setThread(null); - spPanel.setEnabled(true); } private void displayShortestPathSolution(ShortestPathSolution solution) { diff --git a/src/main/org/insa/graphics/NodesInputPanel.java b/src/main/org/insa/graphics/NodesInputPanel.java index c9da8a5..9dc0010 100644 --- a/src/main/org/insa/graphics/NodesInputPanel.java +++ b/src/main/org/insa/graphics/NodesInputPanel.java @@ -392,7 +392,9 @@ public class NodesInputPanel extends JPanel for (JTextField input: nodeInputs) { MarkerOverlay tracker = markerTrackers.getOrDefault(input, null); if (tracker != null) { - markerTrackers.put(input, this.drawing.drawMarker(tracker.getPoint(), tracker.getColor())); + MarkerOverlay newMarker = this.drawing.drawMarker(tracker.getPoint(), tracker.getColor()); + markerTrackers.put(input, newMarker); + newMarker.setVisible(tracker.isVisible()); tracker.delete(); } } diff --git a/src/main/org/insa/graphics/ShortestPathPanel.java b/src/main/org/insa/graphics/ShortestPathPanel.java index 27f273d..7b195a6 100644 --- a/src/main/org/insa/graphics/ShortestPathPanel.java +++ b/src/main/org/insa/graphics/ShortestPathPanel.java @@ -170,6 +170,7 @@ public class ShortestPathPanel extends JPanel { this.nodesInputPanel.setAlignmentX(Component.LEFT_ALIGNMENT); nodesInputPanel.addTextField("Origin: ", new Color(57, 172, 115)); nodesInputPanel.addTextField("Destination: ", new Color(255, 77, 77)); + nodesInputPanel.setEnabled(false); add(this.nodesInputPanel); components.add(this.nodesInputPanel);