Dear List,
I'd like to ask for your help in the following issues.
My goal is to have a Swing integrated View of the graph (preferably as a separate thread from the main thread)
in which changes made to nodes are propagated back to the underlying graph.
Here is what I tried:
1. I initiated my viewer as viewer = graph.display() , and it works fine as far as selecting nodes
(they change color, I can select and deselect them with right mouse click or by dragging mouse).
However, when a node (actually the representation of the node in the viewer) is selected, i.e. the element
gets the attribute ui.selected, when I loop through the nodes of the graph, none of the nodes has the attribute
ui.selected. I think this is due to the lack of the backwards communication from the viewer to the graph.
With other word, no matter what change is made in the viewer, it's not reflected in the graph itself.
As far as I understand, this is the way it should work, according to the tutorial on Views.
So how can I change this? Or how can I access nodes of the graph that have a ui.selected attribute in the view?
2. I tried the Click() example in the tutorial, and it worked fine. So how can I integrate this as a separate
GUI thread in a Swing GUI application? The Click() example creates the view via graph.display() and
not via "Viewer(graph, Viewer.ThreadingModel.GRAPH_IN_ANOTHER_THREAD);".
I think the conflict here is that integration into Swing requires a JPanel class (like the View is a
subclass of JPanel), but the synchronized viewer-graph class is not a JPanel subclass.
Any help would be greatly appreciated! Thanks a lot!
Best,
Gergely
Archives gérées par MHonArc 2.6.16.