SDE for Eclipse UML CASE Tool Tutorial - Eclipse UML Tool Modeling Features

Chapter 3  Modeling Features

 

Beside the powerful code/model synchronization and round-trip code engineering functionalities, the VP-UML professional modeling features are provided in SDE:

          Printing and report generation allows you to distribute the UML design documentations either in paper form or electric form.

          Advanced diagramming features provides easy yet powerful diagram editing. You can make you diagrams look even fancier than before using the special color filling effect, line styles and fonts.

          Exporting of diagrams and OLE support to create documentations or presentations outside SDE.

 

 

In this chapter:

*      Printing

*      Report Generation

*      Diagramming Features



Printing

1.        Start Eclipse/IBM WSAD®, then select the File menu > Import... to import the sample project.

2.        Select Existing Project into Workspace, then click Next > to continue.

3.        Click Browse... to select the "SchoolForModeling" sample project folder, then click Finish to import the project.

4.        Select the Window menu > Open Perspective > Java to open the Java perspective.

5.        Right-click on the SchoolForModeling project node inside the Package Explorer and select Open UML Model from the popup menu to start SDE.

6.        Select the File menu > Print (UML) to print the SDE design documents.

7.        The Printing dialog box appears where you can configure the printing options and preview the printout before printing the diagrams.

8.        Expand the folder Use Case Diagram (1), select the checkbox "Use Case Diagram1" to include this diagram in the printout. You will see the print preview refreshes immediately after the selection.


9.        Expand the folder Class Diagram (1), select the checkbox "School Class Diagram". Scroll down and you will see this class diagram is now included.

10.     As the class diagram is too big to fit into one page. Let's try to setup the page so that the diagram will not break apart.

11.     Click on the Page Setup button on the toolbar.

12.     When the Page Setup dialog box appears, select A4 in Size and select the Landscape option. After that, click OK to continue.

13.     You will find that after the changes in page setup, the print preview has changed its orientation. However, the class diagram still cannot fit into one page. Now let's try adjusting the margins.


14.     Click once on a page in the print preview, the margins are shown. Move the mouse cursor over the outer top margin, click and drag upwards to decrease its margin size. Note that the setting of margins apply to all the pages in the printout.

15.     You will see that even the outer top margin size has decreased, the diagram will not expand. It is because we have to decrease the inner top margin size as well. The space between the outer top margin and the inner top margin is allocated for the header not the diagram, and the space between the outer bottom margin and the inner bottom margin is allocated for the footer.

16.     After you have decreased the inner top margin size, the diagram will expand to take up the remaining space.

17.     You may be tempted to adjust all the margins' sizes to their minimum. However, it would be quite troublesome and there is a smarter way to fit a big diagram into one or more pages.

18.     On the toolbar, select Pages from the Fit to drop down list.

19.     After that, you will see all the diagrams are now fit into one page (the default is fit to one page but you can select multiple pages like 2 x 2 pages, 4 x 5 pages). The diagram will expand/shrink to fit the available pages specified.

20.     Let's click on the Edit Header/Footer button to customize the header and footer.


21.     Click once on the text box of the Center Section of the header and type "School Modeling Report".

22.     Type "Page " (include the trailing space) in the Right Section of the footer.

23.     Click on the Insert Page Number button to insert a tag for the current page number.

24.     Type "of  " after the page number tag, then click on the Insert Number of Pages to insert a tag for the total number of pages.

25.     Click on the Close Edit Header/Footer button on the toolbar to finish editing the header and footer.


26.     Select Whole Page% from the Zoom drop down list so that we can see the header and footer more clearly.

27.     As a result of the adjustment of the top margins we have done previously, the header is not fully visible. Let's now drag the inner top margin downwards to make more room for the header.

28.     Now we have done with the print setup. You can now click on the Print button to print the pages.

29.     After that, click on the Close Print Preview button to close the Printing dialog box. Or you can just close this dialog box anytime without printing, the printing preferences will be remembered by the project so you do not have to configure again.

 

 

To see the interactive tutorial of this section, please click here.

 

Report Generation

HTML Report Generation

1.        Start Eclipse/IBM WSAD®, then select the File menu > Import... to import the sample project.

2.        Select Existing Project into Workspace, then click Next > to continue.

3.        Click Browse... to select the "SchoolForModeling" sample project folder, then click Finish to import the project.

4.        Select the Window menu > Open Perspective > Java to open the Java perspective.

5.        Right-click on the SchoolForModeling project node inside the Package Explorer and select Open UML Model from the popup menu to start SDE.

6.        Select the Modeling menu > Report > HTML....


7.        When the Generate HTML dialog box appears, select the project node SchoolForModeling in the Print Diagrams pane to select all the diagrams in the project.

8.        Enter "C:\ECProjects\SchoolReport\HTML" in File location.

9.        Deselect the Generate empty tree node option so that diagram type nodes that do not have a diagram will not appear in the report.

10.     Click on the Header/Footer page to select it. Select the Use header option to include header in the report.

11.     Enter "School Modeling Report" in Header text 1.


12.     Select Bold + Italic in Font style and select 20 in Font size.

