JavaFXSmartGraph
JavaFXSmartGraph copied to clipboard
How to reset graph after remove vertices of edges
Hi, In my project, when i double click on a vertex, i want to display only vertices that are adjacents to the one a clicked on, and after i want to display all the elements of my graph but does not work... I tried to remove all vertices and edges and then insert all of them but it crash here:
var v = this.viewGraph.getStylableVertex(vertex);
v.removeStyleClass("vertex");
v is null
I tried to reinstance my graph and viewgraph but it crash when i do an update of the graph, here is the error:
Exception in thread "JavaFX Application Thread" java.lang.IllegalStateException: You must call this method after the instance was added to a scene.
at com.brunomnsilva.smartgraph.graphview.SmartGraphPanel.update(SmartGraphPanel.java:317)
How can i do that ? thx
Maybe future enhancement ?
My solution is: I setVisible false the elements i want to hide ^^
If you're trying to delve into the inner workings of the source code to get some result, it may be difficult to assist. Maybe my architecture does not allow what you're asking. Again, the visualization library was made to reflect the underlying graph.
So... vertices will "disappear" when they are removed from the graph.
But I think you found an interesting solution for your use-case! 😄