|
Eclipse Draw2d 3.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.draw2d.AbstractLocator
Places a figure relative to a point determined by the subclass. The figure may be placed in some location relative to the point with a configurable amount of spacing.
Constructor Summary | |
AbstractLocator()
Creates a new AbstractLocator. |
Method Summary | |
int |
getGap()
Returns the number of pixels to leave between the figure being located and the reference point. |
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 the reference point in absolute coordinates used to calculate the location. |
int |
getRelativePosition()
Returns the position of the figure with respect to the center point. |
void |
relocate(IFigure target)
Recalculates the position of the figure and returns the updated bounds. |
void |
setGap(int i)
Sets the gap between the reference point and the figure being placed. |
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 |
public AbstractLocator()
Method Detail |
public int getGap()
getRelativePosition()
returns something other
than PositionConstants.CENTER
.
protected abstract Point getReferencePoint()
protected Rectangle getNewBounds(Dimension size, Point center)
size
- The size of the figurecenter
- The center point
public int getRelativePosition()
PositionConstants
and include CENTER, NORTH, SOUTH, EAST, WEST,
NORTH_EAST, NORTH_WEST, SOUTH_EAST, or SOUTH_WEST.
public void relocate(IFigure target)
relocate
in interface Locator
target
- The figure to relocatepublic void setGap(int i)
PositionConstants.CENTER
.
i
- The gappublic void setRelativePosition(int pos)
PositionConstants
and include CENTER, NORTH, SOUTH, EAST, WEST,
NORTH_EAST, NORTH_WEST, SOUTH_EAST, or SOUTH_WEST.
pos
- The relative position
|
Eclipse Draw2d 3.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |