Le mardi 28 mai 2013 à 23:08, Mauricio Carvalho a écrit :
For some reason, I can't reply via the mailing-list, so I'm doing it via gmail.
1 - It works!! Thank you very much for your help!
2 - I'm posting what I converted so far to eclipse, with WindowsBuilder Pro. Got same results on both eclipse and netbeans:
View creation:viewer = new Viewer(graph, Viewer.ThreadingModel.GRAPH_IN_ANOTHER_THREAD);viewer.enableAutoLayout();view = viewer.addDefaultView(true);
JTabbedPane creation, which is a parameter of my main JFrame):contentPane = new JPanel();contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));setContentPane(contentPane);contentPane.setLayout(new BorderLayout(0, 0));tabbedPane = new JTabbedPane(JTabbedPane.TOP);contentPane.add(tabbedPane);
Graphstream assignement to the pane:tabbedPane.add(xGraph.getView()); // this returns the graph.viewtabbedPane.setSelectedIndex(1);tabbedPane.setTitleAt(1, "All Worlds");
When I add it directly to the JFrame or some JPanel (which is actually what I want - separated JPanels on the same JFrame containing different graphs), the problem is gone, but the view doesn't fit the whole JFrame - its size is the same of the default graphstream window, which opens as well (but containing nothing but a gray, empty JPanel).
When I change view = viewer.addDefaultView(true); to view = viewer.addDefaultView(false); nothing happens. The view ends up not being added to the frame.
By the way, I must add that the messages printed on the console (that shows the begin and end of a selection) show the correct coordinates.
2013/5/28 Antoine Dutot <antoine.dutot AT gmail.com>Le mardi 28 mai 2013 à 16:46, mauricio0copo AT gmail.com a écrit :
1 - Yes, i created the loop (it's identical to the tutorial code). I tried justcopying/pasting the code on the tutorial, just to test it to see how it works,but that code is not 'compilable'. The three last functions don't have anydeclaration modifier nor class. I'm guessing it's implied that I had to knowwhich kind of declaration to use, but I'm not very knowledgeable aboutlisteners...Yes, this was not intended as a full program, but I changed it so that the copy/paste in a your IDE should work. I let you add the import clauses :
import org.graphstream.graph.Graph;
import org.graphstream.graph.implementations.SingleGraph;
import org.graphstream.ui.swingViewer.Viewer;
import org.graphstream.ui.swingViewer.ViewerListener;
import org.graphstream.ui.swingViewer.ViewerPipe;
2 - It's a big code! I'm creating the windows with netbeans (migrating soon toeclipse). Is it ok to post everything here? Or only the parts that makereferences to the JTabbedPanel in question?I would prefer a small part of the code, or something allowing me to reproduce it.3 - Oh, too bad... but thats ok. I'll find another alternative to display thedata on the label.By the way, Thanks for the really quick reply!:-)Antoine
Archives gérées par MHonArc 2.6.16.