Show in Frame No Frame
Up Previous Next Title Page Index Contents Search

Opening diagrams with a Diagram Editor
Creating diagrams
Managing diagrams
Import and auto-layout of existing graph elements
Info for graph and elements
Printing a diagram
Exporting diagrams
Generating code and documentation
Closing a Diagram Editor

4.1.1 Diagrams

Opening diagrams with a Diagram Editor

To open a Diagram Editor:
1)Choose Edit | Diagram Editor... in the Launcher.

Selecting graph to open as diagram

Figure 4–4. Selecting a graph to open.

2)Select a graph from the dialog (e.g. ‘Stopwatch’) that will appear (Figure 4–4), and click the OK button.
3)Select the desired diagram representation from the dialog that appears, and click OK (Figure 4–5). If you want to make a new representation select ‘Create new Diagram’ (the last item in the list). This selection opens the selected graph but allows you to make a different representation version of it. Thus, you can have a different layout and subset of the contents of the graph.

Selecting diagram to open

Figure 4–5. Selecting a diagram to open.

->The dialog for representation selection does not necessarily appear. It depends on the representations available and the current dialog options (see Section 3.1.3 Options Tool).
->By keeping shift pressed during the open operation, you can open the graph without locking it. This is especially useful in a multi-user environment when you just want to view the graph and allow another user to change it at the same time.
->By default, diagram representations of graphs that are larger than the current screen are zoomed to fit when opened. This can be changed from system options to open such diagrams at 100% zoom (see Section 3.1.3 Options Tool).

There are also many other ways to open a diagram, e.g. double-clicking a graph in a browser (or pressing Ctrl+D when one is selected), selecting Graph | View | Open as Diagram... in another editor, or selecting an object in another editor and choosing to open its Explosions... or Decompositions... from its pop-up menu.

Creating diagrams

To create a new diagram:
1)Choose Edit | Diagram Editor... in the Launcher.
2)Select the last item ‘Create new graph’ from the dialog that opens (see Figure 4–4), and click OK.
3)As a result a ‘Create Graph’ dialog will open, prompting you to select the graph type for the new graph and the representation it will open as (abstract graph types that cannot be instantiated are shown in italic). Choose the desired graph type from the list and then check the appropriate radio button to select the representation to create (Diagram is selected as default as in Figure 4–6) and click OK.
4)A new graph is created and you are prompted for its properties, e.g. its name: fill them in and click OK.

Selecting graph type to create

Figure 4–6. Selecting a graph type to create.

As a result, you should now have an empty Diagram Editor open on a new graph of the selected language.

Managing diagrams

As in all editors in MetaEdit+, the Graph menu allows users to create, open and edit graphs. For example, the same function that was previously used to open a diagram can be accessed from Graph | Open... as well. Similarly, a new diagram can be created by selecting Graph | New... and following the instructions above.

To edit the properties of the graph itself select Graph | Properties..., and a property dialog for the graph will appear. In the dialog, the properties of the graph can be edited and modifications accepted by clicking OK. See Section 3.3.1 for more information on property dialogs.

The Graph menu also includes functions to view a diagram in other representations (i.e. as a matrix or as a table) or to browse the diagram in a Graph Browser. Basically, the Graph | View functions open this graph in the tool chosen. The other editors, Matrix Editor and Table Editor, are described in later sections.

You can also open the Info Tool for the graph by selecting Graph | Graph Info... (see Section 3.3.3).

Import and auto-layout of existing graph elements

The Diagram Editor also allows you to update a diagram representation of a graph with information that has been added in another representation of the same graph.

To update a diagram with changes made to the same graph with another tool select Graph | Import Graph. This function automatically fetches and adds all representations of new objects and their relationships to the Diagram Editor so that the user can arrange and edit them. This function is called automatically when opening a new diagram on an existing graph.

Plain importing of graph provides only a basic grid layout for new elements, obeying Snap to Grid if set. To perform more detailed automatic layout, select Graph | Layout.... This will open the Layout Options tool (Figure 4–7) for configuring the layout parameters.

Layout Options

Figure 4–7. Layout Options.

