I have a map like this:
<span =“Apple-tab-span” style=“white-space:pre”> Node A -----> Node B -------> Node C --------> Node D
I set up a context menu that when i right-click on the link connecting node A and node B and choose “split a flow” then imaging node A is the left branch and node B all the nodes reachable from B except through A is the right branch
In this case the
<span =“Apple-tab-span” style=“white-space:pre”> + Left branch : Node A
<span =“Apple-tab-span” style=“white-space:pre”> + Right branch: Node B---->Node C ----> Node D
i want to move the right branch with this code:
…
$$(“ContextMenuButton”,
$$(go.TextBlock, "split a flow"),
{ click: function(e, obj) { SplitFlow(e,obj); } },....));
…
function SplitFlow(e,obj)
<span =“Apple-tab-span” style=“white-space:pre”> {
<span =“Apple-tab-span” style=“white-space:pre”> var Link = myDiagram.selection.first();
<span =“Apple-tab-span” style=“white-space:pre”> var toNode = Link.toNode;
<span =“Apple-tab-span” style=“white-space:pre”> var MoveSet = toNode.findTreeParts();
<span =“Apple-tab-span” style=“white-space:pre”> myDiagram.toolManager.draggingTool.moveParts(MoveSet,new go.Point(200,200),true);
<span =“Apple-tab-span” style=“white-space:pre”> }
this turns out to be wrong . I think the method Node.findTreeParts() is return a Set while i need a Map for the 1st parameter in the draggingTool.movePart.
How can i fix this?
Thanks