Package edu.uci.ics.jung.algorithms.layout

Examples of edu.uci.ics.jung.algorithms.layout.PolarPoint


    double deltaRadius = getSize().width / 2 / maxy;
    for (Map.Entry<GraphNode, Point2D> entry
        : locations.entrySet()) {
      GraphNode v = entry.getKey();
      Point2D p = entry.getValue();
      PolarPoint polarPoint =
          new PolarPoint(p.getX() * theta, (p.getY() - 50) * deltaRadius);
      polarLocations.put(v, polarPoint);
    }
  }
View Full Code Here


  @Override
  public void setLocation(GraphNode v, Point2D location) {
    Point2D c = getCenter();
    Point2D pv = new Point2D.Double(location.getX() - c.getX(), location.getY()
        - c.getY());
    PolarPoint newLocation = PolarPoint.cartesianToPolar(pv);
    polarLocations.get(v).setLocation(newLocation);
  }
View Full Code Here

    return transform(v).getY();
  }

  @Override
  public Point2D transform(GraphNode v) {
    PolarPoint pp = polarLocations.get(v);
    double centerX = getSize().getWidth() / 2;
    double centerY = getSize().getHeight() / 2;
    Point2D cartesian = PolarPoint.polarToCartesian(pp);
    cartesian.setLocation(cartesian.getX() + centerX, cartesian.getY()
        + centerY);
View Full Code Here

        double dy = viewPoint.getY() - viewCenter.getY();
        // factor out ellipse
        dx *= ratio;
        Point2D pointFromCenter = new Point2D.Double(dx, dy);
       
        PolarPoint polar = PolarPoint.cartesianToPolar(pointFromCenter);
        double theta = polar.getTheta();
        double radius = polar.getRadius();
        if(radius > viewRadius) return viewPoint;
       
        double mag = magnification;
        radius *= mag;
       
View Full Code Here

        // factor out ellipse
        dx *= ratio;

        Point2D pointFromCenter = new Point2D.Double(dx, dy);
       
        PolarPoint polar = PolarPoint.cartesianToPolar(pointFromCenter);

        double radius = polar.getRadius();
        if(radius > viewRadius) return viewPoint;
        //delegate.inverseTransform(viewPoint);
       
        double mag = magnification;
        radius /= mag;
        polar.setRadius(radius);
        Point2D projectedPoint = PolarPoint.polarToCartesian(polar);
        projectedPoint.setLocation(projectedPoint.getX()/ratio, projectedPoint.getY());
        Point2D translatedBack = new Point2D.Double(projectedPoint.getX()+viewCenter.getX(),
                projectedPoint.getY()+viewCenter.getY());
//        return delegate.inverseTransform(translatedBack);
View Full Code Here

        double dy = viewPoint.getY() - viewCenter.getY();
        // factor out ellipse
        dx *= ratio;
        Point2D pointFromCenter = new Point2D.Double(dx, dy);
       
        PolarPoint polar = PolarPoint.cartesianToPolar(pointFromCenter);
        double theta = polar.getTheta();
        double radius = polar.getRadius();
        if(radius > viewRadius) return viewPoint;
       
        double mag = Math.tan(Math.PI/2*magnification);
        radius *= mag;
       
View Full Code Here

        // factor out ellipse
        dx *= ratio;

        Point2D pointFromCenter = new Point2D.Double(dx, dy);
       
        PolarPoint polar = PolarPoint.cartesianToPolar(pointFromCenter);

        double radius = polar.getRadius();
        if(radius > viewRadius) return viewPoint;//elegate.inverseTransform(viewPoint);
       
        radius /= viewRadius;
        radius = Math.abs(Math.tan(radius));
        radius /= Math.PI/2;
        radius *= viewRadius;
        double mag = Math.tan(Math.PI/2*magnification);
        radius /= mag;
        polar.setRadius(radius);
        Point2D projectedPoint = PolarPoint.polarToCartesian(polar);
        projectedPoint.setLocation(projectedPoint.getX()/ratio, projectedPoint.getY());
        Point2D translatedBack = new Point2D.Double(projectedPoint.getX()+viewCenter.getX(),
                projectedPoint.getY()+viewCenter.getY());
        return translatedBack;
View Full Code Here

        double dy = viewPoint.getY() - viewCenter.getY();
        // factor out ellipse
        dx *= ratio;
        Point2D pointFromCenter = new Point2D.Double(dx, dy);
       
        PolarPoint polar = PolarPoint.cartesianToPolar(pointFromCenter);
        double theta = polar.getTheta();
        double radius = polar.getRadius();
        if(radius > viewRadius) return viewPoint;
       
        double mag = Math.tan(Math.PI/2*magnification);
        radius *= mag;
       
View Full Code Here

        // factor out ellipse
        dx *= ratio;

        Point2D pointFromCenter = new Point2D.Double(dx, dy);
       
        PolarPoint polar = PolarPoint.cartesianToPolar(pointFromCenter);

        double radius = polar.getRadius();
        if(radius > viewRadius) return delegate.inverseTransform(viewPoint);
       
        radius /= viewRadius;
        radius = Math.abs(Math.tan(radius));
        radius /= Math.PI/2;
        radius *= viewRadius;
        double mag = Math.tan(Math.PI/2*magnification);
        radius /= mag;
        polar.setRadius(radius);
        Point2D projectedPoint = PolarPoint.polarToCartesian(polar);
        projectedPoint.setLocation(projectedPoint.getX()/ratio, projectedPoint.getY());
        Point2D translatedBack = new Point2D.Double(projectedPoint.getX()+viewCenter.getX(),
                projectedPoint.getY()+viewCenter.getY());
        return delegate.inverseTransform(translatedBack);
View Full Code Here

        double dy = viewPoint.getY() - viewCenter.getY();
        // factor out ellipse
        dx *= ratio;
        Point2D pointFromCenter = new Point2D.Double(dx, dy);
       
        PolarPoint polar = PolarPoint.cartesianToPolar(pointFromCenter);
        double theta = polar.getTheta();
        double radius = polar.getRadius();
        if(radius > viewRadius) return viewPoint;
       
        double mag = magnification;
        radius *= mag;
       
View Full Code Here

TOP

Related Classes of edu.uci.ics.jung.algorithms.layout.PolarPoint

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.