/** * Compute coordinates of nodes using a layout algorithm. * * @param g * the graph * @param layout * layout algorithm to use for computing coordinates * @param stab * stabilization limit */ public static void computeLayout(Graph g, Layout layout, double stab) { GraphReplay r = new GraphReplay(g.getId()); stab = Math.min(stab, 1); layout.addAttributeSink(g); r.addSink(layout); r.replay(g); r.removeSink(layout); layout.shake(); layout.compute(); do layout.compute(); while (layout.getStabilization() < stab); layout.removeAttributeSink(g); }
/** * Compute coordinates of nodes using a layout algorithm. * * @param g * the graph * @param layout * layout algorithm to use for computing coordinates * @param stab * stabilization limit */ public static void computeLayout(Graph g, Layout layout, double stab) { GraphReplay r = new GraphReplay(g.getId()); stab = Math.min(stab, 1); layout.addAttributeSink(g); r.addSink(layout); r.replay(g); r.removeSink(layout); layout.shake(); layout.compute(); do layout.compute(); while (layout.getStabilization() < stab); layout.removeAttributeSink(g); }
layout.removeAttributeSink(gg); layout = null; break;
layout.removeAttributeSink(gg); layout = null; break;