com.rolemodelsoft.drawlet.basics
Class DrawingPoint

java.lang.Object
  |
  +--com.rolemodelsoft.drawlet.basics.AbstractLocator
        |
        +--com.rolemodelsoft.drawlet.basics.DrawingPoint

public class DrawingPoint
extends AbstractLocator
implements MovableLocator

This provides basic default functionality for MovableLocators. Basically, it's just java.awt.Point with the proper interface to be interchangeable with other Locators

See Also:
Serialized Form

Field Summary
protected  int x
          The x coordinate of this DrawingPoint.
protected  int y
          The y coordinate of this DrawingPoint.
 
Constructor Summary
DrawingPoint(int x, int y)
          Constructs and initializes a Point from the specified x and y coordinates.
 
Method Summary
 void move(int x, int y)
          Moves the receiver to the x and y coordinates
 void translate(int x, int y)
          Moves the receiver in the x and y direction.
 int x()
          Answer the x coordinate.
 void x(int x)
          Set the x coordinate.
 int y()
          Answer the y coordinate.
 void y(int y)
          Set the y coordinate.
 
Methods inherited from class com.rolemodelsoft.drawlet.basics.AbstractLocator
duplicate, duplicateIn, postDuplicate, r, theta, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

protected int x
The x coordinate of this DrawingPoint.

y

protected int y
The y coordinate of this DrawingPoint.
Constructor Detail

DrawingPoint

public DrawingPoint(int x,
                    int y)
Constructs and initializes a Point from the specified x and y coordinates.
Parameters:
x - the x coordinate
y - the y coordinate
Method Detail

move

public void move(int x,
                 int y)
Moves the receiver to the x and y coordinates
Specified by:
move in interface MovableLocator
Parameters:
x - the new x coordinate
y - the new x coordinate

translate

public void translate(int x,
                      int y)
Moves the receiver in the x and y direction.
Specified by:
translate in interface MovableLocator
Parameters:
x - amount to move in the x direction
y - amount to move in the y direction

x

public int x()
Answer the x coordinate.
Overrides:
x in class AbstractLocator
Returns:
an integer representing the x coordinate

x

public void x(int x)
Set the x coordinate.
Specified by:
x in interface MovableLocator
Parameters:
x - its new desired x coordinate.

y

public int y()
Answer the y coordinate.
Overrides:
y in class AbstractLocator
Returns:
an integer representing the y coordinate

y

public void y(int y)
Set the y coordinate.
Specified by:
y in interface MovableLocator
Parameters:
y - its new desired y coordinate.