diff options
Diffstat (limited to 'src/ch/epfl/maze/graphics/Display.java')
-rw-r--r-- | src/ch/epfl/maze/graphics/Display.java | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/ch/epfl/maze/graphics/Display.java b/src/ch/epfl/maze/graphics/Display.java index 2fddcf1..baacefa 100644 --- a/src/ch/epfl/maze/graphics/Display.java +++ b/src/ch/epfl/maze/graphics/Display.java | |||
@@ -17,7 +17,6 @@ import java.util.Map; | |||
17 | /** | 17 | /** |
18 | * Handles the display of a {@code Simulation} on a window. | 18 | * Handles the display of a {@code Simulation} on a window. |
19 | */ | 19 | */ |
20 | |||
21 | public final class Display implements Runnable { | 20 | public final class Display implements Runnable { |
22 | 21 | ||
23 | /* constants */ | 22 | /* constants */ |
@@ -58,7 +57,6 @@ public final class Display implements Runnable { | |||
58 | * | 57 | * |
59 | * @param simulation A {@code Simulation} to display | 58 | * @param simulation A {@code Simulation} to display |
60 | */ | 59 | */ |
61 | |||
62 | public Display(Simulation simulation) { | 60 | public Display(Simulation simulation) { |
63 | // sanity check | 61 | // sanity check |
64 | if (simulation == null) { | 62 | if (simulation == null) { |
@@ -124,7 +122,6 @@ public final class Display implements Runnable { | |||
124 | * | 122 | * |
125 | * @param debug The new debug value | 123 | * @param debug The new debug value |
126 | */ | 124 | */ |
127 | |||
128 | public void setDebug(boolean debug) { | 125 | public void setDebug(boolean debug) { |
129 | mDebug = debug; | 126 | mDebug = debug; |
130 | mShowGrid = debug; | 127 | mShowGrid = debug; |
@@ -135,7 +132,6 @@ public final class Display implements Runnable { | |||
135 | /** | 132 | /** |
136 | * Creates frame window. | 133 | * Creates frame window. |
137 | */ | 134 | */ |
138 | |||
139 | private void createWindow() { | 135 | private void createWindow() { |
140 | // actual window | 136 | // actual window |
141 | mFrame = new JFrame("Maze solver simulation"); | 137 | mFrame = new JFrame("Maze solver simulation"); |
@@ -163,7 +159,6 @@ public final class Display implements Runnable { | |||
163 | /** | 159 | /** |
164 | * Creates canvas. | 160 | * Creates canvas. |
165 | */ | 161 | */ |
166 | |||
167 | private void createCanvas() { | 162 | private void createCanvas() { |
168 | // actual canvas | 163 | // actual canvas |
169 | mCanvas = new Canvas(); | 164 | mCanvas = new Canvas(); |
@@ -183,7 +178,6 @@ public final class Display implements Runnable { | |||
183 | /** | 178 | /** |
184 | * Creates menu. | 179 | * Creates menu. |
185 | */ | 180 | */ |
186 | |||
187 | private void createMenu() { | 181 | private void createMenu() { |
188 | // creates menu bar | 182 | // creates menu bar |
189 | mMenuBar = new JMenuBar(); | 183 | mMenuBar = new JMenuBar(); |
@@ -371,7 +365,6 @@ public final class Display implements Runnable { | |||
371 | * | 365 | * |
372 | * @param g The graphics on which the labyrinth will be drawn | 366 | * @param g The graphics on which the labyrinth will be drawn |
373 | */ | 367 | */ |
374 | |||
375 | private void drawLabyrinth(Graphics2D g) { | 368 | private void drawLabyrinth(Graphics2D g) { |
376 | World world = mSimulation.getWorld(); | 369 | World world = mSimulation.getWorld(); |
377 | 370 | ||
@@ -405,7 +398,6 @@ public final class Display implements Runnable { | |||
405 | * @param width Width of graphics | 398 | * @param width Width of graphics |
406 | * @param height Height of graphics | 399 | * @param height Height of graphics |
407 | */ | 400 | */ |
408 | |||
409 | private void drawAnimation(float dt, Graphics2D g, int width, int height) { | 401 | private void drawAnimation(float dt, Graphics2D g, int width, int height) { |
410 | // clears background | 402 | // clears background |
411 | g.setColor(BACKGROUND_COLOR); | 403 | g.setColor(BACKGROUND_COLOR); |
@@ -448,7 +440,6 @@ public final class Display implements Runnable { | |||
448 | * | 440 | * |
449 | * @param dt The elapsed time between two frames | 441 | * @param dt The elapsed time between two frames |
450 | */ | 442 | */ |
451 | |||
452 | private void animate(float dt) { | 443 | private void animate(float dt) { |
453 | Graphics2D g = null; | 444 | Graphics2D g = null; |
454 | try { | 445 | try { |
@@ -475,7 +466,6 @@ public final class Display implements Runnable { | |||
475 | /** | 466 | /** |
476 | * Runs the animation main loop. | 467 | * Runs the animation main loop. |
477 | */ | 468 | */ |
478 | |||
479 | private void mainLoop() { | 469 | private void mainLoop() { |
480 | long before = System.nanoTime(); | 470 | long before = System.nanoTime(); |
481 | while (mRunning) { | 471 | while (mRunning) { |
@@ -508,7 +498,6 @@ public final class Display implements Runnable { | |||
508 | /** | 498 | /** |
509 | * Computes the {@code Simulation}'s next move. | 499 | * Computes the {@code Simulation}'s next move. |
510 | */ | 500 | */ |
511 | |||
512 | private void nextMove() { | 501 | private void nextMove() { |
513 | synchronized (mLock) { | 502 | synchronized (mLock) { |
514 | if (mRunning) { | 503 | if (mRunning) { |
@@ -516,4 +505,5 @@ public final class Display implements Runnable { | |||
516 | } | 505 | } |
517 | } | 506 | } |
518 | } | 507 | } |
508 | |||
519 | } | 509 | } |