Package org.gephi.preview.util

Examples of org.gephi.preview.util.Vector


            originalBottomRight = new PointImpl(0f, 0f);
            return;
        }

        Node node = it.next();
        Vector topLeftVector = new Vector(node.getTopLeftPosition());
        Vector bottomRightVector = new Vector(node.getBottomRightPosition());

        while (it.hasNext()) {
            node = it.next();

            if (node.getTopLeftPosition().getX() < topLeftVector.x) {
View Full Code Here


    /**
     * Updates the graph sheet's dimensions according to the set margin.
     */
    private void updateDimensions() {
        Vector topLeftVector = new Vector(originalTopLeft);
        topLeftVector.sub(margin, margin, 0);
        topLeft = new PointImpl(topLeftVector);

        Vector bottomRightVector = new Vector(originalBottomRight);
        bottomRightVector.add(margin, margin, 0);
        bottomRight = new PointImpl(bottomRightVector);

        Vector box = new Vector(bottomRightVector);
        box.sub(topLeftVector);
        width = box.x;
        height = box.y;
    }
View Full Code Here

    /**
     * Generates the edge arrow's first point.
     */
    protected void genPt1() {
        Vector v = new Vector(direction);
        v.mult(addedRadius);
        v.add(new Vector(refNode.getPosition()));

        pt1 = new PointImpl(v);
    }
View Full Code Here

    /**
     * Generates the edge arrow's second point.
     */
    protected void genPt2() {
        Vector v = new Vector(direction);
        v.mult(getDirectedEdgeSupervisor().getArrowSize());
        v.add(new Vector(pt1));

        pt2 = new PointImpl(v);
    }
View Full Code Here

    /**
     * Generates the edge arrow's third point.
     */
    protected void genPt3() {
        Vector v = new Vector(-direction.y, direction.x);
        v.mult(BASE_RATIO * getDirectedEdgeSupervisor().getArrowSize());
        v.add(new Vector(pt1));

        pt3 = new PointImpl(v);
    }
View Full Code Here

    /**
     * Generates the edge label's position.
     */
    public void genPosition() {
        // relative position from the first boundary
        Vector positionVector = new Vector(parent.getNode1().getPosition());
       
        // move it to the middle of the edge
        Vector semiLength = new Vector(parent.getDirection());
        semiLength.mult(parent.getLength() / 2);
        positionVector.add(semiLength);

        position = new PointImpl(positionVector);

        // set label position above the parent edge
View Full Code Here

     *
     * @param parent  the parent edge of the edge arrow
     */
    public EdgeArrowB1In(DirectedEdgeImpl parent) {
        super(parent);
        direction = new Vector(-parent.getDirection().x, -parent.getDirection().y);
        refNode = parent.getNode1();
    }
View Full Code Here

    /**
     * Sets the edge label's position above its parent edge's one.
     */
    protected void putPositionAboveEdge(Vector edgeDirection, float edgeThickness) {
        // normal vector for vertical align
        Vector n = new Vector(edgeDirection.y, -edgeDirection.x);

        // the mini-label mustn't be on the edge but over/under it
        n.mult(edgeThickness / 2);
        Vector positionVector = new Vector(position);
        positionVector.add(n);

        position = new PointImpl(positionVector);
    }
View Full Code Here

     */
    public void genPosition() {
        NodeImpl n2 = parent.getNode2();

        // relative position from the second boundary
        Vector positionVector = new Vector(n2.getPosition());

        // add the added radius
        Vector move = new Vector(parent.getDirection());
        move.mult(-(getDirectedEdgeSupervisor().getMiniLabelAddedRadius() + n2.getRadius()));
        positionVector.add(move);

        position = new PointImpl(positionVector);

        // set label position above the parent edge
View Full Code Here

        } else {
            this.label = null;
            this.labelBorder = null;
        }

        Vector topLeftVector = new Vector(position);
        topLeftVector.sub(radius, radius, 0);
        topLeftPosition = new PointImpl(topLeftVector);

        Vector bottomRightVector = new Vector(position);
        bottomRightVector.add(radius, radius, 0);
        bottomRightPosition = new PointImpl(bottomRightVector);

        getNodeSupervisor().addNode(this);
    }
View Full Code Here

TOP

Related Classes of org.gephi.preview.util.Vector

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.