コード例 #1
0
  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;
  }
コード例 #2
0
 public void mouseUp(MouseEvent e, int x, int y) {
   super.mouseDrag(e, x, y);
   fAnchorHandle.invokeEnd(x, y, fAnchorX, fAnchorY, view());
 }