What do you mean? By default collapsing a subtree will remember the locations of the hidden nodes, and then expanding that subtree will restore those node locations.
If you want to do another layout, just call
Oh, maybe you are asking about how to call
doubleTreeLayout whenever the user collapses or expands a subtree? Implement "TreeCollapsed" and/or "TreeExpanded" DiagramEvent listeners.
I hope you now see why it is that we have a minimum length for a new post -- we want to encourage you to include enough information so that we can understand what the environment is for your question.