Manual

Main Tutorial Graph Editor Modify Graph

# Tutorial Exercise 5.3: Modifying existing Graphs

After getting familiar with the basic editing operations, we will now come to some more advanced features of the graph editor. They will be explained based on one of the example graphs of the uDraw(Graph) distribution, to see how modification of an existing graph works. You should now save your current graph before with menu File/Save As... if you want to keep it for a later session. After doing this, load file "graph_example.udg" or "graph_example.status" in the "samples/graphs" directory of the distribution.

Now you should see a large graph in the base window. You can modify the structure of this graph with the basic editing operations described before. But here is something new: select an arbitrary node in this graph and choose menu Edit/Node/Attributes... afterwards. A dialog window will appear where you can modify all attributes of this specific node. To get this dialog, you can also click on the third graph editor icon (when a node is selected) or simply double-click on a node or use the node's pop-up menu. Play a little bit with the dialog items of this attribute window and press the apply button to use your modifications in the graph visualization. For more convenience, the window will remain open until you press the close button. When you select a new node in the graph, the window is updated to show the attributes of the current selection. You can even modify the attributes of many selected nodes in one step.

For example, change the shape to value Image for one specific node and enter the string "uDrawGraph_logo.gif" in the "Image File" field that becomes available. This .gif file is in the "icons" directory of the uDraw(Graph) distribution, which is part of the icon search path by default (refer to environment variable $UDG_ICONDIR).

Different colors are also available to be used as node attribute. If you do not like the given palette, then you can set your own preferences with the color editor that appears after clicking on the color field and then on the "Edit Colors..." button. Next, change the text of a particular node with the attributes dialog. You can even get nodes with multi-line text by typing return in the text entry field. As you have already seen, newly inserted nodes will get a default text. You can specify the pattern for this text with menu Edit/Node/Naming Scheme..., Here, the special character # is a placeholder for the current node number.

Edges also have attributes. Double-click on one of the edges in the graph to get the edge attributes dialog. Modify the attributes of some edges to see what happens.

End of Exercise 5.3. Go back to the Section 5 Overview.