Package org.gephi.preview.util

Examples of org.gephi.preview.util.Vector


    /**
     * Generates the self-loop's curve.
     */
    private void genCurve() {
        Vector v1 = new Vector(node.getPosition());
        v1.add(node.getDiameter(), -node.getDiameter(), 0);

        Vector v2 = new Vector(node.getPosition());
        v2.add(node.getDiameter(), node.getDiameter(), 0);

        curve = new CubicBezierCurveImpl(
                node.getPosition(),
                new PointImpl(v1),
                new PointImpl(v2),
View Full Code Here


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

     */
    public void genPosition() {
        NodeImpl n1 = parent.getNode1();

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

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

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

        this.node1 = node1;
        this.node2 = node2;
        this.metaEdge = edge instanceof MetaEdge;

        // edge direction vector + edge length
        direction = new Vector(this.node2.getPosition());
        direction.sub(new Vector(this.node1.getPosition()));
        length = direction.mag();
        direction.normalize();

        //Color
        if (edge.getEdgeData().r() != -1) {
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()));
        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(),
                new PointImpl(v1),
                new PointImpl(v2),
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.