Draw2D v2.0

org.eclipse.draw2d
Class AbstractLocator

java.lang.Object
  |
  +--org.eclipse.draw2d.AbstractLocator
All Implemented Interfaces:
Locator
Direct Known Subclasses:
ConnectionLocator

public abstract class AbstractLocator
extends Object
implements Locator

Repositions a Figure attached to a Connection when the Connection is moved.


Constructor Summary
AbstractLocator()
           
 
Method Summary
 int getGap()
          Returns the number of pixels the figure's bounding rectangle is from the connection.
protected  Rectangle getNewBounds(Dimension size, Point center)
          Recalculate the location of the figure according to its desired position relative to the center point.
protected abstract  Point getReferencePoint()
          Returns a reference point used to calculate the location.
 int getRelativePosition()
          Returns the position of the figure with respect to the center point.
 void relocate(IFigure target)
          Relocates the given IFigure.
 void setGap(int i)
          Sets the number of pixels the figure's bounding rectangle is from the connection.
 void setRelativePosition(int pos)
          Sets the position of the figure with respect to the center point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLocator

public AbstractLocator()
Method Detail

getGap

public int getGap()
Returns the number of pixels the figure's bounding rectangle is from the connection. Only used if getRelativePosition() returns something other than CENTER.
Since:
2.0

getReferencePoint

protected abstract Point getReferencePoint()
Returns a reference point used to calculate the location.
Since:
2.0

getNewBounds

protected Rectangle getNewBounds(Dimension size,
                                 Point center)
Recalculate the location of the figure according to its desired position relative to the center point.
Since:
2.0

getRelativePosition

public int getRelativePosition()
Returns the position of the figure with respect to the center point. May be CENTER, NORTH, SOUTH, EAST, WEST, NORTH_EAST, NORTH_WEST, SOUTH_EAST, or SOUTH_WEST.
Since:
2.0

relocate

public void relocate(IFigure target)
Description copied from interface: Locator
Relocates the given IFigure.
Specified by:
relocate in interface Locator

setGap

public void setGap(int i)
Sets the number of pixels the figure's bounding rectangle is from the connection. Only used if getRelativePosition() returns something other than CENTER.
Since:
2.0

setRelativePosition

public void setRelativePosition(int pos)
Sets the position of the figure with respect to the center point. May be CENTER, NORTH, SOUTH, EAST, WEST, NORTH_EAST, NORTH_WEST, SOUTH_EAST, or SOUTH_WEST.
Since:
2.0

Draw2D v2.0