net.nexttext
Class RandomLocation

java.lang.Object
  extended by net.nexttext.RandomLocation
All Implemented Interfaces:
Locatable

public class RandomLocation
extends java.lang.Object
implements Locatable

A locatable which responds with a random location.

The location returned will be inside the given shape. The bounds of the shape are checked on each call, so mutable shapes will be properly supported.

Because of the way getLocation() is implemented, very thin shapes with large bounding boxes may cause it to lock up in a loop trying to find a point inside.


Constructor Summary
RandomLocation(java.awt.Shape shape)
           
 
Method Summary
 processing.core.PVector getLocation()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomLocation

public RandomLocation(java.awt.Shape shape)
Method Detail

getLocation

public processing.core.PVector getLocation()
Specified by:
getLocation in interface Locatable
Returns:
The object's location in absolute coordinates.