package com.nullprogram.maze;

import java.awt.Dimension;

import javax.swing.JApplet;

public class MazeApplet extends JApplet implements SolveListener {

    private static final long serialVersionUID = 7742407602430714892L;

    private int cellSize = 15;
    private int speed    = 10;
    private Maze maze;
    private MazeDisplay display;
    private MazeSolve solution;

    public void init() {
        String paramSize = getParameter("cellsize");
        if (paramSize != null) {
            cellSize = Integer.parseInt(paramSize);
        }
        Dimension size = getSize();
        maze = new Maze((int) (size.getWidth() / cellSize),
                        (int) (size.getHeight() / cellSize));
        if (display == null) {
            display = new MazeDisplay(maze, cellSize);
            add(display);
        } else {
            display.setMaze(maze);
        }
        solution = new MazeSolve(maze, display, speed);
        solution.addListener(this);
    }

    public void start() {
        solution.start();
    }

    public void stop() {
        solution.stop();
    }

    public void destroy() {
        stop();
    }

    public void solveDone() {
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            return;
        }
        init();
    }
}

@@ -81,16 +81,65 @@
 pplet;%0A%0A
+/**%0A * Runs the maze animation as an applet.%0A */%0A
 public c
@@ -270,16 +270,173 @@
 4892L;%0A%0A
+    /* Defaults */%0A    private static final int CELL_SIZE = 15;%0A    private static final int SPEED = 10;%0A    private static final int RESTART_DELAY = 3000;%0A%0A
     priv
@@ -454,18 +454,25 @@
 lSize = 
-15
+CELL_SIZE
 ;%0A    pr
@@ -491,15 +491,15 @@
 eed 
-   = 10
+= SPEED
 ;%0A  
@@ -585,30 +585,50 @@
 ution;%0A%0A    
-public
+@Override%0A    public final
  void init()
@@ -1205,38 +1205,58 @@
 is);%0A    %7D%0A%0A    
-public
+@Override%0A    public final
  void start() %7B%0A
@@ -1288,30 +1288,50 @@
 %0A    %7D%0A%0A    
-public
+@Override%0A    public final
  void stop()
@@ -1365,30 +1365,50 @@
 %0A    %7D%0A%0A    
-public
+@Override%0A    public final
  void destro
@@ -1440,22 +1440,42 @@
  %7D%0A%0A    
-public
+@Override%0A    public final
  void so
@@ -1525,20 +1525,29 @@
 d.sleep(
-3000
+RESTART_DELAY
 );%0A     

Make Checkstyle happy with MazeApplet.java.