Get Parent Vertex from a JGraphX Tree

525 Views Asked by At

Suppose I have a graph like this:

enter image description here

Suppose I also have a reference to the (Object) cell 573. Is there a way I can get a reference to its parent in the graph, the (Object) cell 792? Can't seem to find an answer in the api. I'm still pretty new to JGraphX.

1

There are 1 best solutions below

0
On BEST ANSWER

I found a way that seems to work pretty well: As I draw my graph from my Java data structure (in the form of a tree) I store in a hashmap key-value pairs for each element in the Java data structure and its corresponding object in the jgraph. That way I can easily get the corresponding jgraphx cell for any node in the tree of my data structure.