Package org.graphstream.ui.geom

Examples of org.graphstream.ui.geom.Vector2


      Point2 oo = (Point2) o;
      xyz[0] = oo.x;
      xyz[1] = oo.y;
      xyz[2] = 0;
    } else if(o instanceof Vector2) {
      Vector2 oo = (Vector2) o;
      xyz[0] = oo.data[0];
      xyz[1] = oo.data[1];
      xyz[2] = 0;
    } else {
      logger.warning(String.format("Do not know how to handle xyz attribute %s.", o.getClass().getName()));
View Full Code Here


      Point2 oo = (Point2) o;
      pos.x = oo.x;
      pos.y = oo.y;
      pos.z = 0;
    } else if(o instanceof Vector2) {
      Vector2 oo = (Vector2) o;
      pos.x = oo.data[0];
      pos.y = oo.data[1];
      pos.z = 0;
    } else {
            logger.warning(String.format("Do not know how to handle xyz attribute %s%n", o.getClass().getName()));
View Full Code Here

      if (group.getArrowShape() != ArrowShape.NONE) {
        Path2D shape = new Path2D.Double();
        GraphicNode node0 = (GraphicNode) edge.getNode0();
        GraphicNode node1 = (GraphicNode) edge.getNode1();
        double off = evalEllipseRadius(edge, node0, node1, camera);
        Vector2 theDirection = new Vector2(node1.getX() - node0.getX(),
            node1.getY() - node0.getY());

        theDirection.normalize();

        double x = node1.x - (theDirection.data[0] * off);
        double y = node1.y - (theDirection.data[1] * off);
        Vector2 perp = new Vector2(theDirection.data[1],
            -theDirection.data[0]);

        perp.normalize();
        theDirection.scalarMult(arrowLength);
        perp.scalarMult(arrowWidth);

        // Create a polygon.

        shape.reset();
        shape.moveTo(x, y);
View Full Code Here

            double ctrl[] = edge.getControlPoints();
            Point2 p0 = new Point2(edge.from.getX(), edge.from.getY());
            Point2 p1 = new Point2(ctrl[0], ctrl[1]);
            Point2 p2 = new Point2(ctrl[1], ctrl[2]);
            Point2 p3 = new Point2(edge.to.getX(), edge.to.getY());
            Vector2 perp = CubicCurve.perpendicular(p0, p1, p2, p3,
                sprite.getX());
            double y = metrics.lengthToGu(sprite.getY(), sprite.getUnits());

            perp.normalize();
            perp.scalarMult(y);

            pos.x = CubicCurve.eval(p0.x, p1.x, p2.x, p3.x, sprite.getX())
                - perp.data[0];
            pos.y = CubicCurve.eval(p0.y, p1.y, p2.y, p3.y, sprite.getX())
                - perp.data[1];
View Full Code Here

TOP

Related Classes of org.graphstream.ui.geom.Vector2

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.