/* @(#)ConcentrationApplet.java  12 November 2006 */

/* Useful imports */

import edu.neu.ccs.*;
import edu.neu.ccs.gui.*;
import edu.neu.ccs.codec.*;
import edu.neu.ccs.console.*;
import edu.neu.ccs.filter.*;
import edu.neu.ccs.jpf.*;
import edu.neu.ccs.parser.*;
import edu.neu.ccs.pedagogy.*;
import edu.neu.ccs.quick.*;
import edu.neu.ccs.util.*;

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.awt.font.*;
import java.awt.image.*;
import javax.swing.*;
import javax.swing.border.*;
import java.io.*;
import java.util.*;
import java.math.*;
import java.beans.*;
import java.lang.reflect.*;
import java.net.URL;
import java.util.regex.*;
import java.text.ParseException;

public class ConcentrationApplet extends JApplet
{
    
    public void init() {
        //Execute a job on the event-dispatching thread:
        //creating this applet's GUI.
        try {
            javax.swing.SwingUtilities.invokeAndWait(
                new Runnable() {
	                public void run() {
	                    setImagesURL();
	                    createGUI();
	                }
                });
        } catch (Exception e) {
        }
    }
    
    
    /*
     * The method to create the applet GUI with one button
     * that in turn launches the new game panel.
     */
    private void createGUI() {
        Container pane = getContentPane();
        pane.setLayout(new CenterLayout());
        pane.add(new ConcentrationSettings());
    }
    
    
    /*
     * The method to set the URL for the game images from the
     * APPLET PARAM tag with name "imagesURL".
     */
    private void setImagesURL() {
        String url = getParameter("imagesURL");
        
        if ((url != null) && (url.length() > 0))
            GameImages.setImagesURL(url);
    }
}
