/* @(#)ConcentrationApplet.java    26 September 2007 */

import edu.neu.ccs.gui.*;

/**
 * <p>The class for the Concentration game applet.</p>
 * 
 * <p>Uses Java Power Tools 2.6.0.</p>
 * 
 * <p>Copyright, Richard Rasala, 2007.</p>
 * 
 * @author Richard Rasala
 */
public class ConcentrationApplet
    extends DirectApplet
{
    /** The game image data object to capture applet parameters. */
    protected GameImageData imageData = new GameImageData();
    
    
    /**
     * <p>The create GUI method returns a
     * <code>ConcentrationOptions</code> object.</p>
     * 
     * <p>This applet sets the internal parameter
     * <code>openedFromApplet</code> so that the
     * <code>ConcentrationOptions</code> object
     * will handle the window closing actions for
     * a <code>ConcentrationGame</code> properly.</p>
     */
    public Object createGUI() {
        setImagesURL();
        setImageListFileName();
        
        ConcentrationOptions options = new ConcentrationOptions(imageData);
        
        options.openedFromApplet = true;
        
        return options;
    }
    
    
    /*
     * The method to set the images URL
     * for the game image data
     * from the APPLET PARAM tag with name "imagesURL".
     */
    private void setImagesURL() {
        imageData.setImagesURL(getParameter("imagesURL"));
    }
    
    
    /*
     * The method to set the image list file name
     * for the game image data
     * from the APPLET PARAM tag with name "imageList".
     */
    private void setImageListFileName() {
        imageData.setImageListFileName(getParameter("imageList"));
    }
    
}
