package yourwork;

import java.awt.*;
import javax.swing.*;
import ignorethis.ButtonPanel;
import ignorethis.Canvas;
import ignorethis.SmileyFactory;
import ignorethis.CirclesFactory;
import ignorethis.StudentFactory;
import ignorethis.TargetFactory;
import ignorethis.Target2Factory;


/**
 * Creates a window that can be moved, resized, inconified, 
 * and closed by the user.
 *
 * @author Robert C. Duvall
 */
public class Main
{
    // constants
    public static final Dimension SIZE = new Dimension(800, 600);
    public static final String TITLE = "Recursive Art!";


    // main --- where the program starts
    public static void main (String args[])
    {
        // create container to display animations
        Canvas display = new Canvas(SIZE);
        display.setPreferredSize(SIZE);

        // create user interface controls
        ButtonPanel commands = new ButtonPanel(display);
        // add commands to test here
        commands.add(new TargetFactory());
        commands.add(new Target2Factory());
        commands.add(new SmileyFactory());
        commands.add(new CirclesFactory());
        commands.add(new StudentFactory());

        // create container that will work with Window manager
        JFrame frame = new JFrame(TITLE);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        // add our user interface components to Frame and show it
        frame.getContentPane().add(commands, BorderLayout.NORTH);
        frame.getContentPane().add(display, BorderLayout.CENTER);
        frame.pack();
        frame.setVisible(true);
    }
}
