IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
ShapeFactoryPresentation factory = (ShapeFactoryPresentation)getCastedModel().getShapePresentation();
int newIndex = index + factory.getIndex();
ShapeModel shapeModel = (ShapeModel)childEditPart.getModel();
ShapePresentation shapePresentation = shapeModel.getShapePresentation();
ContainerShapePresentation parentPresentation = getParentContainer(shapePresentation);
Object layoutConstraint = ShapeUtil.getLayoutConstraint(shapePresentation,
parentPresentation.getLayout());
IFigure parentFigure = parentPresentation.getFigure();
parentFigure.add(child, layoutConstraint, newIndex);