targetElementConstraint = parentElement.getConstraint();
parentElement = parentElement.getParent();
}
if (targetElementConstraint != null) {
Viewport viewport = (Viewport) ((FreeformGraphicalRootEditPart) getGraphicalViewer().getRootEditPart()).getFigure();
Dimension dim = viewport.getSize();
Point startLocation = viewport.getViewLocation().getCopy();
Point preferredEndLocation = new Point(targetElementConstraint.x - dim.width / 2 + targetElementConstraint.width / 2,
targetElementConstraint.y - dim.height / 2 + targetElementConstraint.height / 2);
moveViewport(viewport, startLocation, preferredEndLocation);
}