/**
 * MyArtWork
 * Inspired by a lab from Jeff Ondich
 * @author Dave Musicant
 * @author David Liben-Nowell (primitive-free, static-free version)
 * @version 4.0 April 2006
 *
 * This class opens a canvas window, fills it with a black
 * background, and draws a purple square in the center.
 */

import java.awt.*;

public class MyArtWork
{
    public static void main(String[] args)
    {
        // Set up the canvas.

        Integer windowWidth = 500;
        Integer windowHeight = 500;
        Integer rectangleWidth = 50;
        Integer rectangleHeight = 50;

        Canvas canvas = new Canvas("Not quite Picasso");
        canvas.setSize(windowWidth, windowHeight);
        canvas.setVisible(true);


        // The Color class lets you create new colors.  (It also has
        // some built-in colors, but they're built in using some Java
        // ideas that we aren't going to worry about for a little
        // while.  So for now we'll just build our own colors up from
        // scratch.)  If you want to mix your own colors, create a new
        // Color object. The constuctor takes three parameters which
        // are ints between 0 and 255, representing the amount of red,
        // green, and blue ("RGB") in the color. So (0,0,0) means no
        // color (black), (255,0,255) means a shade of purple, and
        // (127,0.127) is darker purple, etc.  RGB values for some
        // other colors are available at the following web page:
        // <http://www.dtp-aus.com/bigcolor.html>.


        // Set the background color of the Canvas.
        Color black = new Color(0, 0, 0);
        canvas.fillBackground(black);


        // Set the color of the pen.  The "pen color" refers to the color
        // that will be used for all future drawing operations, until the
        // pen color is changed again.

        Color darkPurple = new Color(127, 0, 127);
        canvas.setInkColor( darkPurple );


        // Draw a square.  More specifically, draw a rectamgle whose top
        // left corner has coordinates (measured in pixels)
        // x = windowWidth/2 and y = windowHeight/2, and whose width
        // and height are specified by the variables rectangleWidth and
        // rectangleHeight.

        canvas.drawRectangle(windowWidth/2, windowHeight/2,
                              rectangleWidth, rectangleHeight);
    }
}
