3. TUTORIAL

Contents Previous Next Index
This section of the manual provides an introduction to Robochart by guiding you through the creation of three example diagrams. Once you've used the basic features of the program for these examples, you'll be ready to start on your own diagrams. The remaining sections of the manual contain detailed descriptions of program functions, to be referenced as needed. If you read through this tutorial while following along with the program on your computer, you will find the operations to be simple and natural.

Startup

Start Robochart with the command line

% rchart [-c config_file] [chart_file] [options]

You can also configure Robochart to be started from a file manager, as described in Section 2.

Command-line Options

The -c config_file option specifies the full pathname of a configuration file. If this option is not used, Robochart looks for the file .rchart in your home directory. Section 10 describes configuration files.

The chart_file optional argument specifies the pathname of a diagram file, which is automatically loaded at startup. If a directory name is given instead, it sets the default directory for loading and saving files.

The remaining options allow changing the default window parameters, or handling special conditions. Refer to Section 10 and your desktop environment documentation for details. The command rchart -help (OPEN LOOK version only) displays a summary of these options.

If you set environment variable RCHT_HOME to a directory name where you keep your diagram files, Robochart will change to that directory automatically when starting (unless a diagram file or directory is specified on the command line).

Examples

% rchart

starts Robochart with the default configuration.

% rchart -c ~/flowcht.cfg myflow.dat

starts Robochart with the configuration file ~/flowcht.cfg and loads the diagram file myflow.dat.

Once started, the Robochart main window appears:

Basic Operation

Robochart follows standard Motif or OPEN LOOK user interface guidelines.

Motif Subwindows

The Robochart main window contains the following areas, from top to bottom:

OPEN LOOK Subwindows

The Robochart main window contains the following areas, from top to bottom:
Additional command windows can be activated - these are described later.

Mouse Input

Except for text input and shortcut keys, all Robochart functions are controlled using the pointing device, usually a mouse. There are three basic pointer controls, referred to as the left, middle, and right buttons, due to their normal assignment. (If your mouse only has two buttons, your environment may have a way to emulate a third button, typically by pressing both the left and right buttons together.)

Mouse actions are described with the following terms:

For example, "left-click on the item" means move the mouse so that the screen pointer is over the item, then press and release the left mouse button. The left button is used most often, so the terms "click" or "drag" without any qualification refer to the left button. Some commands are performed by holding down an appropriate modifier key (Shift, Control, or Meta) during the mouse operation. These can be described, for example, as a "shift-click" or a "control-drag".

Many functions are controlled from menus.


Motif Menus

To display a pulldown menu, move the pointer over the menu label in the menu bar and press the left button. To display a pop-up menu, move the pointer over the appropriate part of the drawing area and press the right button. To choose an item from the displayed menu, drag the pointer to highlight the item and release the mouse button. If you change your mind, move the pointer away from the menu, so that no menu item is highlighted, before releasing the mouse button. If you prefer, click once to display the menu, then move the pointer to the desired item, and click again to choose the item. If a menu item is not currently available (for example, Edit/ Delete when no objects are selected), it appears dimmed, and you won't be able to highlight the item.

A dashed line across the top of a menu (in later versions of Motif) indicates that the menu can be torn off to stay on-screen, by choosing the dashed line or by dragging the dashed line with the middle button.


OPEN LOOK Menus

To display a button menu, move the pointer over the menu pushbutton and press the right button. To display a pop-up menu, move the pointer over the appropriate part of the drawing area and press the right button. To choose an item from the displayed menu, drag the pointer to highlight the item and release the mouse button. If you change your mind, move the pointer away from the menu, so that no menu item is highlighted, before releasing the mouse button. If you prefer, click once to display the menu, then move the pointer to the desired item, and click again to choose the item. If a menu item is not currently available (for example, Edit/ Delete when no objects are selected), it appears dimmed, and you won't be able to highlight the item. Menus have default choices, indicated by a ring around the choice label. You can left-click on the menu button to quickly choose the default item without displaying the menu. Note: The "Options" menu described in this manual is labeled "Properties" on the OPEN LOOK screen per standard.

