Package com.cburch.draw.model

Examples of com.cburch.draw.model.Handle


        int x = bds.getX();
        int y = bds.getY();
        int w = bds.getWidth();
        int h = bds.getHeight();
        return UnmodifiableList.decorate(Arrays.asList(new Handle[] {
                new Handle(this, x, y), new Handle(this, x + w, y),
                new Handle(this, x + w, y + h), new Handle(this, x, y + h) }));
    }
View Full Code Here


    @Override
    public List<Handle> getHandles(HandleGesture gesture) {
        if (gesture == null) {
            return UnmodifiableList.decorate(Arrays.asList(new Handle[] {
                    new Handle(this, x0, y0), new Handle(this, x1, y1) }));
        } else {
            Handle h = gesture.getHandle();
            int dx = gesture.getDeltaX();
            int dy = gesture.getDeltaY();
            Handle[] ret = new Handle[2];
            ret[0] = new Handle(this, h.isAt(x0, y0)
                    ? Location.create(x0 + dx, y0 + dy) : Location.create(x0, y0));
            ret[1] = new Handle(this, h.isAt(x1, y1)
                    ? Location.create(x1 + dx, y1 + dy) : Location.create(x1, y1));
            return UnmodifiableList.decorate(Arrays.asList(ret));
        }
    }
View Full Code Here

        return true;
    }

    @Override
    public Handle moveHandle(HandleGesture gesture) {
        Handle h = gesture.getHandle();
        int dx = gesture.getDeltaX();
        int dy = gesture.getDeltaY();
        Handle ret = null;
        if (h.isAt(x0, y0)) {
            x0 += dx;
            y0 += dy;
            ret = new Handle(this, x0, y0);
        }
        if (h.isAt(x1, y1)) {
            x1 += dx;
            y1 += dy;
            ret = new Handle(this, x1, y1);
        }
        bounds = Bounds.create(x0, y0, 0, 0).add(x1, y1);
        return ret;
    }
View Full Code Here

        if (setForStroke(g)) {
            int x0 = this.x0;
            int y0 = this.y0;
            int x1 = this.x1;
            int y1 = this.y1;
            Handle h = gesture.getHandle();
            if (h.isAt(x0, y0)) {
                x0 += gesture.getDeltaX();
                y0 += gesture.getDeltaY();
            }
            if (h.isAt(x1, y1)) {
                x1 += gesture.getDeltaX();
                y1 += gesture.getDeltaY();
            }
            g.drawLine(x0, y0, x1, y1);
        }
View Full Code Here

            canRaise = false;
            canLower = false;
        }
        boolean canAddCtrl = false;
        boolean canRemCtrl = false;
        Handle handle = sel.getSelectedHandle();
        if (handle != null && canChange) {
            CanvasObject o = handle.getObject();
            canAddCtrl = o.canInsertHandle(handle.getLocation()) != null;
            canRemCtrl = o.canDeleteHandle(handle.getLocation()) != null;
        }

        setEnabled(LogisimMenuBar.CUT, selHasRemovable && canChange);
        setEnabled(LogisimMenuBar.COPY, !selEmpty);
        setEnabled(LogisimMenuBar.PASTE, canChange && clipExists);
View Full Code Here

    }

    @Override
    public void addControlPoint() {
        Selection sel = canvas.getSelection();
        Handle handle = sel.getSelectedHandle();
        canvas.doAction(new ModelInsertHandleAction(canvas.getModel(), handle));
    }
View Full Code Here

    }

    @Override
    public void removeControlPoint() {
        Selection sel = canvas.getSelection();
        Handle handle = sel.getSelectedHandle();
        canvas.doAction(new ModelDeleteHandleAction(canvas.getModel(), handle));
    }
View Full Code Here

TOP

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

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.