next up previous contents index
Next: 8.3 The Generic Textual Up: 8 Tree Editing Previous: 8.1 Editing Trees

8.2 Edit and View Mode

  

The tree editors edit trees, like diagram editors edit graphs. See chapter 3 for all the diagram editing commands. During editing a tree, it should be visible which node is the root of the tree, so each root node is represented by a downwards pointing arrow, see figure 8.1.


  
Figure 8.1: Textual tree nodes and edges.
\begin{figure}
\begin{center}
\begin{tabular}
{\vert c p{1.3in} \vert c p{1.3in}...
 ...r}\end{minipage} & Text edge & & \  \hline\end{tabular}\end{center}\end{figure}

The trees that are used in [18] look rather different from the graph-like documents that you edit in this editor. Therefore, the tree editors have a forked tree    mode in which the graph is redrawn to look like a real tree [*]. In the forked tree mode it is not possible to edit the tree, but it can be loaded, saved, printed, previewed, zoomed and moved by the arrow buttons.

Below the Node and Edge buttons at the left edge of the main window, there is a pair of radio buttons to toggle between `editable graph'  mode and `forked tree' mode.

In the `forked tree' mode, the arrows are deleted from the root nodes and all children of a parent node will be connected to the parent as a `fork': there is a simple built-in layout algorithm which takes care of the proper drawing of the line pieces. The algorithm does not reposition the text nodes, so the user determines where the nodes are drawn, but TCM decides, taking the node positions into account, how the edges are drawn. See figures 8.2 and 8.3 for the same tree in the two different modes. You see that the final tree layout is determined by the node positions only.


  
Figure 8.2: Example tree in edit mode.
\begin{figure}
\begin{center}

\includegraphics {p/treeeditexample.eps}\end{center}\end{figure}


  
Figure 8.3: Example tree in forked tree (view) mode.
\begin{figure}
\begin{center}

\includegraphics {p/treeviewexample.eps}\end{center}\end{figure}


next up previous contents index
Next: 8.3 The Generic Textual Up: 8 Tree Editing Previous: 8.1 Editing Trees
Frank Dehne,Faculty of Mathematics and Computer Science, Vrije Universiteit Amsterdam
11/17/1997