com.rolemodelsoft.drawlet.basics
Class AbstractLocator

java.lang.Object
  |
  +--com.rolemodelsoft.drawlet.basics.AbstractLocator
Direct Known Subclasses:
DrawingPoint, EdgeLocator, FigureRelativePoint, PolarCoordinate, RelativePoint

public abstract class AbstractLocator
extends java.lang.Object
implements Locator

Provides a default implementation of Locator.

See Also:
Serialized Form

Constructor Summary
AbstractLocator()
          Creates a new AbstractLocator.
 
Method Summary
 java.lang.Object duplicate()
          Duplicates the receiver.
 java.lang.Object duplicateIn(java.util.Hashtable duplicates)
          Duplicates the receiver into the given Hashtable.
 void postDuplicate(java.util.Hashtable duplicates)
          After a series of Objects are duplicated, this can be sent to each of the duplicates to resolve any changes it might like to reconcile.
 int r()
          Answer the radius of the Locator (as a PolarCoordinate).
 double theta()
          Answer the angle in radians of the Locator (as a PolarCoordinate).
 java.lang.String toString()
          Returns a String that represents the value of this object.
abstract  int x()
          Answer the x coordinate.
abstract  int y()
          Answer the y coordinate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractLocator

public AbstractLocator()
Creates a new AbstractLocator.
Method Detail

duplicate

public java.lang.Object duplicate()
Duplicates the receiver.
Returns:
an Object which is a duplicate of the receiver

duplicateIn

public java.lang.Object duplicateIn(java.util.Hashtable duplicates)
Duplicates the receiver into the given Hashtable.
Parameters:
duplicates - the Hashtable to put the new duplicate in
Returns:
an Object which is a duplicate of the receiver

postDuplicate

public void postDuplicate(java.util.Hashtable duplicates)
After a series of Objects are duplicated, this can be sent to each of the duplicates to resolve any changes it might like to reconcile. In this case, do nothing.
Parameters:
duplicates - a Hashtable with originals as keys and duplicates as elements

r

public int r()
Answer the radius of the Locator (as a PolarCoordinate).
Specified by:
r in interface Locator
Returns:
an integer representing the radius

theta

public double theta()
Answer the angle in radians of the Locator (as a PolarCoordinate).
Specified by:
theta in interface Locator
Returns:
double representing theta

toString

public java.lang.String toString()
Returns a String that represents the value of this object.
Overrides:
toString in class java.lang.Object
Returns:
a string representation of the receiver

x

public abstract int x()
Answer the x coordinate.
Specified by:
x in interface Locator
Returns:
an integer representing the x coordinate

y

public abstract int y()
Answer the y coordinate.
Specified by:
y in interface Locator
Returns:
an integer representing the y coordinate