public void stabilizeLayout(double limit) { if (layout != null) { while (layout.getStabilization() < limit) layout.compute(); } }
public void run() { int stepAfterStabilization = 0; do { pumpPipe.pump(); layout.compute(); if (layout.getStabilization() > layout.getStabilizationLimit()) stepAfterStabilization++; else stepAfterStabilization = 0; nap(80); if (stepAfterStabilization > layoutStepAfterStabilization) loop = false; } while (loop); } }
public void run() { int stepAfterStabilization = 0; do { pumpPipe.pump(); layout.compute(); if (layout.getStabilization() > layout.getStabilizationLimit()) stepAfterStabilization++; else stepAfterStabilization = 0; nap(80); if (stepAfterStabilization > layoutStepAfterStabilization) loop = false; } while (loop); } }
public void stabilizeLayout(double limit) { if (layout != null) { while (layout.getStabilization() < limit) layout.compute(); } }
@Override public void run() { String layoutName = layout.getLayoutAlgorithmName(); while (loop) { double limit = layout.getStabilizationLimit(); pumpPipe.pump(); if (limit > 0) { if (layout.getStabilization() > limit) { nap(longNap); } else { layout.compute(); nap(shortNap); } } else { layout.compute(); nap(shortNap); } } logger.info(String.format("Layout '%s' process stopped.", layoutName)); }
/** * 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); }
@Override public void run() { String layoutName = layout.getLayoutAlgorithmName(); while (loop) { double limit = layout.getStabilizationLimit(); pumpPipe.pump(); if (limit > 0) { if (layout.getStabilization() > limit) { nap(longNap); } else { layout.compute(); nap(shortNap); } } else { layout.compute(); nap(shortNap); } } logger.info(String.format("Layout '%s' process stopped.", layoutName)); }
/** * 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); }