Refactorize code #31

Merged
regar42 merged 5 commits from refactorize into master 2018-01-14 17:02:44 +00:00
Showing only changes of commit a664c399ff - Show all commits
+2 -1
View File
@@ -178,6 +178,7 @@ public final class MazeDrawing extends JPanel implements MouseListener {
JOptionPane.showMessageDialog(this, JOptionPane.showMessageDialog(this,
"Click on the maze to see the shortest path evolve"); "Click on the maze to see the shortest path evolve");
pathCounter = 0; pathCounter = 0;
repaint();
} }
for (VertexInterface vertex : shortestPath) { for (VertexInterface vertex : shortestPath) {
@@ -204,7 +205,7 @@ public final class MazeDrawing extends JPanel implements MouseListener {
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
int boxRow = getBoxRow(e.getX()); int boxRow = getBoxRow(e.getX());
int boxLine = getBoxLine(e.getY()); int boxLine = getBoxLine(e.getY());
if (mazeApp.isPathDrawn() == 0) { if (mazeApp.isPathDrawn() != 1) {
// Don't do anything if there is no box where the mouse is // Don't do anything if there is no box where the mouse is
if (boxRow >= mazeApp.getModelDimensionX() if (boxRow >= mazeApp.getModelDimensionX()
|| boxLine >= mazeApp.getModelDimensionY()) { || boxLine >= mazeApp.getModelDimensionY()) {