Change the way of drawing the maze #22

Manually merged
antograb merged 2 commits from changeMazeDrawing into mvc 2017-12-21 08:03:55 +00:00
2 changed files with 4 additions and 5 deletions
Showing only changes of commit 16df6a26c6 - Show all commits

No files matched your search

+3 -3
View File
@@ -32,13 +32,13 @@ public class LoadMazeMenuItem extends JMenuItem
new FileNameExtensionFilter("Text files", "txt"); new FileNameExtensionFilter("Text files", "txt");
fileChooser.setFileFilter(filter); fileChooser.setFileFilter(filter);
String filename;
int returnVal = fileChooser.showOpenDialog(mazeApp); int returnVal = fileChooser.showOpenDialog(mazeApp);
if(returnVal == JFileChooser.APPROVE_OPTION) { if(returnVal == JFileChooser.APPROVE_OPTION) {
System.out.println("You chose to open this file: " + System.out.println("You chose to open this file: " +
fileChooser.getSelectedFile().getName()); fileChooser.getSelectedFile().getName());
} filename = fileChooser.getSelectedFile().getPath();
String filename = fileChooser.getSelectedFile().getPath();
mazeApp.getMazeAppModel().setMaze(new Maze(filename)); mazeApp.getMazeAppModel().setMaze(new Maze(filename));
} }
}
} }
+1 -2
View File
@@ -34,9 +34,8 @@ public class SaveMazeMenuItem extends JMenuItem
if(returnVal == JFileChooser.APPROVE_OPTION) { if(returnVal == JFileChooser.APPROVE_OPTION) {
System.out.println("You chose to save to this file: " + System.out.println("You chose to save to this file: " +
fileChooser.getSelectedFile().getName()); fileChooser.getSelectedFile().getName());
}
String filename = fileChooser.getSelectedFile().getPath(); String filename = fileChooser.getSelectedFile().getPath();
mazeApp.getMazeAppModel().saveToFile(filename); mazeApp.getMazeAppModel().saveToFile(filename);
} }
}
} }