import java.awt.*;

public class SimApplet extends java.applet.Applet {
  Configuration configuration;
  DiagramPanel diagram;
  Simulation simulation;

  public void init() {
    int xsize,ysize;
    float kappa;
    // Set parameters
    xsize=16;
    ysize=16;
    kappa=(float)5.0;
    // Set initial configuration
    configuration=new Configuration(xsize,ysize);
    // Initialise display

    // layout style
    setLayout(new BorderLayout(10,10));
    // the two panels
    //controls = new ControlPanel();
    //add("East",controls);
    diagram = new DiagramPanel();
    diagram.init(configuration);
    add("Center",diagram);   
    simulation = new Simulation(configuration, diagram, kappa);
  }

  public void start() {
    //
    // Equilibrate if requested
    // Run and update display
    simulation.start();
  }

  public void stop() {
    /* Stop threads here, this gets called when the applet is closed
       down or suspended by being moved off screen */
    simulation.stop();
  }

} /* end if SimApplet */

