layoutPart = new LayoutPart(part, null);
boolean caretIsAtRight = caretLocation.get(0)
.booleanValue();
final int CARET_OFFSET = 1;
Rectangle bounds = null;
IFigure figure = ((GraphicalEditPart) part).getFigure();
if (!caretIsAtRight) {
FlowBox box;
if ((box = layoutPart.getLine(0)) != null) {
bounds = LayoutPart.getBounds(box);
}
} else {
FlowBox box;
if ((box = layoutPart.getLastLine()) != null) {
bounds = LayoutPart.getBounds(box);
}
}
if (bounds == null) {
bounds = figure.getBounds();
}
if (!caretIsAtRight) {
rect = new Rectangle(bounds.x - CARET_OFFSET, bounds.y,
CaretUpdater.CARET_WIDTH, bounds.height);// new
} else {
rect = new Rectangle(bounds.getRight().x + CARET_OFFSET,
bounds.y, CaretUpdater.CARET_WIDTH, bounds.height);// new
}
figure.translateToAbsolute(rect);
} else {
System.out.println("No concrete part?"); //$NON-NLS-1$
}
return rect;
}