* @return {@link ILocator} that positions handles on component side.
*/
private final ILocator createComponentLocator(int direction, double percent) {
Figure reference = getHostFigure();
if (direction == IPositionConstants.WEST) {
return new RelativeLocator(reference, 0, percent);
} else if (direction == IPositionConstants.EAST) {
return new RelativeLocator(reference, 1, percent);
} else if (direction == IPositionConstants.NORTH) {
return new RelativeLocator(reference, percent, 0);
} else if (direction == IPositionConstants.SOUTH) {
return new RelativeLocator(reference, percent, 1);
}
throw new IllegalArgumentException("Unknown direction: " + direction);
}