The auto-layout is carried out with the combination of two layout algorithms. The first one, a version of Sugiyama algorithm for directed acyclic graphs, organizes the diagram elements in hierarchical fashion, while the other, a simulated annealing algorithm, takes care of the elements left untouched by the first algorithm. The latter algorithm just aims to reduce the length of relationships between objects, while preventing objects appearing on top of one another, and therefore does not require parameterization. The first one, on the other hand, is more complex and provides the following parameterization options:
*Tree filters are used to define the role-relationship-role combinations that form directed acyclic graphs (DAG) for Sugiyama algorithm. These filters serve two purposes. First, as the diagrams often contain cyclic structures, the information from the user is needed for sensible creation of DAGs out of them. Second, filters enable the user to define which relationship and role types to use as basis for the hierarchy. Please note that the role order in filter defines the direction of relationship (the first role being initial one) and that this directivity is also used when creating the DAG. To reverse the directivity for the selected filters, press the Invert Roles for Selections button.
*Tree distribution defines in which direction, vertical (Figure 4–8) or horizontal (Figure 4–9), the layout hierarchy is drawn.
*Manhattan layout check-box sets the way how the relationships are drawn. When checked, the relationships appear as network of orthogonal lines with perpendicular angles (Figure 4–8). Otherwise the relationships are presented with plain straight lines (Figure 4–9).

Vertical manhattan layout

Figure 4–8. Vertically distributed Manhattan diagram.

Horizontal nonmanhattan layout

Figure 4–9. Horizontally distributed non-Manhattan diagram.

As mentioned above, the Sugiyama algorithm requires an acyclic graph. The problem of cyclic design structures is partially solved by setting the tree filters before the layout but even then there are sometimes cyclic structures output for the layout algorithm. In these cases, a dialog similar to the one in Figure 4–10 shows the cyclic paths in the graph and prompts for user intervention. Selecting a cyclic path from the list will highlight it on the Diagram Editor (as in Figure 4–10). The Cyclic Path dialog also provides possibility to cut the cycles to make the graph as an acyclic tree for which the Sugiyama algorithm will be applied. To do this, press the Loose Tree button. If you want to continue without forming the tree, press the No Tree button – this will bypass the Sugiyama algorithm and apply the simulated annealing algorithm only. If you do not want to apply any layout, press the Cancel button.

Cyclic Paths dialog

Figure 4–10. Inspecting cyclic paths before the layout.

Info for graph and elements

Info Tool for graph can be accessed by selecting Graph | Graph Info.... Info for selected diagram element can be opened by selecting Edit | Info....

Printing a diagram

To print the diagram select Graph | Print.... You are first asked for the printer, then for the scale of the printout or how many pages you want to print over. By default, printing is of the whole used area of the diagram at a single page. Printing is described in more detail in Section 5.1.

Exporting diagrams

Diagrams can be exported in several formats:

Graph | Export to | Clipboard as Bitmap lets you select an area of the visible diagram and export it as a bitmap to the system Clipboard. The exporting function asks you to frame the area to export by clicking at its top left corner and dragging to its bottom right corner.

Graph | Export to | GIF file... exports the whole diagram with the current zoom factor into a GIF file.

Similarly to GIF export, Graph | Export to | PNG file... exports the whole diagram as a PNG file.

Graph | Export to | PICT file... exports the whole diagram at 100% zoom into a PICT vector graphics .pct file. PICT files can be imported and edited as vector graphics by most word processing, desktop publishing and graphics software. If your software appears not to recognize PICT files, check whether support for them is an optional part of the installation of that software.
->In all graphical exporting formats, the current view filtering (View | Selected...) settings in the Diagram Editor will be applied to the exported diagram.

Graph | Export to | MetaEdit+ Patch File... exports the diagram as a binary patch file (.mec) for importing to another MetaEdit+ repository.

Graph | Export to | MetaEdit+ XML Models File... exports the diagram as an XML file (.mxm). These XML files provide the most flexible data exchange format between MetaEdit+ and other tools. They can be also used for transferring design data between MetaEdit+ repositories.
->For more information about design data export and import, see Section 5.3.

Generating code and documentation

To generate code or documentation:
1)Select Graph | Generate... or press the Generate button on the Diagram Editor toolbar (or press Ctrl-R).
2)Select a generator from the list dialog. Note that the generators are listed indented under the graph types that define them: choosing a graph type instead of a generator will have no effect. Figure 4–11 shows an example of a dialog list for choosing a generator.

Choosing report to run

Figure 4–11. Choosing a generator to run.

After you have selected a generator, the tool runs it and opens a window showing the generator output, or a list of the file(s) to which generator output has been sent.

Sometimes it is also possible to run a specifically predefined generator directly from the toolbar by pressing the respective generator button.

Closing a Diagram Editor

To exit the Diagram Editor select Graph | Exit or use some other platform dependent closing mechanism: e.g. on Windows, click the X in the top-right corner of the window.

Show in Frame No Frame
Up Previous Next Title Page Index Contents Search