예제 #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 mouseDown(MouseEvent e, int x, int y) {
    super.mouseDown(e, x, y);
    fLastX = x;
    fLastY = y;

    if (e.isShiftDown()) {
      view().toggleSelection(fAnchorFigure);
      fAnchorFigure = null;
    } else if (!view().isFigureSelected(fAnchorFigure)) {
      view().clearSelection();
      view().addToSelection(fAnchorFigure);
    }
  }
예제 #3
0
 public void mouseDown(MouseEvent e, int x, int y) {
   super.mouseDown(e, x, y);
   fAnchorHandle.invokeStart(x, y, view());
 }
예제 #4
0
 public void mouseUp(MouseEvent e, int x, int y) {
   super.mouseDrag(e, x, y);
   fAnchorHandle.invokeEnd(x, y, fAnchorX, fAnchorY, view());
 }
예제 #5
0
 public void deactivate(DrawingView view) {
   super.deactivate();
   endEdit();
 }