On this Page:
<MagicDraw installation folder>\samples\diagrams\User InterfaceModeling\UI Modeling Samples.mdzip.
Case Study 1 - Modeling user interface for the Report Wizard dialog
This case study provides step-by-step instructions for modeling the Report Wizard dialog. If you are already familiar with this case study, please review Case Study 2 - Slider Example, or Case Study 3 - User Interface Prototyping Example
Step #1. Create a new Project
- Choose New Project from the File menu.
- Name it Report Wizard.
Step #2. Create a new Diagram
- Click Create Diagram and select User Interface Diagram.
- Name the new diagram Report Wizard.
Step #3. Create Container components
- Click the Frame button under the Containers toolbar and drag-drop it on the diagram pane. A Frame component is created.
- Name the Frame component by doing one of the following:
- Click the Frame shape on the diagram pane and type Report Wizard
- Open the Frame's Specification window.
- Double-click the Frame shape on diagram pane.
- In the opened specification window, type Report Wizard in the Title field.
- Clear the check box properties Maximize and Minimize in the Frame's Specification window.
- Define an Icon for the Frame symbol:
- In the Frame's Specification window, select the Custom option in the Icon property. The Open dialog box opens.
- Open <MagicDraw installation>\plugins\com.nomagic.magicdraw.uimodeling. Select the nomagic.png image as the frame icon.
- Under the Containers toolbar, drag and drop two Group Box elements in the Frame symbol. Under the Other toolbar, drag and drop one Separator element in the Frame symbol.
- Place one Group Box into the other Group Box. Double-click on the larger Group Box and ensure Titled is set to true. In the Title field type Select Template.
- Open the specification window of the smaller Group Box and clear the check box property Titled.
- Arrange everything appropriately.
Report Wizard Frame with two Group Boxes and one Separator
Step #4. Create a Tree
- Create a new Tree component:
- Under the Other toolbar, drag and drop the Tree element onto the Select Template Group Box.
- Delete old nodes from the Tree component.
- Create new nodes in the Tree component.
- In the Containment tree, right-click on the Tree to invoke its shortcut menu and choose Create Element > Node.
- Create five new Nodes in this way and name them as shown below.
- Add Leaves to Nodes.
- You can add a Leaf by right-clicking on a Node in the containment tree and then choosing Create Element > Leaf.
- Add at least one Leaf to every Node to indicate that the nodes have internal elements.
The Report Wizard Window with Added Tree
Step #5. Add Buttons
- Create predefined text buttons.
- Under the Buttons toolbar, expand the OK Button group.
- Right-click the Back button to expand the text buttons group. Create Back, Next and Cancel buttons. Guide yourself according to the figure below.
- Create regular buttons.
- Under the Buttons toolbar, drag and drop the Button symbol onto the diagram pane inside the Frame, next to the Select Template Group Box.
- Select the created button in the diagram pane and type in New.
- Create the remaining buttons by repeating steps 2.a and 2.b. Refer to the figure below.
- Double-click on the other buttons to invoke their specification window, excluding the Next >, Cancel, New and Import buttons. Clear the check box Inactive to true.
- It should look like the figure shown below.
Sample of the Report Wizard window
Step #6. Using the Report Wizard window
This User Interface model could now be exported as an image. The steps to do this are as follows:
- Select Save As Image from the File menu.
- In the Save As Image dialog, select Active Diagram.
- In Image File define the location where the image should be placed.
- Select Joint Photographic Experts Group (.jpg) (or any format you would like) in Image Format and then click Save.
Case Study 2 - Slider Example
This case study contains step-by-step instructions for creating a User Interface model with Sliders. It also shows how to customize the symbol properties of User Interface components. However, it does not explain how to create a new project and a new diagram. Please refer to "Case Study 1 - Modeling user interface for the Report Wizard dialog" for those instructions. If you are already familiar with these case studies, please review Case Study 3 - User Interface Prototyping Example
Step #1 Create a Frame, Labels and Sliders
- Create a new Frame.
- Under the Containers toolbar, click the Frame button.
- Drop it on the diagram pane.
- Click on your newly created frame and title Symbol Properties Customization.
- Add a new Label to the Frame.
- Under the Tools toolbar, click the Label button. Place the label onto the frame.
- Click on the label until you can edit the name and type in Fill Color.
- Create the remaining two labels and name them Text Color and Font Name.
- Add Sliders to the Frame.
- Under the Other toolbar, click the Slider button. Place the slider onto the frame.
- Double-click on the Slider to invoke its specification window.
- In the opened window, set the Spacing property value to 50.
- Set the Knob Position property value to 0 in order to move the knob to the left position.
- In the Slider's specification window, select the Values property and click the + symbol to the right of the field. A Values dialog window opens. If there are values already defined in the window, click the - symbol to delete them.
- To add new values, click the + symbol to the right of the window and then type 0 Red. 0 Red must be written in a specific way. First, type in 0 and press Enter. Type Red on the next line. Rename the other two given values to 50 Blue and 100 White using the same procedure.
- Draw two more sliders and repeat steps 3a - 3f until your frame looks like the one shown in the figure below.
When setting the values of a slider it is important to note that there is no empty space between 0. For example, 0 represents a new line. When entering a value, it should look like this:
Symbol Properties Customization Frame with Added Labels and Sliders
Step #2 Add Text Fields
- Create Text Fields.
- Under the Text toolbar. click the Text Field button. Drop it onto the frame.
- Name the text field Red Background.
- Repeat the previous two steps for the remaining two text fields, as shown in the figure below.
Added Text Fields to the Frame
Step #3 Edit Symbol Properties for the Text Fields
- Edit Symbol Properties for the first text field.
- Select the first text field on the Frame shape.
- Right-click on it and select Symbol Properties from its shortcut menu.
- Check off the Use Fill Color property and change the Fill Color property value to red. Change the fill color by clicking the ... to the right of the field, and in the Color dialog, click RGB and type in FF0000 in the Color Code field.
- Edit Symbol Properties for the remaining fields.
- Follow steps 1a - 1b for the next steps.
- For the second text field, select yellow in Text Color.
- For the third one, select the font name Tahoma in Font, as shown in the figure below
Finalized Slider Example
Case Study 3 - User Interface Prototyping Example
This case study demonstrates how to connect several user interface models and create a browsable report. The models should represent a test application with a Login Dialog, a Test Browser and a test with several questions. Here are step-by-step instructions on how to add hyperlinks and create browsable reports. If you are already familiar with this case study, please review Case Study 2 - Slider Example, or Case Study 1 - Modeling user interface for the Report Wizard dialog
Step #1 Create first Model
Create a new Package for the model.
Create a model similar to the one shown below.
First Model of Prototyping Example - Login Dialog
Step #2 Create second Model
Create another new Package for this model.
Create a model similar to the one depicted below.
Second Model of Prototyping Example - Test Browser
Step #3 Create remaining Models
Create a separate Package for each model.
You can build models similar to the ones shown in the detailed samples mentioned in the beginning of this chapter, or create your own in a similar manner.
Step #4 Add Hyperlinks
Add a hyperlink.
Open the model with the Login Dialog.
Select the OK button.
Click on the smart manipulator Hyperlinks/Go To and select Add Hyperlink in the popup menu.
In the Edit Hyperlink dialog, select Element/Symbol and click the "..." button. Browse to the Package Test Browser, select the User Interface diagram in it and confirm two times with OK - a diagram symbol will appear next to the OK button. Double clicking on the OK button will lead to the other diagram.
Now connect all the buttons in the other diagrams with hyperlinks. The diagram symbol appears next to a component with a hyperlink.
Step #5 Create a browsable Report
Create a new report.
Select Report Wizard from the Tools menu.
Expand the Default Template in the tree and select Web Publisher 2.0.
Confirm three times by clicking Next until the dialog appears allowing you to add data to the report. Add all Packages that contain the created diagrams and click Next.
Give the Report file a name to the output file. Clear the check box Display in viewer after generating report.
Click Generate. The report is built and shown in your default browser.