public PolarPoint transform(ONDEXConcept arg0) { return new PolarPoint(); } });
public PolarPoint load(V vertex) { return new PolarPoint(); } });
public PolarPoint transform(V arg0) { return new PolarPoint(); }});
/** * @param x the x coordinate of the input location * @param y the y coordinate of the input location * @return the result of converting <code>(x, y)</code> to polar coordinates. */ public static PolarPoint cartesianToPolar(double x, double y) { double theta = Math.atan2(y,x); double radius = Math.sqrt(x*x+y*y); return new PolarPoint(theta, radius); }
/** * Returns the result of converting <code>(x, y)</code> to polar coordinates. */ public static PolarPoint cartesianToPolar(double x, double y) { double theta = Math.atan2(y,x); double radius = Math.sqrt(x*x+y*y); return new PolarPoint(theta, radius); }
protected void setRootPolar(V root) { PolarPoint pp = new PolarPoint(0,0); Point2D p = getCenter(); polarLocations.put(root, pp); locations.put(root, p); }
private void setRadialLocations() { Point2D max = getMaxXY(); double maxx = max.getX(); double maxy = max.getY(); maxx = Math.max(maxx, size.width); double theta = 2*Math.PI/maxx; double deltaRadius = size.width/2/maxy; for(Map.Entry<V, Point2D> entry : locations.entrySet()) { V v = entry.getKey(); Point2D p = entry.getValue(); PolarPoint polarPoint = new PolarPoint(p.getX()*theta, (p.getY() - this.distY)*deltaRadius); polarLocations.put(v, polarPoint); } } }
private void setRadialLocations() { Point2D max = getMaxXY(); double maxx = max.getX(); double maxy = max.getY(); maxx = Math.max(maxx, size.width); double theta = 2*Math.PI/maxx; double deltaRadius = size.width/2/maxy; for(Map.Entry<V, Point2D> entry : locations.asMap().entrySet()) { V v = entry.getKey(); Point2D p = entry.getValue(); PolarPoint polarPoint = new PolarPoint(p.getX()*theta, (p.getY() - this.distY)*deltaRadius); polarLocations.put(v, polarPoint); } } }
/** * Transform into radial positions. * */ private void setRadialLocations() { state = "calculating node positions"; Point2D max = getMaxXY(); double maxx = max.getX(); double maxy = max.getY(); double theta = 2 * Math.PI / maxx; double deltaRadius = maxy / 2; for (Map.Entry<ONDEXConcept, Point2D> entry : locations.entrySet()) { ONDEXConcept v = entry.getKey(); Point2D p = entry.getValue(); PolarPoint polarPoint = new PolarPoint(p.getX() * theta, (p.getY() - 50) * deltaRadius); polarLocations.put(v, polarPoint); if (cancelled) return; } progress++; }
protected void setPolars(List<V> kids, Point2D parentLocation, double parentRadius) { int childCount = kids.size(); if(childCount == 0) return; // handle the 1-child case with 0 limit on angle. double angle = Math.max(0, Math.PI / 2 * (1 - 2.0/childCount)); double childRadius = parentRadius*Math.cos(angle) / (1 + Math.cos(angle)); double radius = parentRadius - childRadius; double rand = Math.random(); for(int i=0; i< childCount; i++) { V child = kids.get(i); double theta = i* 2*Math.PI/childCount + rand; radii.put(child, childRadius); PolarPoint pp = new PolarPoint(theta, radius); polarLocations.put(child, pp); Point2D p = PolarPoint.polarToCartesian(pp); p.setLocation(p.getX()+parentLocation.getX(), p.getY()+parentLocation.getY()); locations.put(child, p); setPolars(new ArrayList<V>(graph.getChildren(child)), p, childRadius); } }
protected void setPolars(List<V> kids, Point2D parentLocation, double parentRadius) { int childCount = kids.size(); if(childCount == 0) return; // handle the 1-child case with 0 limit on angle. double angle = Math.max(0, Math.PI / 2 * (1 - 2.0/childCount)); double childRadius = parentRadius*Math.cos(angle) / (1 + Math.cos(angle)); double radius = parentRadius - childRadius; double rand = Math.random(); for(int i=0; i< childCount; i++) { V child = kids.get(i); double theta = i* 2*Math.PI/childCount + rand; radii.put(child, childRadius); PolarPoint pp = new PolarPoint(theta, radius); polarLocations.put(child, pp); Point2D p = PolarPoint.polarToCartesian(pp); p.setLocation(p.getX()+parentLocation.getX(), p.getY()+parentLocation.getY()); locations.put(child, p); setPolars(new ArrayList<V>(graph.getChildren(child)), p, childRadius); } }
protected void setRootPolar(V root) { PolarPoint pp = new PolarPoint(0,0); Point2D p = getCenter(); polarLocations.put(root, pp); locations.put(root, p); }