I have a palette constructed from a TreeLayout and I want to use the information from the TreeNetwork to implement my command handler to support keyboard navigation.
The treeLayout.network is null. I tried calling doLayout as it says that it creates it if not there and should populate everything and resolve the roots. After calling it, the network is still null and from debugging it seems that doLayout sets it back to null at the end.
So question is, how can I get a populated TreeNetwork that I can then use to navigate the tree graph of Vertices, looking at roots, children, expanded state that all seems to be there if I can get my hand on this network. Can make it work without that, but will be much more involved.
First, don’t depend on the TreeLayout’s TreeNetwork. That’s just used for layout. Although it’s normally isomorphic with the graph of Nodes and Links of the Diagram, it might not be.
Just use the Nodes and Links in the Diagram to do your navigation. There are a bunch of tree-oriented methods and properties on the Node class that you can use. Look for names that have “tree” in them.
But if you want to have the user navigate a tree using arrow keys, use the DrawCommandHandler extension, and set DrawCommandHandler.arrowKeyBehavior to “tree”.