Package org.antlr.xjlib.appkit.gview.base

Examples of org.antlr.xjlib.appkit.gview.base.Vector2D


        }

        float cx = x1-ctrl_offset;
        float ax0 = cx-arc_offset;

        Vector2D a = new Vector2D(cx, y0);
        Vector2D b = new Vector2D(x1, y1);
        Vector2D z = a.add(b.sub(a).setLength(Math.abs(arc_offset)));

        drawLine(x0+start_offset, y0, ax0, y0);
        drawSpline((float)z.x, (float)z.y, x1, y1, 0, end_offset, 0, arrow);

        QuadCurve2D.Float quad = new QuadCurve2D.Float();
View Full Code Here


    }

    @Override
    public void updateAnchors() {
        setAnchor(ANCHOR_CENTER, position.copy(), Anchor2D.DIRECTION_FREE);
        setAnchor(ANCHOR_TOP, new Vector2D(0, -height*0.5).append(position), Anchor2D.DIRECTION_TOP);
        setAnchor(ANCHOR_BOTTOM, new Vector2D(0, height*0.5).append(position), Anchor2D.DIRECTION_BOTTOM);
        setAnchor(ANCHOR_LEFT, new Vector2D(-width*0.5, 0).append(position), Anchor2D.DIRECTION_LEFT);
        setAnchor(ANCHOR_RIGHT, new Vector2D(width*0.5, 0).append(position), Anchor2D.DIRECTION_RIGHT);
    }
View Full Code Here

    public void beginDrag() {
        oldPosition = null;
    }

    public Vector2D dragElementPosition(Vector2D p) {
        Vector2D ep = p.copy();
        if(oldPosition != null) {
            ep.x += p.x-oldPosition.x;
            ep.y += p.y-oldPosition.y;
        }
        return ep;
View Full Code Here

    public void drag(Vector2D p) {
        double dx = 0;
        double dy = 0;

        if(oldPosition == null) {
            oldPosition = new Vector2D();
        }   else {
            dx = p.x-oldPosition.x;
            dy = p.y-oldPosition.y;
        }
View Full Code Here

        this.targetAnchorKey = targetAnchorKey;
        this.shape = shape;
        this.pattern = pattern;
        initializeLink(flateness);
        if(source == target)
            link.setDirection(new Vector2D(0, 1));
        else
            link.setDirection(source.getPosition().sub(target.getPosition()));
        setSourceTangentOffset(source.getDefaultAnchorOffset(sourceAnchorKey));
        setTargetTangentOffset(target.getDefaultAnchorOffset(targetAnchorKey));
    }
View Full Code Here

    public void setTargetTangentOffset(double offset) {
        link.setEndTangentOffset(offset);
    }

    public void setSourceOffset(double x, double y) {
        setSourceOffset(new Vector2D(x, y));
    }
View Full Code Here

    public void setSourceOffset(Vector2D offset) {
        link.setStartOffset(offset);
    }

    public void setTargetOffset(double x, double y) {
        setTargetOffset(new Vector2D(x, y));
    }
View Full Code Here

            case SHAPE_BEZIER:
                // Cannot toggle a bezier link
                return;
        }
        double flateness = link.getFlateness();
        Vector2D direction = link.getDirection();

        link = createLinkInstance();
        link.setFlateness(flateness);
        link.setDirection(direction);
    }
View Full Code Here

    }

    public void setTarget(double x, double y) {
        arrow.setAnchor(x, y);

        target = new Vector2D(x, y);
        Vector2D direction = getPosition().sub(target);
        arrow.setDirection(direction);
    }
View Full Code Here

        return radius;
    }

    public void updateAnchors() {
        setAnchor(ANCHOR_CENTER, position, Anchor2D.DIRECTION_FREE);
        setAnchor(ANCHOR_TOP, position.add(new Vector2D(0, -radius)), Anchor2D.DIRECTION_TOP);
        setAnchor(ANCHOR_BOTTOM, position.add(new Vector2D(0, radius)), Anchor2D.DIRECTION_BOTTOM);
        setAnchor(ANCHOR_LEFT, position.add(new Vector2D(-radius, 0)), Anchor2D.DIRECTION_LEFT);
        setAnchor(ANCHOR_RIGHT, position.add(new Vector2D(radius, 0)), Anchor2D.DIRECTION_RIGHT);
    }
View Full Code Here

TOP

Related Classes of org.antlr.xjlib.appkit.gview.base.Vector2D

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.