Editing Diagrams
Terminology
This section uses the following terms to refer to the different kinds of symbols that you can draw in a diagram:
- Nodes are symbols that can stand by themselves, such as classes, states, and notes.
- Connectors are symbols that must be attached to a node, such as associations, transition, and note connectors.
- Vertices are angles in connector lines.
Setting Diagram Options
How to set diagram options
ÿ To set diagram options, use the commands in the Options menu.
The UML suite immediately uses the updated settings in the current diagram. When you close the current diagram, the UML suite updates the M4 variables that store the option settings. It then uses the updated settings in any diagram that you open or reload.
Options menu
|
Command
|
Action
|
|
Redraw
|
Refresh the diagram, removing unwanted elements in the editing area, such as stray pixels left by other drawing tools.
|
|
Zoom Out
|
Reduce the size of the diagram making it possible to see more components.
|
|
Zoom In
|
Increase the size of the diagram making it easier to see individual components.
|
|
Grid
|
Set the grid size used to position diagram components. See Modifying Diagram Layout.
|
|
Font
|
Set the font used for diagram text. See Modifying Colors and Fonts.
|
|
Color
|
Set the colors used for diagram components. See Modifying Colors and Fonts.
|
|
Include Connectors in Selection
|
If clear (default), lasso select affects only nodes. If set, lasso select affect both nodes and connectors.
|
|
Pointer Focus
|
If clear (default), you move the editing focus to a diagram component by clicking on the component. This behavior is common on Windows systems.
If set, you move the editing focus to a diagram component by moving the pointer to the component. Clicking on the component is not necessary, but the pointer must remain on the component. This behavior is common on UNIX systems.
|
|
Sticky Mode
|
If set (default), when you select a symbol in the diagram control panel, it remains selected until you select another symbol. This allows you to add to the diagram multiple components of the selected type.
If clear, you select a symbol in the diagram control panel and add a component to the diagram. The UML suite automatically reselects the Select symbol in the control panel.
|
|
Syntax
|
Define the valid syntax for the names of the diagram components. See Specifying Label Syntax.
|
|
Initial Fold
|
If clear (default), new components are displayed unfolded. If set, when you add to the diagram a component that can be folded, it is initially folded.
|
|
Show...
|
Determines whether various property values are displayed in the diagram. See Showing Property Values.
|
|
UML Look/OMT Look
|
If UML Look is selected (default), diagram components are displayed using UML notation. If OMT Look is selected, diagram components are displayed using OMT notation.
|
Creating and Deleting Components
Background information
Naming conventions
You can specify the rules for component names, as described in Specifying Label Syntax.
Enlarging a diagram
After adding a number of nodes to a diagram, you might notice that you cannot add additional nodes at the edge of the diagram. To enlarge the working area of the diagram, select Edit | Center.
How to create a node
ÿ To create a node, such as a class, use case, or note:
- Click the appropriate symbol button in the control panel.
- Click in the diagram where you want to place the node.
Tip: If you create a node by mistake, right-click to remove it. (This action is the same as selecting Edit | Undo.)
- To enter additional nodes, repeat step 2.
- To exit Insert mode, click the Select button.
How to create a connector
A connector connects at least two nodes. Therefore, a diagram must include at least two nodes before you can create a connector.
ÿ To create a connector, such as an association, message, flow, or event:
- Click the appropriate symbol button in the control panel.
- Click the first node, and then the second node.
Note: If you click the first node, and then click in the background, the UML suite creates a vertex. You can create as many vertices as you want before clicking the second node to complete the connector. (If you create a vertex by mistake, right-click to remove it. This action is the same as selecting Edit | Undo.)
- To enter additional connectors, return to step 2.
- To exit Insert mode, click the Select button.
Complex connectors
Generalizations and n-ary associations connect more than two nodes. The description of these connectors in Chapter 4, Exploring Each Diagram, explains how to create them.
How to create a vertex
Adding vertices to connector lines allows you to change the routing of the line and improve the appearance of the diagram.
ÿ To create a vertex:
- Select the Vertex symbol from the control panel.
- Move the cursor over any point on a connector line.
- Drag the point to a new location.
- To exit Insert mode, click the Select button.
How to reuse class names
Classes are the fundamental element of UML. You use the same classes in many different diagrams as you describe different facets of your package. Utilities | Select Classname provides an easy way to add existing class names to your current diagram.
ÿ To reuse a class name:
- Click in the diagram at the location where you want to add the class name. For example, in an STD, create a class symbol and click inside it.
- Select Utilities | Select Classname.
- In the Select Classname window, select a class and then select Paste.
The UML suite pastes the class name into the current diagram at the
position of the I-bar pointer.
How to reuse operation and event names
Utilities | Select Operation/Event provides an easy way to add existing operation names to your current diagram.
ÿ To reuse an operation name:
- Click in the diagram at the location where you want to add the operation/event name. For example, in an STD, create a State with Internal Actions and click in the lower half of the symbol.
- Select Utilities | Select Operation/Event.
- In the Select Operation/Event window, select an operation and then select Paste.
The UML suite pastes the operation into the current diagram at the
position of the I-bar pointer.
How to delete a node, connector, or vertex
ÿ To delete a node, connector, or vertex:
- Select the object.
- Select Edit | Delete.
The UML suite removes the object from the diagram. It is not removed
from the database until you save the diagram.
Selecting Components
Purpose
To carry out certain actions on nodes, connectors, or vertices, you must select them first.
How to select a component
ÿ To select a component:
- If you are in Insert mode, click the Select Button.
- Click the component that you want to select.
How to select additional components
ÿ To select additional components:
- Press and hold the CTRL key.
- Click the components that you want to select.
How to use lasso select
ÿ To select multiple components, use lasso select:
- Press and hold the CTRL key.
- Drag the pointer over the components that you want to select.
The UML suite changes the selection status of the selected components:
selected components are deselected and deselected components are
selected.
Include connectors in selection
If you want lasso select to affect both nodes and connectors, select Options | Include Connectors in Selection. If this option is clear, lasso select affects only nodes.
Moving, Copying, and Replacing Components
Commands
The UML suite provides a number of commands for moving, copying, and replacing components.
|
Command
|
Description
|
|
Edit|Copy, Edit|Paste
|
Copy components to another diagram in the same package or phase.
Copy components to another diagram in another phase.
In Windows, copy components to an OLE-enabled tool, such as Microsoft Word.
|
|
Edit|Cut, Edit|Paste
|
Move components to another diagram in the same package or phase.
Move components to another diagram in another phase.
In Windows, move components to an OLE-enabled tool, such as Microsoft Word.
|
|
Edit|Duplicate
|
Copy nodes from the current diagram into the same diagram.
|
|
Edit|Replace
|
Replace one component with another in the current diagram.
|
How to use Copy, Cut, and Paste
You can use drag-and-drop or the Copy, Cut, and Paste commands on the Edit menu to copy or move diagram components. Before doing so, read Chapter 1, Copying, Moving, and Exporting in the UML suite in The UML Suite Project Management Guide.
How to use Duplicate
Duplicating a component creates a copy of the same component. If you edit the label of the second component, as described in Editing Labels, you create a new item in the repository. This is a convenient way to create new items that are similar to existing ones.
ÿ To duplicate diagram components:
- Select the nodes.
- Select Edit | Duplicate.
When you move the pointer back to the editing area, the nodes appear
under the pointer.
- Click in the diagram where you want to place the nodes.
How to use Replace
Replacing one component with another is a convenient alternative to deleting and reentering it. It is particularly useful when you need to change the multiplicity of an association or the type of a generalization.
ÿ To replace a component:
- Select the component that you want to replace. For example, select a mandatory-mandatory association.
Note: Only one object can be selected for replacement at a time.
- From the control panel, select the symbol that you want to use in place of that component. For example, in the control panel, select the Association symbol and the mandatory and optional multiplicity selectors.
- Select Edit | Replace.
The UML suite replaces the selected component with the new symbol. If
the attempted replacement conflicts with the diagram syntax, the UML
suite displays an error message and prevents the replacement.
Editing Labels
Definition
Labels are the names that you give to diagram components. Some labels appear inside the component they name, others appear near the component they name.
Editing a label creates a new item
Diagram components are usually associated with items in the repository. Editing the label of a diagram component creates a new item. To change the name of an item and its associated diagram component, use Edit | Change Name. See Renaming Items.
How to edit a label
ÿ To edit a label:
- Click the text of the label.
The Pointer changes to an I bar, indicating that you can begin editing. If
you are entering text in a node, such as a class or note, and the label
grows wider than the node, then the node expands to accommodate the
text.
- Edit the text using the following keys:
- Arrow keys to reposition the cursor within the text
- Delete to delete characters after the cursor
- Backspace to delete characters before the cursor
- Carriage return to create a multiline label
- Click in the background of the diagram to finish editing.
To copy and paste text
You can copy and paste text between labels and the text boxes of any open window.
ÿ To copy and paste text:
- Select the text that you want to copy.
- Select Edit | Copy (or Edit | Cut to delete the text).
- Click where you want to place the text.
The pointer changes to an I bar, indicating that you can begin editing.
- Select Edit | Paste.
UNIX
Alternatively, you can select the text that you want to copy, and then click the middle mouse button where you want to place the text.
Specifying Label Syntax
Purpose
You can specify a formal syntax for labels. Text is checked for this syntax as soon as it is entered and is refused if it does not meet the rules. If no syntax has been specified, any text is accepted.
Types of syntax
You specify the label syntax for each diagram.
|
Diagram
|
Symbol
|
Syntax
|
|
AD
|
Object in state
|
Class
|
|
|
Swimlane
|
Data
|
|
|
State
|
State
|
|
CD
|
Aggregation, association, class, composition, interface, n-ary association, package, qualified association, qualified aggregation, qualified composition, template class
|
Class
|
|
|
Actual type, generalization, qualifier, role name
|
Data
|
|
|
Propagation
|
Process
|
|
COD
|
Actor, n-ary link, link, aggregation link, composition, qualified link, qualified aggregation link, qualified composition link
|
Class
|
|
|
Role name
|
Data
|
|
CPD
|
Component, interface
|
Class
|
|
DPD
|
Component, interface, node
|
Class
|
|
|
Connection
|
Data
|
|
SD
|
Label syntax not available.
|
|
|
STD
|
Class
|
Class
|
|
|
State, state region, start state, superstate
|
State
|
|
UCD
|
Actor, use case
|
Class
|
|
|
Communication association
|
Process
|
OMT diagrams
See Appendix A, OMT Support, for more information about the OMT diagrams.
|
Diagram
|
Symbol
|
Syntax
|
|
CCD
|
Actor, class, container class, subject
|
Class
|
|
|
Communication message
|
Process
|
|
DFD
|
Actor
|
Class
|
|
|
Data flow, data store, update flow
|
Data
|
|
|
Process
|
Process
|
|
MGD
|
Message definition
|
Process
|
How to specify label syntax
ÿ To specify label syntax:
- Within a diagram, select Options | Syntax.
- In the Syntax dialog box, specify the syntax for each item type.
Modifying Diagram Layout
How to center a diagram
ÿ To center a diagram in the window, select Edit | Center.
Tip: Centering a diagram also increases the working area of the diagram. If you notice that you cannot add or position nodes at the edge of a diagram, center the diagram to increase its working area.
How to specify grid size
The UML suite diagram editors have an invisible grid that aligns objects. Symbols that you insert, copy or move, snap to this grid, ensuring horizontal and vertical alignment of symbols and producing a neat diagram.
ÿ To specify the grid size:
- Select Options | Grid.
- In the Grid dialog box, select a grid setting, and then click OK.
- Possible values range from 1 to 64. The larger the number the smaller the grid size, and the more precisely you can position objects. The default is 16.
How to move nodes
ÿ To move one or more nodes:
- Select the nodes.
- Select Edit | Move.
The center point of the selected nodes jumps to the pointer position. All
connectors attached to the nodes also move.
- Click where you want to place the nodes.
Windows alternative
Drag the node to the new position. You cannot use this method if more than one node is selected.
UNIX alternative
Drag the selected nodes to the new position.
How to move a connector
Sometimes you need to move the end of a connector from one symbol to another one.
ÿ To move a connector:
- In Select mode, click the connector at the end you want to move.
Selection handles appear at either end of the connector.
- Drag the connector to the desired position.
The end of the connector follows the pointer. You can release the left
mouse button while you drag the connector.
- Click the left mouse button in the new destination symbol.
The connector is reattached.
How to move a vertex
ÿ To move a vertex:
- Click the vertex.
Selection handles appear only around the vertex. Be sure to select the
vertex and not the entire connector.
- Drag the vertex to the desired position.
How to resize a node
A node can be enlarged or reduced, and, except for circles, its proportions changed.
ÿ To resize a node:
- Select the node.
- Place the pointer on one of the selection handles.
- Move the handle to change the size of the node.
Modifying Colors and Fonts
What you can change
In the UML suite, you can set
- The color for individual components in a diagram.
- The default color for each type of component. When you create a new component in any diagram, the UML suite colors it using the default colors for that component type.
- The colors for all components in all diagrams. When you change these colors, the UML suite updates the color of all components that are not colored individually or according to component type.
- The fonts for all components in all diagrams.
How to set color for individual components
ÿ To set the colors for individual components:
- Select one or more components in a diagram.
- Select one of these commands in the Edit | Color menu.
|
Command
|
Action
|
|
Line Color
|
Select the color for the symbol outline.
|
|
No Line Color
|
Set the color of the symbol outline to the diagram foreground color.
|
|
Fill Color
|
Select the color for the symbol background.
|
|
No Fill Color
|
Set the color of the symbol background to the window background color.
|
|
Font Color
|
Select the color for the symbol text.
|
|
No Font Color
|
Set the color of the symbol text to the diagram foreground color.
|
How to set default colors for component types
ÿ To set the default colors for a type of component:
- Select a component of that type.
- Set the colors for that component, as described in How to set color for individual components.
- Select Options | Color | Component Defaults.
- When you create components of this type in the current diagram, the UML suite uses the new default colors. When you close the current diagram, the UML suite updates the setting of the M4 variables that store the default colors. the UML suite then uses the new default colors for components of this type in all diagrams that you open or reload.
How to set colors for all components
ÿ To set the colors for all components in all diagram editors, select one of these commands in the Options | Color menu.
|
Command
|
Action
|
|
Foreground
|
Select the color for the symbol outlines.
|
|
Background
|
Select the color for the window background.
|
|
Selection
|
Select the color for the selection handles and text of selected components.
|
The UML suite updates the current diagram. When you close the current diagram, the UML suite updates the setting of the M4 variables that store the colors. The UML suite then uses the new colors for all diagrams that you open or reload.
Note: The colors you select using this procedure do not affect components
that are colored individually or according to component type.
How to set diagram fonts
ÿ To set the font used in the diagram editors, select one of these commands in the Options | Font menu.
|
Command
|
Action
|
|
Bold
|
Select the font used for state and object names in ADs, class names in CDs, actor, instance, and object names in CODs, component, node, and object names in DPDs, initiator and object names in SDs, state and class names in STDs, and actor and use case names in UCDs.
Note: Bold also changes the font used for actors and data stores in DFDs. See Appendix A, OMT Support, for more information about DFDs.
|
|
Normal
|
Select the font used everywhere else, except in Notes.
|
|
Annotation
|
Select the font used for Notes. If not explicitly set, the font used is a smaller version of the Normal font.
|
The UML suite immediately updates the current diagram. When you close the current diagram, the UML suite updates the setting of the M4 variables that store the fonts. the UML suite then uses those fonts for all diagrams that you open or reload.
Available fonts
The available fonts and the font properties are determined by your windowing system (X-Windows or MS-Windows).
Undoing Diagram Edits
What you can undo
You can undo the most recent graphical diagram edit or revert to the last saved version of the diagram.
How to undo the most recent change
ÿ To undo the most recent change to the diagram, select Edit | Undo or select Undo from the diagram context menu.
How to revert to the last saved version
ÿ To revert to the last saved version of the diagram, select File | Reload.
The UML suite closes the current diagram and opens the last saved version of the diagram. Any work done since the last time you saved the diagram is lost.
|
Copyright © 2000, Telelogic AB. All rights
reserved.