void (GuiEditor editor, RadComponent[] components, GridConstraints[] constraintsToAdjust, ComponentDragObject dragObject) { int patchX = 0; int patchY = 0; for (int i = 0; i < components.length; i++) { final RadComponent c = components[i]; final Point p = new Point(myLocation); Point delta = dragObject.getDelta(i); if (delta != null) { p.translate(delta.x, delta.y); } c.setLocation(p); patchX = Math.min(patchX, p.x); patchY = Math.min(patchY, p.y); myContainer.addComponent(c); } // shift components if necessary to make sure that no component has negative x or y if (patchX < 0 || patchY < 0) { for(RadComponent component : components) { component.shift(-patchX, -patchY); } } }