/**
 * This class represents a simple picture. You can draw the picture using
 * the draw method. But wait, there's more: being an electronic picture, it
 * can be changed. You can set it to black-and-white display and back to
 * colors (only after it's been drawn, of course).
 *
 * This class was written as an early example for teaching Java with BlueJ.
 * 
 * @author  Michael Kolling and David J. Barnes (modified by Dave Reed)
 * @version 2011.07.31
 */
public class Picture {
    private Square wall;
    private Square window;
    private Triangle roof;
    private Circle sun;

    /**
     * Constructor the shapes for the Picture.
     */
    public Picture() {
        this.wall = new Square();
        this.window = new Square();
        this.roof = new Triangle();
        this.sun = new Circle();
    }

    /**
     * Draw this picture.
     */
    public void draw() {
        wall.moveHorizontal(-140);
        wall.moveVertical(20);
        wall.changeSize(120);
        wall.makeVisible();
        
        window.changeColor("black");
        window.moveHorizontal(-120);
        window.moveVertical(40);
        window.changeSize(40);
        window.makeVisible();
 
        roof.changeSize(60, 180);
        roof.moveHorizontal(20);
        roof.moveVertical(-60);
        roof.makeVisible();

        sun.changeColor("yellow");
        sun.moveHorizontal(100);
        sun.moveVertical(-40);
        sun.changeSize(80);
        sun.makeVisible();
    }

    /**
     * Change this picture to black/white display
     */
    public void setBlackAndWhite() {
        this.wall.changeColor("black");
        this.window.changeColor("white");
        this.roof.changeColor("black");
        this.sun.changeColor("black");
    }

    /**
     * Change this picture to use color display
     */
    public void setColor() {
        this.wall.changeColor("red");
        this.window.changeColor("black");
        this.roof.changeColor("green");
        this.sun.changeColor("yellow");
    }
}
