void draw() { GWTGraph graph = getGraph(); D3 edgeSelection = getEdgeSelection(graph); D3 vertexSelection = getVertexSelection(graph); vertexSelection .enter() .create(GWTVertex.create()) .call(setupEventHandlers()) .attr( "transform", new Func<String, GWTVertex>() { public String call(GWTVertex vertex, int index) { GWTVertex displayVertex = vertex.getDisplayVertex(m_oldSemanticZoomLevel); return "translate(" + displayVertex.getX() + "," + displayVertex.getY() + ")"; } }) .attr("opacity", 1); // Exits edgeSelection.exit().with(exitTransition()).remove(); vertexSelection .exit() .with( new D3Behavior() { @Override public D3 run(D3 selection) { return selection.transition().delay(0).duration(500); } }) .attr( "transform", new Func<String, GWTVertex>() { public String call(GWTVertex vertex, int index) { GWTVertex displayVertex = vertex.getDisplayVertex(m_semanticZoomLevel); return "translate(" + displayVertex.getX() + "," + displayVertex.getY() + ")"; } }) .attr("opacity", 0) .remove(); // Updates edgeSelection.with(updateTransition()).call(GWTEdge.draw()).attr("opacity", 1); vertexSelection.with(updateTransition()).call(GWTVertex.draw()).attr("opacity", 1); // Enters edgeSelection .enter() .create(GWTEdge.create()) .call(setupEdgeEventHandlers()) .with(enterTransition()); // vertexSelection.enter().create(GWTVertex.create()).call(setupEventHandlers()).with(enterTransition()); }