Fix issue with nodes input panel getting enabled by indavertance.

This commit is contained in:
Holt59 2018-03-03 15:45:21 +01:00
parent 7827bfc63c
commit 8e68377772
3 changed files with 4 additions and 2 deletions

View File

@ -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) {

View File

@ -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();
}
}

View File

@ -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);