/** * Moves this <code>ShapeGroup</code> to the specified location. * <p> * @param x the x coordinate of the top left corner of the shape in new location * @param y the y coordinate of the top left corner of the shape in new location */ public void moveTo(int x, int y){ java.awt.Rectangle anchor = getAnchor(); int dx = x - anchor.x; int dy = y - anchor.y; anchor.translate(dx, dy); setAnchor(anchor); Shape[] shape = getShapes(); for (int i = 0; i < shape.length; i++) { java.awt.Rectangle chanchor = shape[i].getAnchor(); chanchor.translate(dx, dy); shape[i].setAnchor(chanchor); } }