public void particleMoved(Object id, double x, double y, double z) { //for (LayoutListener listener : listeners) // listener.nodeMoved((String) id, x, y, z); Object xyz[] = new Object[3]; xyz[0] = x; xyz[1] = y; xyz[2] = z; sendNodeAttributeChanged(getLayoutAlgorithmName(), (String) id, "xyz", xyz, xyz); // System.out.printf("particle %s moved : %f;%f;%f\n", id, x, y, z); }
public void nodeAdded(String sourceId, long timeId, String nodeId) { particles.put(nodeId, getNewParticle(nodeId)); stabilization = 0; }
public void edgeAdded(String sourceId, long timeId, String edgeId, String fromNodeId, String toNodeId, boolean directed) { EadesParticle p1, p2; Spring spring; p1 = (EadesParticle) particles.get(fromNodeId); p2 = (EadesParticle) particles.get(toNodeId); spring = getNewSpring(p1, p2); springs.put(edgeId, spring); p1.springs.put(p2, spring); p2.springs.put(p1, spring); stabilization = 0; }
public static void main(String... args) { DefaultGraph g = new DefaultGraph("g"); BarabasiAlbertGenerator gen = new BarabasiAlbertGenerator(); Eades84Layout layout = new Eades84Layout(); int size = 30; gen.addSink(g); g.addSink(layout); layout.addAttributeSink(g); g.display(false); gen.begin(); while (size-- > 0) gen.nextEvents(); gen.end(); while (true) { layout.compute(); try { Thread.sleep(50); } catch (Exception e) { } } } }
particleMoved(p.id, p.pos.x, p.pos.y, p.pos.z);
public static void main(String... args) { DefaultGraph g = new DefaultGraph("g"); BarabasiAlbertGenerator gen = new BarabasiAlbertGenerator(); Eades84Layout layout = new Eades84Layout(); int size = 30; gen.addSink(g); g.addSink(layout); layout.addAttributeSink(g); g.display(false); gen.begin(); while (size-- > 0) gen.nextEvents(); gen.end(); while (true) { layout.compute(); try { Thread.sleep(50); } catch (Exception e) { } } } }
particleMoved(p.id, p.pos.x, p.pos.y, p.pos.z);
public void particleMoved(Object id, double x, double y, double z) { //for (LayoutListener listener : listeners) // listener.nodeMoved((String) id, x, y, z); Object xyz[] = new Object[3]; xyz[0] = x; xyz[1] = y; xyz[2] = z; sendNodeAttributeChanged(getLayoutAlgorithmName(), (String) id, "xyz", xyz, xyz); // System.out.printf("particle %s moved : %f;%f;%f\n", id, x, y, z); }
public void edgeAdded(String sourceId, long timeId, String edgeId, String fromNodeId, String toNodeId, boolean directed) { EadesParticle p1, p2; Spring spring; p1 = (EadesParticle) particles.get(fromNodeId); p2 = (EadesParticle) particles.get(toNodeId); spring = getNewSpring(p1, p2); springs.put(edgeId, spring); p1.springs.put(p2, spring); p2.springs.put(p1, spring); stabilization = 0; }
public void nodeAdded(String sourceId, long timeId, String nodeId) { particles.put(nodeId, getNewParticle(nodeId)); stabilization = 0; }