
import objectdraw.*;
import java.awt.*;

/**
 * Create a row T-Shirts, just like an American Apparel store
 */
public class TShirtStore extends WindowController {
    

    public final static double SPACE = 10;
    public final static double TOP = 50;
    public final static double TSHIRT_WIDTH=120;

    private RandomIntGenerator color = new RandomIntGenerator(0,255);
    
    public void begin() {
        resize(800,200);
        double left = SPACE;
        while (left + TSHIRT_WIDTH < canvas.getWidth()) {
            TShirt t = new TShirt(left, TOP, canvas);
            t.setColor(this.randomColor());
            left = left + TSHIRT_WIDTH + SPACE;
        }
    }
    
    public Color randomColor() {
        return (new Color(color.nextValue(), color.nextValue(), color.nextValue()));
    }
}
