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


// Applet to build fractal "star" picture
public class StainedGlassWindow extends WindowController
{
        public static final int LIMIT = 120;                            // Size at which creating new pieces
          public static final double SIZE = 400.0;                        // Size of first circle
          
          //  Starting coordinates of top left corner
        public static final double CENTER_X = 200.0;                
        public static final double CENTER_Y = 200.0;                

        // generators for color and opacity
        private RandomIntGenerator genColor = new RandomIntGenerator(0,255);
        private RandomIntGenerator genOpacity = new RandomIntGenerator(10,40);
        
          // Initializes the applet by creating the triangle with three "PushLine"s.
          public void onMouseClick(Location pt){
              canvas.clear();
              
              // the 4-parameter construct for color takes an
              // opacity between 0-255 to indicate how transparent
              // a color is.
                  Color c = new Color(genColor.nextValue(), genColor.nextValue(), 
                                      genColor.nextValue(), genOpacity.nextValue());

                  new CompoundPiece(new Location(CENTER_X,CENTER_Y),
                                    SIZE,LIMIT,c, canvas);
          }

}



