/* Copyright 2001 Michael R. Wick */ package Factories; import Shapes.*; import java.util.*; import java.awt.Point; import java.awt.Color; public class CircleFactory extends ShapeFactory { public CircleFactory(int w) { super(w); } public Shape createShape() { Shape result; int size1 = MIN_SHAPE_SIZE + (int)(Math.random() * (MAX_SHAPE_SIZE - MIN_SHAPE_SIZE) ); int size2 = MIN_SHAPE_SIZE + (int)(Math.random() * (MAX_SHAPE_SIZE - MIN_SHAPE_SIZE) ); int temp1 = (int)(Math.random() * WIDTH / 2); int temp2 = (int)(Math.random() * WIDTH / 2); Point point = new Point(temp1,temp2); Color color = new Color((int)(Math.random() * 255), (int)(Math.random() * 255), (int)(Math.random() * 255) ); result = new Circle(point,size1,color); return (result); } }