Package com.cburch.draw.model

Examples of com.cburch.draw.model.HandleGesture


                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

    @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

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.