jdraw
Class GraphicObjectManager

java.lang.Object
  |
  +--jdraw.GraphicObjectManager

public class GraphicObjectManager
extends Object

A repository for graphic objects.


Field Summary
private  ArrayList graphic_objects
          The collection containing the graphic objects.
private  int SQUARED_DISTANCE_THRESHOLD
          The squared distance thresold, used to find the closest object.
 
Constructor Summary
GraphicObjectManager()
          Creates a new empty GraphicObjectManager object.
GraphicObjectManager(GraphicObject[] graphic_objects)
          Creates a new GraphicObjectManager object, with the specified GraphicObjects.
 
Method Summary
 void add(GraphicObject graphic_object)
          Adds the specified graphic object to the list of managed objects.
 GraphicObject getClosestObject(Point point)
          Returns the closest object to the specified point, with respect to distance thresold.
 int getDistanceThresold()
          Returns the distance thresold used to find closest objects.
 Iterator iterator()
          Returns an iterator over the graphic objects managed.
 boolean remove(GraphicObject graphic_object)
          Removes the specified graphic object to the list of managed objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SQUARED_DISTANCE_THRESHOLD

private final int SQUARED_DISTANCE_THRESHOLD
The squared distance thresold, used to find the closest object.

See Also:
Constant Field Values

graphic_objects

private final ArrayList graphic_objects
The collection containing the graphic objects.

Constructor Detail

GraphicObjectManager

public GraphicObjectManager()
Creates a new empty GraphicObjectManager object.


GraphicObjectManager

public GraphicObjectManager(GraphicObject[] graphic_objects)
Creates a new GraphicObjectManager object, with the specified GraphicObjects.

Method Detail

add

public void add(GraphicObject graphic_object)
Adds the specified graphic object to the list of managed objects.


getClosestObject

public GraphicObject getClosestObject(Point point)
Returns the closest object to the specified point, with respect to distance thresold.


getDistanceThresold

public int getDistanceThresold()
Returns the distance thresold used to find closest objects.


iterator

public Iterator iterator()
Returns an iterator over the graphic objects managed.


remove

public boolean remove(GraphicObject graphic_object)
Removes the specified graphic object to the list of managed objects.

Returns:
true if the specified object where present and removed.