Package com.cburch.draw.model

Examples of com.cburch.draw.model.HandleGesture


      fireChanged(SelectionEvent.ACTION_HANDLE, objs);
    }
  }

  public void setHandleGesture(HandleGesture gesture) {
    HandleGesture g = curHandleGesture;
    if (g != null) suppressed.remove(g.getHandle().getObject());
   
    Handle h = gesture.getHandle();
    suppressed.put(h.getObject(), MOVING_HANDLE);
    curHandleGesture = gesture;
  }
View Full Code Here


      if (event.getHandle().equals(selectedHandle)) {
        setHandleSelected(null);
      }
      break;
    case CanvasModelEvent.ACTION_HANDLE_MOVED:
      HandleGesture gesture = event.getHandleGesture();
      if (gesture.getHandle().equals(selectedHandle)) {
        setHandleSelected(gesture.getResultingHandle());
      }
    }
  }
View Full Code Here

  @Override
  void undoSub(CanvasModel model) {
    Handle oldHandle = gesture.getHandle();
    int dx = oldHandle.getX() - newHandle.getX();
    int dy = oldHandle.getY() - newHandle.getY();
    HandleGesture reverse = new HandleGesture(newHandle, dx, dy, 0);
    model.moveHandle(reverse);
  }
View Full Code Here

        int dy = han.getY() - my;
        if (dx >= -halfSize && dx <= halfSize
            && dy >= -halfSize && dy <= halfSize) {
          if (shape.canMoveHandle(han)) {
            curAction = MOVE_HANDLE;
            curGesture = new HandleGesture(han, 0, 0,
                e.getModifiersEx());
            repaintArea(canvas);
            return;
          } else if (clicked == null) {
            clicked = shape;
View Full Code Here

        canvas.doAction(new ModelTranslateAction(model, selected,
            moveDelta.getX(), moveDelta.getY()));
      }
      break;
    case MOVE_HANDLE:
      HandleGesture gesture = curGesture;
      curGesture = null;
      if (dragEffective && gesture != null) {
        ModelMoveHandleAction act;
        act = new ModelMoveHandleAction(model, gesture);
        canvas.doAction(act);
View Full Code Here

      }
    }

    switch (curAction) {
    case MOVE_HANDLE:
      HandleGesture gesture = curGesture;
      if (ctrl) {
        Handle h = gesture.getHandle();
        dx = canvas.snapX(h.getX() + dx) - h.getX();
        dy = canvas.snapY(h.getY() + dy) - h.getY();
      }
      curGesture = new HandleGesture(gesture.getHandle(), dx, dy, mods);
      canvas.getSelection().setHandleGesture(curGesture);
      break;
    case MOVE_ALL:
      if (ctrl) {
        int minX = Integer.MAX_VALUE;
View Full Code Here

    Selection selection = canvas.getSelection();
    int action = curAction;

    Location start = dragStart;
    Location end = dragEnd;
    HandleGesture gesture = null;
    boolean drawHandles;
    switch (action) {
    case MOVE_ALL:
      drawHandles = !dragEffective;
      break;
    case MOVE_HANDLE:
      drawHandles = !dragEffective;
      if (dragEffective) gesture = curGesture;
      break;
    default:
      drawHandles = true;
    }

    CanvasObject moveHandleObj = null;
    if (gesture != null) moveHandleObj = gesture.getHandle().getObject();
    if (drawHandles) {
      // unscale the coordinate system so that the stroke width isn't scaled
      double zoom = 1.0;
      Graphics gCopy = g.create();
      if (gCopy instanceof Graphics2D) {
View Full Code Here

            fireChanged(SelectionEvent.ACTION_HANDLE, objs);
        }
    }

    public void setHandleGesture(HandleGesture gesture) {
        HandleGesture g = curHandleGesture;
        if (g != null) {
            suppressed.remove(g.getHandle().getObject());
        }


        Handle h = gesture.getHandle();
        suppressed.put(h.getObject(), MOVING_HANDLE);
View Full Code Here

            if (event.getHandle().equals(selectedHandle)) {
                setHandleSelected(null);
            }
            break;
        case CanvasModelEvent.ACTION_HANDLE_MOVED:
            HandleGesture gesture = event.getHandleGesture();
            if (gesture.getHandle().equals(selectedHandle)) {
                setHandleSelected(gesture.getResultingHandle());

            }
      break;
    default:
      break;
View Full Code Here

                int dy = han.getY() - my;
                if (dx >= -halfSize && dx <= halfSize
                        && dy >= -halfSize && dy <= halfSize) {
                    if (shape.canMoveHandle(han)) {
                        curAction = MOVE_HANDLE;
                        curGesture = new HandleGesture(han, 0, 0,
                                e.getModifiersEx());
                        repaintArea(canvas);
                        return;
                    } else if (clicked == null) {
                        clicked = shape;
View Full Code Here

TOP

Related Classes of com.cburch.draw.model.HandleGesture

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.