From: SourceForge.net <no...@so...> - 2006-09-29 07:43:31
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=3938650 By: loicdvi Hi, I've no display when I try to load a graph from a graphML file, after having initialized the display even if I repaint the VizualizationViewer. This is the code I use, maybe you'll find something wrong : //The initialization method (pGraph is a panel in my Frame) public void init(){ g = new UndirectedSparseGraph(); l = new FRLayout(g); PluggableRenderer r = new PluggableRenderer(); r.setVertexStringer(new VertexStringerShowID()); vv = new VisualizationViewer(l,r, new Dimension(800, 800)); vv.setGraphMouse(new DefaultModalGraphMouse()); GraphZoomScrollPane scrollPane = new GraphZoomScrollPane(vv); pGraph.add(scrollPane); } Then I do this : g = loadFile("foo.xml"); l.update(); if (!vv.isVisRunnerRunning()){ vv.init(); } vv.repaint(); The loadFile function is here : private Graph loadFile(String fileName){ GraphMLFile f; Graph g = null; FileReader fr; f = new GraphMLFile(); fr = null; try{ fr = new FileReader(fileName); g = f.load(fr); fr.close(); }catch(Exception e){ System.out.println("Exception : " + e); e.printStackTrace(); } return g; } If I initialize the display after having loaded the file (except the initialization of 'g')it's all right, but my aim is to load many files one after one and I'd like not to re-initialize the display at each time. I also tried to put vv.suspend() before I load the graph and vv.unsuspend after the layout update but it doesn't change anything. Thanks for your help ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=252062 |