public void executeDrag(Point p, Drawing dwg) { // Make sure we have a shape and point to work with if (s != null && oP != null) { s.setWidth(p.x - oP.x); // Set the new width s.setHeight(p.y - oP.y); // Set the new height s.cleanup(oP); // Cleanup s relative to oP } }