Menu items with an arrow on the right have submenus. To display the submenu, drag the pointer toward the arrow. Then, highlight the desired choice from the submenu.

Menu items with three dots after the label indicate that a command window or dialog will be displayed if that item is chosen. These may contain settings (which are adjusted by left-clicking), text fields (which are filled in from the keyboard), and pushbuttons (which are activated by left-clicking). There are also pushpins to keep the window displayed when you apply settings - left-click on the pin to "pin up" the window. Clicking again "unpins" the window, removing it from the screen (if the pushpin is currently out, you can double-click to cancel the window).

Keyboard Input

Shortcut keys are provided for many operations - reminders for these keys appear in the corresponding menu selections. For example, "Copy +C" means you can use Meta/C (hold down the Meta or Alt modifier key and press C) to perform a Copy without using the menu. (See the README file for suggestions if you have problems with Meta or Alt keys.)

Motif Keyboard Shortcuts

By default, Robochart disables keyboard activation of the pulldown menus (e.g. Meta/F for File) to avoid interfering with more useful keyboard shortcuts. You can change this by setting the menuAccel application resource (see Section 10) to True; the accelerator keys for menus are then indicated in the menu bar by underlining. If your keyboard has separate Alt and Meta keys, you may find that you can access either the menu or the program function (e.g. Options menu or Zoom Out function) by Meta the appropriate modifier key (Alt/O or Meta/O). You may also be able to use F10 to direct keyboard input to the menu bar (even with menuAccel set to False). Once a menu is displayed, you can press a key corresponding to an underlined letter to choose that menu function, use the arrow keys and Return to traverse the menu, or press Escape to cancel.


OPEN LOOK Keyboard Shortcuts

The F2 through F10 keys can be programmed to substitute for Meta key combinations using the FKeys application resource (see Section 10).

Diagram Document

This manual often refers to a diagram document. A document is saved to and loaded from a file as a unit. You can have any number of pages in each document, where each page may, in turn, contain several connected levels. One level is displayed on the screen at a time. You can print a single level, a whole page, or the entire document at one time; each active level is printed onto its own sheet of paper. The document structure is like an upside-down tree, with levels numbered in this manner:

Example 1: State Transition Diagram

For our first example, we'll create this state transition diagram, representing a simple sentence parser for an adventure game.

The ellipses are states the parser uses to keep track of what it's done so far. The flows show the transitions between states made by the parser in response to particular inputs. For example, with the input sentence Feed hungry dog, the parser starts in the INITIAL state, interprets Feed as a verb and changes to the VERB state. Hungry is an adjective, so the parser moves to the VERB+ADJ state. The noun dog completes the sentence in the valid DONE state.

If you already have something in the drawing area, clear it out by choosing New from the File menu. (Move the pointer onto the File menu label, press the left (Motif) or right (OPEN LOOK) mouse button, drag the pointer to the New item, and release the mouse button).

While following this tutorial, keep in mind that you can use the Undo (or Meta/U) key to undo changes.

Creating an Object

First, we'll create the "INITIAL" state object. Move the pointer over the small ellipse below the menu labels, and press the left button. Drag the pointer down into the drawing area - a temporary outline of the new object will follow. Keep dragging to the left center of the drawing area, and release the mouse button; the new ellipse will be drawn there.

        

Robochart numbered the object for you. For this chart, turn numbering off as follows: Activate the Options (or Properties) menu and choose the Program... item. This displays the Program Options window. Click on the Numbering: Off setting, then click on the Apply button to apply the change.

Now move the pointer inside the ellipse - notice it changes shape to an arrow connected to an "O", indicating that it is over an object and you can enter label text. Type the word "INITIAL" on the keyboard. If you make a mistake, use the Backspace key to erase the previous character, or Control/U to erase the entire label. Notice that the text is automatically centered in the object.

