private HashMap<Component,Component> copyComponents(Collection<Component> components,
int dx, int dy) {
HashMap<Component,Component> ret = new HashMap<Component,Component>();
for (Component comp : components) {
Location oldLoc = comp.getLocation();
AttributeSet attrs = (AttributeSet) comp.getAttributeSet().clone();
int newX = oldLoc.getX() + dx;
int newY = oldLoc.getY() + dy;
Object snap = comp.getFactory().getFeature(ComponentFactory.SHOULD_SNAP, attrs);
if (snap == null || ((Boolean) snap).booleanValue()) {
newX = Canvas.snapXToGrid(newX);