Chapter
1 |
Diagram
basics |
|
CHAPTER
CONTENTS
|
Diagrams and the
system model
Diagrams are the visual blueprints for software systems. Together
is a tool for modeling such systems and implementing them in any of several
supported programming languages. It is unique in its capabilities for synchronizing
a system's visual representation with the source code that implements it.
Together supports the following basic UML-defined diagram types:
|
Class diagram |
|
Use Case diagram |
|
Sequence diagram |
|
Collaboration diagram |
|
State diagram |
In addition to UML diagrams, the Coad notation is also supported in the
form of switchable options:
|
Coad Class diagram |
(A view of Class diagram) |
|
Coad Scenario |
(A view of Sequence diagram) |
This chapter presents an overview of the basics for creating and working
with diagrams using Together's visual modeling tools. The topics
covered here apply generally to all the supported diagram types. Subsequent
chapters each cover issues related to a specific type of diagram.
Creating
diagrams
Constructing
diagrams visually
When you create a new diagram, the Diagram pane presents an empty diagram
background. You must place icons for Nodes, Notes, etc. on
the background and draw Links between them in accordance with the requirements
of your system model. The main tools you use in constructing diagrams are:
|
Diagram
Toolbars |
Place icons for Nodes and Links on the diagram background. (See Creating
Nodes and Creating Links in this section). |
|
Diagram
context menu |
Show hidden objects, manage the layout, control Zoom, configure diagram
Options, update diagrams and hyperlinks |
|
Icon context menus |
The context
menus of the various node and link icons provide functions specific
to the icon such as adding and deleting members (or the icon itself), cut-copy-paste,
quick hiding and sizing, link routing, browse, and more.
These menus are documented in: User Reference:
Context menus. |
|
Inspector tabs |
Edit properties,
create hyperlinks
to diagrams and files, edit project and source code comments. |
Related information: Getting
Started Chapter 3
Creating Nodes
Node refers to a package, class, interface, state, use case, etc.
The Toolbar for the current diagram presents the nodes available for the
diagram type. For information about diagram Toolbars, see User
Reference: Toolbars.
To create a node in the diagram:
-
Click the toolbar button for the node you want (the button remains depressed)
-
Click the desired location in the Diagram pane. The new node icon is placed
on the diagram at the point you click.
Creating members
Where nodes can contain members, you can create these using commands on
the node icon's context menu. For example, the Class node icon's context
menu has New Attribute and New Operation commands that visually create
these members in the node (and add declarations to source code).
Creating
links
Link refers to an association, aggregation,
dependency, message, etc. The Toolbar for the current diagram presents
the links available for the diagram type. For information about diagram
Toolbars, see User Reference: Toolbars.
To create links between nodes:
-
Click on a link icon on the Toolbar
-
Click on the first node in the linkage (link source)
-
Drag the link to the second node in the linkage (link destination) and
drop it there.
If the second node is not easily accessible, drop on the diagram background
to display the Choose Link Destination dialog. This dialog lists
all the nodes on the diagram. Choose one of these to make it the link destination,
and click OK to create the link.
Some links are valid only between specific types of nodes. For details
see User Reference: Links.
Annotating diagrams
All the diagram Toolbars have Note and Note link buttons that place Note
and Note Link icons on the diagram. The Note icon can be used to create
free floating notes, or Note Link can be used in conjunction to link notes
to other nodes in the diagram. Notes are automatically included when you
generate or print system documentation. The text
of notes linked to Class diagram elements does not appear in source code.
Use the Doc tab
of the Inspector to enter source code comments, or enter them directly
through the Text
pane.
Tips
for diagram construction
Managing
diagram layout
Together makes it easy to manage simple or complex diagrams with automated
layout features that optimize the diagram layout for viewing or printing.
You can also create your own diagram layout.
Using
the automated layout features
The Diagram (background) context menu provides access to the automated
layout optimization features with the following commands:
|
Layout All positions all diagram elements automatically according
to the Layout options settings. |
|
Layout All for Printing positions nodes within page borders.
Use Print options to display the
print grid. |
|
Layout Selected, Layout Selected for Printing repositions only
selected nodes. |
Creating
your own layout
You can create your own layout by selecting and moving single or multiple
diagram elements. You can...
-
Select a single node and drag it to a new position
-
Select multiple nodes and drag them as a group to a new position.
You can select multiple nodes in either of two ways:
-
Select individual nodes by holding down <Ctrl> and clicking on each
node (use this method for non-contiguous nodes)
Click on the diagram background and drag the dotted selection rectangle
around multiple nodes and drag any one of the nodes in the selected group
to move all of the selected nodes.
Resizing
node icons
Drag the lower corner of a node icon to the desired size. Choose
Actual Size from the icon's context menu to restore the original size.
Manually resized node icons return to the automatically optimized size
when their contents change, e.g. when members are added or deleted.
Changing
a link's routing
You can alter the routing of a link's line by selecting the link icon,
and dragging any point on it in any direction. To remove bending points
created this way, select Route Links from the context menu of either
connected node icon.
Changing link destination
To change the destination node of a link:
-
Select the link
-
Drag the destination end point of the link to the new destination node.
Alternatively, drop the end point to the diagram background and select
the target from the Choose Link Destination dialog (see Creating
Links).
In the same ways you can change the source node of a link.
The dialog appearing in such a case has the title Change Link Source.
Common diagram operations
Whenever you make changes to diagrams you can save the changes using
the File menu commands:
-
Save - saves the current diagram
-
Save All - saves all opened diagrams
Saving a diagram automatically saves a Metafile (with the extension
.wmf), containing a graphical snapshot of the diagram, in the same folder.
Printing
diagrams
Before printing you may want to configure global or local print options.
To configure global printing options:
-
From the main menu bar, choose Edit | Global Options to display the Together
Options dialog.
-
Select the Print tab and configure settings as desired.
To configure printing options for the current diagram:
-
Choose Diagram Options from the Diagram context to display the Diagram
Options dialog.
-
Select the Print tab and configure settings as desired.
To print the current diagram: choose File | Print... to
display the standard operating system print dialog.
To print all diagrams in the project: see Printing System Documentation
below.
See Getting
Started, Chapter 5, Options Dialog Box for information about configuring
options. For reference information on the Print tab, see Diagram
Options - Print tab
TIP |
If you are running Together under Windows, set your printer's
True Type Fonts property to Print As Graphics in Font tab of the
Windows Printers dialog before printing diagrams. |
Printing
system documentation
You can generate and print documentation for the current diagram or for
all diagrams in the current Project. You can direct output to your printer,
or specify one or more HTML files to contain the generated documentation.
You can print/generate only text (i.e., system specifications), or both
text and graphics. In the latter case, diagrams are written out to .gif
files hyperlinked from the HTML files.
To generate and/or print system documentation:
-
Choose Tools | Generate Documentation.
-
Set up print or file options as described in the Generate
Documentation dialog topic.
-
Click OK to print documentation or generate files (depending on your choices
in step 2).
When you open
a project, the top-level diagram for Project package displays automatically
in the Diagram pane of the Object
Model Browser.
To open other existing diagrams, select the diagram's
icon/filename in the Navigation pane
and choose Browse or Browse in New Window from the Diagram
icon's context menu. (These commands are also available on the
context menu of Package icons in a package or class diagram.)
You can view diagrams that are hyperlinked to
the current diagram (or a selected diagram element) by using the Hyperlink
To tab in the Inspector.
Select the diagram background or element and the go to the Hyperlink To
tab.
When a diagram becomes too large to view in the
Diagram pane, you can use the Overview tab on the Navigation pane to navigate
quickly around the diagram.
TIP |
Use the Find... dialog to search
for text within the diagram. Select the background and choose Edit | Find
from the Main menu. |
Configuring
diagram Options...
You can set a number of options that affect
the display and printing of diagrams, such as diagram notation, orientation,
etc.
To configure options for the current diagram:
-
Choose Diagram Options from the diagram context menu
-
Set options in the Diagram Options
dialog as desired.
To understand the impact of setting Diagram Options, see Getting
Started, Chapter 5. Configuring Options.
Chapter contents
Diagrams and
the System Model
Creating diagrams
"Top-level" diagram
Options for creating new
diagrams
Constructing diagrams
visually
Creating Nodes
Creating Members
Creating Links
Annotating Diagrams
Tips for diagram
construction
Managing diagram layouts
Using the automated
layout features
Creating your own
layout
Resizing Node icons
Changing Link routing
Changing Link destination
Common diagram operations
Saving diagrams
Printing diagrams
-
Printing system documentation
Viewing diagrams
Configuring diagram
options
This page is hosted by the Chair for Applied Software Engineering of the Technische Universität München.
Imprint (Impressum)