Package org.gephi.preview.util

Examples of org.gephi.preview.util.Vector.mult()


    /**
     * 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

        // 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

    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

        // 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

        // relative position from the first boundary
        Vector positionVector = new Vector(n1.getPosition());

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

        position = new PointImpl(positionVector);

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

    protected void genCurves() {
        float factor = BEZIER_CURVE_FACTOR * length;

        // normal vector to the edge
        Vector n = new Vector(direction.y, -direction.x);
        n.mult(factor);

        // first control point
        Vector v1 = new Vector(direction);
        v1.mult(factor);
        v1.add(new Vector(node1.getPosition()));
View Full Code Here

        Vector n = new Vector(direction.y, -direction.x);
        n.mult(factor);

        // first control point
        Vector v1 = new Vector(direction);
        v1.mult(factor);
        v1.add(new Vector(node1.getPosition()));
        v1.add(n);

        // second control point
        Vector v2 = new Vector(direction);
View Full Code Here

        v1.add(new Vector(node1.getPosition()));
        v1.add(n);

        // second control point
        Vector v2 = new Vector(direction);
        v2.mult(-factor);
        v2.add(new Vector(node2.getPosition()));
        v2.add(n);

        curves.add(new CubicBezierCurveImpl(
                node1.getPosition(),
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.