Exemplo n.º 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;
  }
 /** Called when a drag operation is ongoing on the DropTarget. */
 public void dragOver(DropTargetDragEvent dtde) {
   // log("DropTargetDragEvent-dragOver");
   if (supportDropTargetDragEvent(dtde) == true) {
     int x = dtde.getLocation().x;
     int y = dtde.getLocation().y;
     if ((Math.abs(x - fLastX) > 0) || (Math.abs(y - fLastY) > 0)) {
       // FigureEnumeration fe = view().selectionElements();
       // while (fe.hasNextFigure()) {
       //	fe.nextFigure().moveBy(x - fLastX, y - fLastY);
       //	System.out.println("moving Figures " + view());
       // }
       // view().drawing().update();
       fLastX = x;
       fLastY = y;
     }
   }
 }