utility
Class LT02Utility

java.lang.Object
  extended by utility.LT02Utility

public class LT02Utility
extends java.lang.Object

Author:
mb

Constructor Summary
LT02Utility()
           
 
Method Summary
static java.util.Collection<java.awt.Shape> getShapeCollection(int canvasWidth, int canvasHeight)
          This method returns a collection of Shape objects.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LT02Utility

public LT02Utility()
Method Detail

getShapeCollection

public static java.util.Collection<java.awt.Shape> getShapeCollection(int canvasWidth,
                                                                      int canvasHeight)
This method returns a collection of Shape objects. The (x,y) anchor points of the shapes are randomly assigned within an imaginary canvas with the dimension as passed to this method. The size of the Shape objects are proportional to the canvas dimensions: the widths and heights are set at one-quarter of the canvas width and height. The position of Shapes are such that the entire Shape can be drawn on the specified canvas. The number of elements in the collection is randomly chosen, but will be within the range [5,15] (5 or more and 15 or fewer).

Parameters:
canvasWidth - the width of a canvas, as specified in the user space
canvasHeight - the height of a canvas, as specified in the user space
Returns:
a collection of Shape objects as described above