JavaFXSmartGraph icon indicating copy to clipboard operation
JavaFXSmartGraph copied to clipboard

How to reset graph after remove vertices of edges

Open chuckdu21 opened this issue 2 years ago • 2 comments

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

chuckdu21 avatar Sep 20 '22 07:09 chuckdu21

Maybe future enhancement ?

chuckdu21 avatar Sep 20 '22 07:09 chuckdu21

My solution is: I setVisible false the elements i want to hide ^^

chuckdu21 avatar Sep 21 '22 08:09 chuckdu21

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! 😄

brunomnsilva avatar May 04 '23 21:05 brunomnsilva