/** * Relaxation step. Moves all nodes a smidge. */ @Override public void step() { super.step(); currentIteration++; testAverageDeltas(); }
/** * Relaxation step. Moves all nodes a smidge. */ @Override public void step() { super.step(); currentIteration++; testAverageDeltas(); }
/** * Relaxation step. Moves all nodes a smidge. */ public void step() { try { for(V v : getGraph().getVertices()) { SpringVertexData svd = springVertexData.getUnchecked(v); if (svd == null) { continue; } svd.dx /= 4; svd.dy /= 4; svd.edgedx = svd.edgedy = 0; svd.repulsiondx = svd.repulsiondy = 0; } } catch(ConcurrentModificationException cme) { step(); } relaxEdges(); calculateRepulsion(); moveNodes(); }
/** * Relaxation step. Moves all nodes a smidge. */ public void step() { try { for(V v : getGraph().getVertices()) { SpringVertexData svd = springVertexData.get(v); if (svd == null) { continue; } svd.dx /= 4; svd.dy /= 4; svd.edgedx = svd.edgedy = 0; svd.repulsiondx = svd.repulsiondy = 0; } } catch(ConcurrentModificationException cme) { step(); } relaxEdges(); calculateRepulsion(); moveNodes(); }
private static void doSpringLayout(final Layout graphLayout, SparseGraph<VertexRef, EdgeRef> jungGraph, Dimension size, int repulsion) { SpringLayout<VertexRef, EdgeRef> layout = new SpringLayout<VertexRef, EdgeRef>(jungGraph); layout.setForceMultiplier(SPRING_FORCE_MULTIPLIER); layout.setRepulsionRange(repulsion); layout.setInitializer(initializer(graphLayout)); layout.setSize(size); int count = 0; while(!layout.done() && count < 700) { layout.step(); count++; } for(VertexRef v : jungGraph.getVertices()) { graphLayout.setLocation(v, new Point(layout.getX(v), layout.getY(v))); } }
private static void doSpringLayout(final Layout graphLayout, SparseGraph<VertexRef, EdgeRef> jungGraph, Dimension size, int repulsion) { SpringLayout<VertexRef, EdgeRef> layout = new SpringLayout<VertexRef, EdgeRef>(jungGraph); layout.setForceMultiplier(SPRING_FORCE_MULTIPLIER); layout.setRepulsionRange(repulsion); layout.setInitializer(initializer(graphLayout)); layout.setSize(size); int count = 0; while(!layout.done() && count < 700) { layout.step(); count++; } for(VertexRef v : jungGraph.getVertices()) { graphLayout.setLocation(v, new Point(layout.getX(v), layout.getY(v))); } }
layout.step(); count++;
layout.step(); count++;