Runtime

org.eclipse.gmf.runtime.diagram.ui.figures
Class LabelLocator

java.lang.Object
  extended byorg.eclipse.draw2d.AbstractLocator
      extended byorg.eclipse.gmf.runtime.diagram.ui.figures.LabelLocator
All Implemented Interfaces:
Locator

public class LabelLocator
extends AbstractLocator

Label locator that supports locating labels whose parent is either a Node or and Edge.


Field Summary
protected  IFigure parent
          the parent figure of this locator
 
Constructor Summary
LabelLocator(IFigure parent, Point offSet, int alignment)
          Constructor to create a an instance of LabelLocator which locates an IFigure offset relative to a calculated reference point.
LabelLocator(IFigure parent, Rectangle bounds, int alignment)
          Constructor for figure who are located and sized.
 
Method Summary
 int getAlignment()
          Returns the alignment of ConnectionLocator.
 Point getOffset()
          getter for the offset point
protected  PointList getPointList()
          Returns the PointList describing the label's parent.
protected  Point getReferencePoint()
          Returns the reference point for the locator.
 Dimension getSize()
          Returns the current extent for this locator
 void relocate(IFigure target)
          Positions the lable relative to the reference point with the given offsets.
 void setOffset(Point offset)
          setter for the offset point
 
Methods inherited from class org.eclipse.draw2d.AbstractLocator
getGap, getNewBounds, getRelativePosition, setGap, setRelativePosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected IFigure parent
the parent figure of this locator

Constructor Detail

LabelLocator

public LabelLocator(IFigure parent,
                    Point offSet,
                    int alignment)
Constructor to create a an instance of LabelLocator which locates an IFigure offset relative to a calculated reference point.

Parameters:
parent - the parent figure
offSet - the relative location of the label
alignment - the alignment hint in the case the parent is a Connection

LabelLocator

public LabelLocator(IFigure parent,
                    Rectangle bounds,
                    int alignment)
Constructor for figure who are located and sized.

Parameters:
parent -
bounds -
alignment -
Method Detail

getOffset

public Point getOffset()
getter for the offset point

Returns:
point

setOffset

public void setOffset(Point offset)
setter for the offset point

Parameters:
offset -

relocate

public void relocate(IFigure target)
Positions the lable relative to the reference point with the given offsets.


getReferencePoint

protected Point getReferencePoint()
Returns the reference point for the locator.

Returns:
the reference point

getAlignment

public int getAlignment()
Returns the alignment of ConnectionLocator.

Returns:
The alignment

getSize

public Dimension getSize()
Returns the current extent for this locator

Returns:
the extent

getPointList

protected PointList getPointList()
Returns the PointList describing the label's parent.

Returns:
pointList

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.