* returned.
* @param request the Clone Request
* @return A command to perform the Clone.
*/
protected Command getCloneCommand(ChangeBoundsRequest request) {
CloneCommand clone = new CloneCommand();
clone.setParent((LogicDiagram)getHost().getModel());
Iterator i = request.getEditParts().iterator();
GraphicalEditPart currPart = null;
while (i.hasNext()) {
currPart = (GraphicalEditPart)i.next();
clone.addPart((LogicSubpart)currPart.getModel(),
(Rectangle)getConstraintForClone(currPart, request));
}
// Attach to horizontal guide, if one is given
Integer guidePos = (Integer)request.getExtendedData()
.get(SnapToGuides.KEY_HORIZONTAL_GUIDE);
if (guidePos != null) {
int hAlignment = ((Integer)request.getExtendedData()
.get(SnapToGuides.KEY_HORIZONTAL_ANCHOR)).intValue();
clone.setGuide(findGuideAt(guidePos.intValue(), true), hAlignment, true);
}
// Attach to vertical guide, if one is given
guidePos = (Integer)request.getExtendedData()
.get(SnapToGuides.KEY_VERTICAL_GUIDE);
if (guidePos != null) {
int vAlignment = ((Integer)request.getExtendedData()
.get(SnapToGuides.KEY_VERTICAL_ANCHOR)).intValue();
clone.setGuide(findGuideAt(guidePos.intValue(), false), vAlignment, false);
}
return clone;
}