To create additional objects of the same type, try this alternative: Move the pointer over the first object (but not its label), hold down the Control key (Duplicate modifier), then press the left button. When you drag the pointer, a new object appears. Continue to drag this object to the desired location and release the mouse button.

Create the remaining state objects and add labels until you have something that looks like this:

Editing Objects

Now practice changing the position of an object. Move the pointer over the outline of the DONE object (but not over its label), press the left button, drag the object to the desired position, and release the mouse button.

Here's how to delete an object altogether. Create an extra object on your diagram and move the pointer inside it. Press the right button, and choose the Delete item from the pop-up menu that appears.

Creating a Flow

Now for the transition flows between the states. Move the pointer inside the state labeled "INITIAL". Since Robochart automatically positions flows, you don't need to point to an edge of the object. The pointer should change to the "O" shape. Press the middle button, drag the pointer into the state labeled "VERB", and release the mouse button. An arrow will be drawn between these objects, pointing in the same direction that the mouse was moved. Adding a label to the transition is simple: move the pointer anywhere along the line - it will change shape to an arrow connected to an "F" (for flow). Type the word "verb" on the keyboard. As with objects, the label is automatically centered. The same editing keys can also be used.

Looped Flows

The transition from the "VERB + ADJ" state back to "VERB + ADJ" has to be created a bit differently. Since Robochart normally draws flows as a straight line between two objects, this flow would not be visible if created the usual way. (Robochart will complain if you try.) For a looped flow, additional vertices (fixed points) must be added while the flow is being created. Move the pointer into the object labeled "VERB + ADJ", and press the middle button as before. Drag the pointer outside the object, and without releasing the mouse button, press the Space bar on the keyboard. Still holding the middle button down, drag the pointer to another point outside the object, and again press the Space bar. Finally, drag the pointer back to the "VERB + ADJ" object and release the mouse button to finish the loop. If you make a mistake, move the pointer over the flow, press the right button, and choose Delete Flow from the pop-up menu. Or, just press the Undo key (or Meta-U, or choose Undo from the Edit menu).

Flows that have vertices can be drawn as either straight line segments or a smooth curved line. Use the Curved or Straight item in the flow's pop-up menu to change this.

Editing Flows

Now add the remaining transition flows as shown above. If you don't add any vertices while creating the transition from "VERB + ADJ" to "ERROR", the line will cross over other lines. To fix this, move the pointer to a point along the line and press the left button. This creates a new vertex. Drag this vertex beyond the "DONE" state and release the mouse button. Create a second vertex the same way. Then, try dragging an existing vertex to a new position, also using the left button.

Flow endpoints can be moved the same way. For example, place the pointer on the flow labeled "verb" near (but outside) the "VERB" state object ("F" pointer), and press the left button. Drag the flow inside the "DONE" object and release the mouse button.

Finally, try reversing the direction of the "adjective" flow by choosing the Reverse item in the flow's pop-up menu.

Mouse Button Summary

The different mouse commands may seem complicated at first, but you'll learn them quickly. Just remember: Experiment with these operations to see how easily you can modify a diagram with Robochart. Notice that you can freely rearrange objects without having to manually adjust the text or flows connected to them. Many diagram editing operations can be accomplished in more than one way; other methods and shortcuts will be described later in this manual.

Saving