13.     Click on the Generate button to generate the report.

14.     After the report generation finished, the default web browser is lauched for previewing the HTML report.

15.     Let's click on SequenceDiagram to see what's inside.

16.     All the sequence diagrams are listed in the tree menu, and the thumbnails of the diagrams are displayed in the content page.


17.     Let's scroll down the content page and click on view detail next to the Enroll into a course (elaborated) diagram to view its detail.

18.     In the detail view, the diagram is displayed in its original size.


19.     Scroll down and you will see the Diagram Content Summary which lists the diagram elements of the diagram, and the details of each diagram element are listed under the Diagram Content Detail heading.

 

To see the interactive tutorial of this section, please click here.

 

PDF Report Generation

1.        Start Eclipse/IBM WSAD®, then select the File menu > Import... to import the sample project.

2.        Select Existing Project into Workspace, then click Next > to continue.

3.        Click Browse... to select the "SchoolForModeling" sample project folder, then click Finish to import the project.

4.        Select the Window menu > Open Perspective > Java to open the Java perspective.

5.        Right-click on the SchoolForModeling project node inside the Package Explorer and select Open UML Model from the popup menu to start SDE.

6.        Select the Modeling menu > Report > PDF....


7.        When the Generate PDF dialog box appears, select the project node SchoolForModeling in the Print Diagrams pane to include all diagrams in the PDF report.

8.        Enter "C:\ECProjects\SchoolReport\PDF\SchoolReport.pdf" in File location.

9.        Click to select the Header/Footer page. Select the Use header option to include header in the report.

10.     Enter "School Modeling Report" in Header text 1.


11.     Select Bold + Italic in Font style and 20 in Font size.

12.     Click on the Generate button to generate the report.

13.     After the report is generated, the PDF report will be opened using the default PDF viewer of the system.


14.     The menu on the left side lists all the diagrams you have included in the report generation. Let's click on School Class Diagram to view its content.

15.     The "School Class Diagram" is displayed in the content page. Let's scroll down to see the details.

16.     All the diagram elements in the diagram are listed under Diagram Content Summary, and the details of each diagram element are displayed under Diagram Content Detail.

 

To see the interactive tutorial of this section, please click here.

 

Diagramming Features

General Diagramming Features

1.        Start Eclipse/IBM WSAD®, then select the File menu > Import... to import the sample project.

2.        Select Existing Project into Workspace, then click Next > to continue.

3.        Click Browse... to select the "SchoolForModeling" sample project folder, then click Finish to import the project.

4.        Select the Window menu > Open Perspective > Java to open the Java perspective.

5.        Right-click on the SchoolForModeling project node inside the Package Explorer and select Open UML Model from the popup menu to start SDE.

6.        One of the superior features of SDE is the "what-you-see-is-what-you-get" diagram editing, let's explore more.

7.        Activate the School Class Diagram, scroll down until you see the class "Teacher".

8.        Click on the class and try to drag it out of the "sch" package. You can feel that there is a resistance at the package boundary which prevents you from accidentally dragging the class out. Just drag further until the class is completely outside the package.

9.        Double-click on the class, you will see that the diagram is now in edit mode. Let's type "Instructor" to rename the class.

10.     Double-click on the "name" attribute, replace "-" with "#" to change its visibility to protected, and change its initial value to "unnamed". After that, press the Enter key to confirm.


11.     Activate the Property Pane and then click once on the empty space of the class diagram. Select 50% in the Zoom ratio property so that we can see the whole diagram.

12.     Double-click on the class "Instructor" and rename it back to "Teacher". Even the diagram is now zoomed out to very small and can hardly see the text, the editing mode displays the text in its actual size for easier inline editing.

13.     Click on the Zoom 100% button on the toolbar to reset the zoom factor.

14.     The resource-centric feature is another unique feature which makes it distinguishable from other modeling tools.

15.     Select the class "Teacher", the available resources are shown.

16.     Click once on the Hide Attributes button.

17.     The attributes apartment is suppressed.

18.     With the class "Teacher" still selected, click on the resource Generalization -> Class and drag to create a subclass "Professor".

 

To see the interactive tutorial of this section, please click here.

 

Advanced Diagramming Features

1.        Start Eclipse/IBM WSAD®, then select the File menu > Import... to import the sample project.

2.        Select Existing Project into Workspace, then click Next > to continue.

3.        Click Browse... to select the "SchoolForModeling" sample project folder, then click Finish to import the project.

4.        Select the Window menu > Open Perspective > Java to open the Java perspective.

5.        Right-click on the SchoolForModeling project node inside the Package Explorer and select Open UML Model from the popup menu to start SDE.

6.        Activate the diagram School Class Diagram.

7.        Right-click on the "sch" package and select Format > Transparent from the popup menu.

8.        The package is changed to transparent.


9.        Select the class "School" on the diagram. After that, activate the Property Pane and then click on the ... button next to the Fill property.

10.     When the Format Fill Color dialog box appears, select Gradient in Fill style.

11.     Adjust the Transparency to 50% and select Mint Blue in Gradient Color Themes. After that, click OK to contine.


