Runtime

## org.eclipse.gmf.runtime.diagram.ui.figures
Interface IBorderItemLocator

All Superinterfaces:
  Locator

All Known Implementing Classes:
  BorderItemLocator

public interface IBorderItemLocator
extends Locator

Controls the location of border items around another figure. An `IBorderItemLocator` is used in conjunction with `BorderItemSelectionEditPolicy` for feedback when moving border items and with `AbstractBorderItemEditPart` when refreshing the bounds of the border item figure.

Method Summary
`int` `getCurrentSideOfParent()` Returns the side of the parent figure on which the border item is currently on.
`Rectangle` `getValidLocation(Rectangle proposedLocation, IFigure borderItem)` Returns a suitable location for the border item given a proposed location.
`void` `setConstraint(Rectangle constraint)` Sets the constraint for the location of this border item.

Methods inherited from interface org.eclipse.draw2d.Locator
`relocate`

Method Detail

### setConstraint

    public void setConstraint(Rectangle constraint)

  Sets the constraint for the location of this border item.

  Parameters:
    `constraint` - the position and optionally size

### getValidLocation

    public Rectangle getValidLocation(Rectangle proposedLocation,
                                      IFigure borderItem)

  Returns a suitable location for the border item given a proposed location. By implementing this method, the feedback shown when the user moves a border item can reflect where the locator will actually place the border item.

  For example, if the border item is restricted to being on the border of its parent shape, when the user attempts to move the border item outside the border of the parent shape (the proposed location), the feedback will always show the border item on the border. In this case, this method would return a location on the border close to the proposed location.

  Parameters:
    `proposedLocation` - a proposed location and optionally size
    `borderItem` - the border item in question
  Returns:
    a rectangle containing the valid location

### getCurrentSideOfParent

    public int getCurrentSideOfParent()

  Returns the side of the parent figure on which the border item is currently on.

  Returns:
    the side on which this border item appears as defined in `PositionConstants`

Runtime

Guidelines for using Eclipse APIs.

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