Now is a good time to save your diagram. Choose Save As... from the File menu (Save is disabled since we haven't provided a filename yet). Enter the name "example" in the File: text field of the Save window that appears, and click on the Save button. If you're not ready to continue the tutorial right now, you may want to close the Robochart window to an icon (click with the pointer over the smaller square near the upper right corner (Motif) or the window button in the upper left corner (OPEN LOOK). You can also exit Robochart from the File menu.

Example 2: Flow Chart

For our second example, we'll create a flow chart describing an algorithm to find the average of a list of non-negative numbers. In a flow chart, boxes represent simple steps that make up a more complicated procedure, while arrows show the sequence in which the steps must be performed. Diamonds indicate decision points, where conditions determine which path the execution of the algorithm should take.

If you've restarted Robochart since creating the first example diagram, load it back into memory first by choosing Open Diagram... from the File menu. This displays the Open window, which includes a list of files in the current directory. Find the proper filename ("example") in the Files list that appears (you may need to scroll the list), then click on the name to highlight it. Then, click on the Open button to load the file. Also, make sure that Numbering is turned off (in the Program Options window).

Move to a fresh page by choosing the Page submenu from the View menu, and choosing Next in the Page submenu. Here's the flow chart:

Create the "START" step in the same way that the objects were created in the previous example, dragging the desired shape from the control area into the drawing area. Move the pointer into the ellipse and type the word "START".

For the next step of the flowchart, choose the box shape instead. Add the label text as before, pressing the Return key to start the second line.

Create the arrows between these steps as described previously, pressing the left button with the pointer inside the first object, and dragging the arrow into the second object. The third step in the flowchart can be created by duplicating the previous object (hold down the Control key and drag with the left button). Now create the remaining objects and flows, selecting the diamond for the decision steps, and adding vertices to the two flows with angles in them.

Selections

Although you can move objects and flows directly by dragging them, and modify them by displaying popup menus, other editing functions are performed by first selecting one or more objects or flows. To select an object, left-click with the pointer inside the object (but not over the label). To select a flow, left click with the pointer over any part of the flow line (but not the label). A selected object or flow is drawn with grab handles (small squares) on the object's border, or at each endpoint and vertex of the flow. To deselect an object or flow, left-click over background (or select a different object or flow).

Resizing Objects

Some of the labels don't fit inside their objects, so you'll want to resize those objects. Move the pointer inside the "SUM = SUM + VALUE..." object (but not over the label) and left-click to select it. You can now resize the object by dragging any of the grab handles with the left button. If you drag a corner handle, you can adjust the size in both directions; if you drag a side handle, only one direction is adjusted. Resizing an object also changes the default size for new objects of that type.

You will probably find it easiest to "rough out" your diagram first, creating the desired objects and connecting them together, before going back and "cleaning up" the diagram by moving objects around, adding vertices to flows, and adjusting object sizes.

Moving a Group of Objects

Now try moving a group of objects at once. To do this, you need to select multiple objects. Left-clicking with the Shift or Control key down toggles the selection of the object at the pointer (alternating between selected and not selected), without removing other selections. (For OPEN LOOK, just click the middle button.) Select the bottom three objects now. When you move a selected object (by dragging it with the left button), all selected objects (and vertices of selected flows) move together.

Adding a Title

Finally, the diagram title can be added by creating an extra box object and entering the title text as its label. Set the box's border type to "None" from its pop-up menu. "Invisible" objects like this are handy for "floating" text or lines. You might prefer to use special "phantom" objects, described in Section 4, for this purpose.

Save the example diagram document to disk by choosing Save from the File menu (this saves the diagram to the current filename, as shown at the top of the base window).

Example 3: Dataflow Diagram

For the final example, we'll create a dataflow diagram with multiple hierarchical levels, outlining a computer animation system. In a dataflow diagram, ellipses represent functions or processes, and arrows indicate the flow of data between them. Processing sequence is not shown. External devices are drawn as closed boxes, and files or databases are shown as open boxes or parallel lines.

Here is the top level of the diagram. Objects marked with an asterisk (*) are processes with detailed levels defined. These levels are linked diagrams that show details internal to the higher-level process.

Choose Next from the Page submenu of the View menu to move to a new page. Display the Program Options window (by choosing Program... from the Options menu), and turn off the snap grid by setting the grid size to 1. Set the Numbering setting to Specified, set Auto-link to Full, and click on the Apply button.

Create the first two objects ("Build Models", an ellipse, and "Models", an open box), and their labels, as in the previous examples. (If the object is invisible, because your last object had its border type set to "None", use the pop-up menu to set an appropriate border type for the new object.) Select the objects and adjust their size to suit the diagram - this also sets the default size for the remaining objects.

Changing Flow Type

The flow between them needs an arrow at both ends. Before creating this flow, click on the third flow button in the bottom row of the control area - this changes the "current" flow type setting, as shown in the top row.

Now create the rest of the objects and flows for the top level. Try changing the current flow type directly from its menu buttons in the top row of the control area. You can also change a flow you've already drawn: move the pointer over the flow near one end, press the right button, highlight the End Type submenu item in the pop-up menu, and choose a new end type. This automatically updates the current flow type, too.

The numbers assigned to objects in your diagram may differ from the example pictures, depending on the order in which you created the objects.

Zooming In

Now, we'll expand the first process, "Build Models", into its own diagram. Move the pointer over this object, press the right button, and select the Zoom In item from the pop-up menu. Robochart initializes this level for you, copying the flows and objects that were connected directly to the expanded process. It also creates a temporary object (numbered 1.1) as an endpoint for the copied flows. In this case, one object (the "Models" database) and one flow are copied. On the right is what we want the expanded level to look like.

        

Create a second ellipse, which Robochart numbers 1.2, and add the "Model Defn File" database (open box) and "Display" device (box) objects. The two-way flow to the "Models" object that was copied from the upper level belongs to the process numbered 1.2. Drag the flow end near the 1.1 object with the left button, and connect it to the 1.2 object instead. You can move objects around to neaten up the diagram by dragging them with the left button. Finish up by adding the remaining flows as shown.

Linked Objects

The "Models" database object in this diagram is linked to the same object in the top level diagram. To see this, move the pointer over the object, press Control/U to delete the old label, and enter a new label "3D Models". Now choose Zoom Out from the View menu to return to the top level. Notice that the label change is carried back to this level automatically. Also note that the "Build Models" object is now marked with an asterisk to indicate that it has an expanded level defined.

Now, zoom in on the "Render Frame" process, but try using this shortcut instead of the pop-up menu: move the pointer over the object (but not over its label), and double-click (press, release, press, and release) the left mouse button. Modify the initial level that's created until you have this diagram. The flows connected to the temporary object need to be moved to several different objects in this case.

Zoom in one more time on the "Compute Shading and Visibility" process (4.3 in the example). The new diagram has some higher-level processes (4.2 and 4.4) appearing in it. Add objects 4.3.2 through 4.3.4, and move and create flows to build this detailed diagram level:

Experiment with the Zoom commands to scan through this multilevel diagram, noting the level display in the message area. Also, experiment with changes to one level, and see how they affect other levels of the diagram. For example, change an object's position and size, and add vertices to a flow. These changes are not carried to other levels. On the other hand, if you change an object or flow's label, or the type or direction of a flow, the changes are made to all linked copies of the object and flow. You're probably anxious to start on your own diagrams by now, but first, save the final example document.

Print and Exit

If you'd like to print your sample diagrams, choose Print/Export... from the File menu to display the Print window. Choose the All Pages and PostScript settings on this window, and make sure the correct name for your PostScript printer is entered in the Printer name text field. Click on the Print button to print the diagram pages. (The current numbering option is used for all printed pages - normally you wouldn't have different types of diagrams in the same document. If you want to print the first two example pages without object numbers, turn off numbering from the Program Options window, then enter the page range 1 though 2 in the Print window.)

To output a diagram as an image file for use on a web page, choose the Image format, output To File, and use a filename with an extension of ".gif". The message area shows the full pathname of the output file.

To exit from Robochart, choose Exit from the File menu.

Learning about Diagrams

For further reading on dataflow diagrams, flow charts, and other diagramming methods, check the computer science section of your library or bookstore.

On-Line Tutorial and Help

There are many features in Robochart not covered by this brief introduction. They are described in the following sections. You can also learn about Robochart by loading the Tutorial.cht diagram file provided with the program, and browsing through the levels of this diagram.

You can also point to a control or menu item and press the Help or F1 key to get help. The shell command rchelp describes these and other ways to get help with Robochart.


Contents Next Index