Hi @all,i tried to retrieve node positions just as suggested on the tutorial page (http://graphstream-project.org/doc/Tutorials/Graph-Visualisation_1.0/#viewers) in chapter 2 under "Retrieving nodes coordinates of the automatic layout".I do however get for each node the position "0.0 0.0 0.0", which does not make any sense as the drawn graph looks different.I appreciate any feedback/comment on what i am doing wrong.Thanks in advance.Best regards,Barbaros ÖzdemirPS: Here the code i have executed;Import org.graphstream.graph *.Import org.graphstream.graph.implementations *.Import org.graphstream.ui.view.Viewer;import static org.graphstream.algorithm.Toolkit *.public class Tutorial1 {public static void main (String args []) {Graph graph = new Graph Single ("Tutorial 1");graph.addNode ("A");graph.addNode ("B");graph.addNode ("C");graph.addNode ("D");graph.addEdge ("AB", "A", "B");graph.addEdge ("AC", "A", "C");graph.addEdge ("AD", "A", "D");graph.addEdge ("BD", "B", "D");graph.addEdge ("BC", "B", "C");graph.addEdge ("DC", "D", "C");for (Node n: graph) {String nodeId = n.getId ();Node node = graph.getNode (nodeId);Double pos [] = nodePosition (node);System.out.print (n.getId () + "");for (int i = 0; i <pos.length; i ++) {System.out.print (pos [i] + "");}System.out.println ("");}Viewer viewer = graph.display ();viewer.enableAutoLayout ();}}PPS: And here the output (the graph is in attachment):A: 0.0 0.0 0.0B: 0.0 0.0 0.0C: 0.0 0.0 0.0D: 0.0 0.0 0.0
Archives gérées par MHonArc 2.6.16.