public void mouseDrag(MouseEvent e, int x, int y) { super.mouseDrag(e, x, y); fMoved = (Math.abs(x - fAnchorX) > 4) || (Math.abs(y - fAnchorY) > 4); if (fMoved) { FigureEnumeration figures = getUndoActivity().getAffectedFigures(); while (figures.hasMoreElements()) { figures.nextFigure().moveBy(x - fLastX, y - fLastY); } } fLastX = x; fLastY = y; }
public void mouseUp(MouseEvent e, int x, int y) { super.mouseDrag(e, x, y); fAnchorHandle.invokeEnd(x, y, fAnchorX, fAnchorY, view()); }