ConnectionEditPart connectionEditPart = (ConnectionEditPart)getHost();
if (connectionEditPart.getSource() == connectionEditPart.getTarget())
{
return null;
}
CreateBendPointCommand com = new CreateBendPointCommand();
Point p = request.getLocation();
Connection conn = getConnection();
conn.translateToRelative(p);
com.setLocation(p);
Point ref1 = getConnection().getSourceAnchor().getReferencePoint();
Point ref2 = getConnection().getTargetAnchor().getReferencePoint();
conn.translateToRelative(ref1);
conn.translateToRelative(ref2);
com.setRelativeDimensions(p.getDifference(ref1), p.getDifference(ref2));
com.setDiagramConnectionModel((DiagramConnectionModel) request.getSource().getModel());
com.setIndex(request.getIndex());
return com;
}