How to edit a tree

While designing your tree you may need to make structural changes on it. In order to do that, the program gives you some options: you can remove, detach and merge subtrees, and make local insertion or removal of nodes. The subtree of a node x is the tree whose root is x, that is, all children and grandchildren of x and x itself.

To remove a subtree, just right-click on it and then choose "remove node with subtree". A prompt will ask you to confirm the operation, then click "yes". All nodes of the subtree will be deleted, and there is no way to roll back the operation. The following picture illustrates two trees: the left one is the tree on which the operation will be performed, the right one is the resulting tree.

To detach a subtree from the tree structure, right-click on it and then select "detach node from tree". The selected subtree will be removed from the tree and will constitute a new tree by itself. (This independent new tree may be used for merging, for example.) In the previous place where the subtree resided there will be a null node as leftover. The next picture illustrates it.

You can merge two trees into one by dragging the root node of a tree onto a childless node of another tree. A prompt will ask you to confirm the merge operation. This function is the opposite of detaching, so you can detach a subtree from one place and attach it at another by merging. The next picture illustrates this process, where a subtree was detached (left) and then merged into another node (right).

Other ways to restructure a tree is by removing a single node or inserting a parental node. These options can be found in the "more" option in the node's menu. To remove a single node, right-click on it and select "more", and then "remove node only". The node will be removed if it is has at most one child, or if it is a root node. The picture bellow shows an example where the root node is removed (left). Its children become roots of new trees according to their own (right).

To insert a node, besides the basic option of adding a child, you may insert a new parent to a node, which will become an intermediation between this node and it's previous parent, if any. To do so, right-click on the node and select "more", and then "insert a parent". A null node will be placed between the node and its previous parent. The following picture exhibits the operation on the root node.


Copyright(C) 2008 by Daniel Donadon