Drawing a sequence diagram with keyboard
- Create an empty sequence diagram by selecting Diagram > New from the application toolbar. In the New Diagram window, select Sequence Diagram and click Next.
- Leave the diagram name unchanged and then click OK to create the diagram.
- Right-click on the background of the diagram and select Show Text Editor from the popup menu.
- Let's create an actor. Click the Create Actor button or pressing Alt+Shift+A shortcut.
- Now a new entry for the actor has been inserted. Let's name the actor as Inspector.
- Now let's try to create a lifeline by pressing the Create Lifeline button, or pressing Alt+Shift+L shortcut. Name the lifeline as InspectionList.
- The lifeline InspectionList should be a boundary object. Let's press the right arrow key to shift the focus from the name of the lifeline to the Plus sign next to Stereotypes box. Press Spacebar and now the Stereotypes dialog will be shown. Press the down arrow button to select boundary stereotype, then press the Enter key to commit. Now the InspectionList lifeline has been specified as boundary type.
Besides create a standard lifeline, you can also create boundary, control and entity lifelines with the shortcut keys.
Lifeline Toolbar button Shortcut Standard Lifeline Alt+Shift+L Boundary Lifeline Alt+Shift+B Control Lifeline Alt+Shift+C Entity Lifeline Alt+Shift+E
- Some properties of the lifeline such as Active, Stopped and Multi-object can be specified when you focus on the checkbox and press the spacebar key.
- Repeat the steps to create lifelines InspectionForm, SafetyInspectionController, SafetyInspection also another actor Inspector Assistant.
- Let's specfiy the base classifier of the SafetyInspection lifeline. Focus on the Base Classifier cell of in the SafetyInspection row, and then use the down arrow key to select the base class SafetyInspection.
- Once we finish create the lifelines, we can then start creating the messages. Switch to the Messages tab.
- Click the Create Message button, or press Alt+Shift+M to create a message.
- Name the message as select inspection.
- We can change the message to call type by select Call message in the Action Type combo box.
- And specify the message is Asynchronous or not from the checkbox.
Similar to the lifelines, you can create various kinds of messages via the toolbar buttons and shortcut keys.
Message Toolbar button Shortcut Standard Message Alt+Shift+M Duration Message Alt+Shift+D Creation Message Alt+Shift+C Self Message Alt+Shift+S Recursive Message Alt+Shift+R Found Message Alt+Shift+F Lost Message Alt+Shift+L Reentrant Message Alt+Shift+E
- Let's create a creation message between InspectionList and InspectionForm. Press Alt+Shift+C to create the creation message. Name the message as popup.
- Since a standard message has been created between Inspector and InspectionList, the creation message will be created with the next available lifeline, which is InspectionForm.
- To change the origin of the creation message to InspectionList, keep the focus From combo box on the creation message row in the table, and press the up/down arrow to select InspectionList lifeline.
- The specification dialog of the lifeline or message can be opened by pressing Alt+Shift+O, or pressing the Open Specification button.
- You can search for the lifelines or messages through the search box.