12.     The class "School" now filled with the gradient color you specified, which looks a lot more fancier.

13.     With the class "School" still selected, click on the ... button next to the Line property.

14.     When the Format Line dialog box appears, select 2 in Style, 5 in Weight and 40% in Transparency. You will see that the changes to the settings are reflected in the Preview pane immediately. After that, click on the OK button to continue.

15.     The line format that you have specified is now applied to the class.

16.     With the class "School" still selected, click on the ... button next to the Font property.


17.     When the Select Font dialog box appears, select Times New Roman in Font Name, select Bold in Font Style and select 11 in Font Size. After that, click OK to continue.

18.     The selected font is applied to the class, which looks much more impressive.

19.     Move the "Student" association end between "School" and "Student" so that it is pointing to the "phone" attribute of the class "Student".

20.     Select the association, then click on the Pin resource which is near the "Student" side.

21.     Drag the class "School" down, you will find that the "Student" end of the association is pinned at the original position.

 

To see the interactive tutorial of this section, please click here.

 

Exporting Diagrams

1.        Start Eclipse/IBM WSAD®, then select the File menu > Import... to import the sample project.

2.        Select Existing Project into Workspace, then click Next > to continue.

3.        Click Browse... to select the "SchoolForModeling" sample project folder, then click Finish to import the project.

4.        Select the Window menu > Open Perspective > Java to open the Java perspective.

5.        Right-click on the SchoolForModeling project node inside the Package Explorer and select Open UML Model from the popup menu to start SDE.

6.        Activate the diagram School Class Diagram.

7.        Select the File menu > Export Diagram > Export Active Diagram as Image....

8.        When the Save dialog box appears, navigate to the folder where you want to save the diagram image, select PNG files (*.png) in Files of type drop down list and enter "SchoolClassDiagram" in File name. After that, click Save to confirm.


9.        The diagram will be exported to the location you specified in the selected image format.

10.     You can also export more than one diagram at once. Just select the File menu > Export Diagram > Export Diagram as Image....

11.     When the Diagram Exporter dialog box appears, enter "C:\ECProjects\ExportedDiagrams" in Output destination. After that, select the project node SchoolForModeling to export all diagrams in the project.


12.     Expand the node Sequence Diagram (4), click on the diagram Enroll into a course (elaborated), the preview of this diagram will be displayed in the Preview pane.

13.     In order to preview the output more clearly, select Real size in Preview mode.

14.     Click on the Export button to start exporting the diagrams. The diagrams will be exported to the location specified.

15.     Activate the diagram "School Class Diagram", select the class "School" and then click on the class "Department" while holding the Ctrl key to multiple-select them.


16.     Select the File menu > Export Diagram > Export Selected as Image....

17.     When the Save dialog box appears, select PNG files (*.png) in Files of type, enter "SchoolAndDepartment" in File name. After that, click Save to export the selection as image.


18.     You will see the image file is saved to the file path you specified.

 

To see the interactive tutorial of this section, please click here.

 

Copy and Paste

1.        Start Eclipse/IBM WSAD®, then select the File menu > Import... to import the sample project.

2.        Select Existing Project into Workspace, then click Next > to continue.

3.        Click Browse... to select the "SchoolForModeling" sample project folder, then click Finish to import the project.

4.        Select the Window menu > Open Perspective > Java to open the Java perspective.

5.        Right-click on the SchoolForModeling project node inside the Package Explorer and select Open UML Model from the popup menu to start SDE.

6.        Activate the diagram School Class Diagram. Select the class "Department", then click on the class "Course" while holding the Ctrl key to multiple-select them.

7.        Right-click on the selection and select Copy > Copy to System Clipboard as Image from the popup menu.


8.        Start Microsoft Word. Type "The relationship between Department and Course:", then press Enter to start a new line.

9.        Press the hot key Ctrl + V to paste the copied content.

10.     Press Enter twice and then type "The relationship between "School and Department:". After that, press Enter to start a new line.


11.     Switch back to SDE and multiple-select the class "School" and "Department". After that, right-click on the selection and select Copy > Copy to System Clipboard as OLE from the popup menu.

12.     Switch to the Word document and press the hot key Ctrl + V to paste the copied content.

13.     Double-click on the OLE object to start editing.


14.     Double-click on the "name" attribute of "School", change the "-" sign to "#" sign to change its visibility to protected, and change its initial value to "unnamed". After that, press the Enter key to confirm.

15.     Multiple-select "School" and "Department", right-click the selection and select Format > Fill from the popup menu.


16.     When the Format Fill Color dialog box appears, select Gradient in Fill style, select Golden in Gradient Color Themes and click OK to continue.

17.     The fill color is applied to the classes. Let's click anywhere outside the OLE editing area to stop the editing.

18.     The OLE object is modified after the editing.

19.     You can see it is much more convenient using OLE if you want to make change to the diagram content in a Word document at a later time. Without the help of OLE you will have to delete the old content, make change to the VP-UML diagram, copy the modified version and paste it again to the Word document.

 

To see the interactive tutorial of this section, please click here.

 

Patents pending. All rights reserved.