I saved state of my view-objects in own data structure
return;
JGoSubGraphBase.reparentToCommonSubGraph(jGoLink, jGoLink.getFromPort(), jGoLink.getToPort(), true, doc.getLinksLayer());
doc.endTransaction(getEditPresentationName(4));
}
I saved state of my view-objects in own data structure
When saving collapsed subgraph nodes, are you also saving and restoring the getSavedBounds() and getSavedPaths() HashMaps that remember the relative position and size of the child nodes and the relative points of the strokes of the child links?
Unrelated issue: in your addJGoLink method, you probably don’t want to fire a LINK_CREATED event, because that’s just supposed to be for user-drawn links, whereas it appears that you are calling this method for programmatic (re-)construction of a subgraph.
Actually, if you are just depending on the standard routing of the links, you probably don’t need to save the routes of the links in the collapsed subgraphs, since you can depend on the normal results of calculateStroke() to produce the right routes.
So I think the problem isn’t with saving/restoring the routes of the links.
I’m wondering if you are restoring the positions of the (invisible) child nodes correctly, relative to the subgraph’s Handle.
About positions of internal nodes.
You should look at the value of e.getHint() to see why each document change is happening.
When saving the state of a collapsed JGoSubGraph, you should be saving the locations of each of the child nodes as well as the SavedBounds for those same nodes, so that you can restore the same state upon reconstruction of the subgraph.
But you probably know that already, so I’m afraid I don’t understand what you are asking.
thanks, I made out all aforesaid. It seems that all works correctly now.
Yes, this property should be public. Please just make the property public in your JGo sources and we’ll do the same in our next release.