MaintainJ  
Home Demos download.html Buy License User Guide Support Testimonials About Us
1. Introduction 2. Why MaintainJ? 3. Installation 4. UML Editor 5. Instrumentation 6. FAQ

4. MaintainJ UML Diagram Editor

MaintainJ UML Diagram Editor renders sequence and class diagrams from the call trace files. To view the UML diagrams, add the trace files to a project in the workspace and open.

All menu options in MaintainJ UML Diagram Editor are provided in context menus, which can be seen by right clicking anywhere in the diagram or Outline view. Depending on the selected figure, relevant menu options are shown. You can 'Undo' and 'Redo' most of the operations in the editor.

4.1 Sequence Diagram Features

All application object interactions for a use case are shown in this diagram.

  • Color Coded Calls: Calls are color coded using the same colors as in Eclipse. Public calls are shown in green, protected calls are shown in yellow and private calls are shown in red.
  • No Immediate Return Calls: Immediate return calls are deleted to avoid diagram clutter.
  • Collapse/Expand Calls: icon beside a call name indicates a collapsed call. icon beside a call name indicates an expanded call. Calls are collapsed initially to avoid clutter. Calls can be expanded and collapsed as you explore the diagram. Click on to expand a call and on to collapse a call.
  • Collapse All Calls: Collapses all calls in diagram.
  • Expand All Calls: Expands all calls in diagram.
  • Delete Duplicate Calls to a Method : There can be a method in a particular class that is called multiple times in the sequence diagram but adds little to our understanding. To remove all but the selected method call, select a call and choose Delete Duplicate Calls to this Method. This action removes all but the selected method call in the diagram. This can be used to remove all unnecessary get/set methods, repeating calls to boolean equals(Object obj) method, etc.
  • Delete All Duplicate Calls: Deletes all duplicate calls in the diagram. Use this feature to view a simplified diagram with all the methods and classes involved in the use case. This action leaves only one instance of each call in the diagram. This action should be used with discretion as this could cause some loss of useful information from the diagram.
  • Keyboard Navigation: Sequence diagram can be navigated using keyboard keys. Up and Down arrow keys move focus to previous and next method call respectively. Left arrow collapses an expanded call and right arrow expands a collapsed call. Delete button deletes a call.
  • No Loop Calls: If same call repeats to the same class from a method (typically in a loop), only the first call is shown to avoid clutter.
  • No Recursive Calls: Recursive calls are not shown to avoid clutter.
  • Show Activations: Clicking this option draws an activation box for the duration a method is active.
  • Double Click to Open Source: Double clicking a call opens the source file, where this call is defined. All Java projects in workspace are searched for the source file, and the file is opened with the corresponding line is selected. Double clicking a Class figure opens the class file.
  • Outline View: Eclipse 'Outline View' shows all classes in the diagram and the methods called on them. The class names and method names are sorted in Outline view.
  • Call Response Time: Sequence diagram shows the response time for each method call. Select a call and open the Eclipse properties view to see the start time, end time and response time for that call in milliseconds. 

4.2 Class Diagram Features

The class diagram generated initially is a class dependency diagram that shows the dependencies between the classes involved based on the call sequence.

  • Matches to Sequence Diagram: Classes in class diagram always match the classes currently shown in the sequence diagram. Changes made in sequence diagram adds or deletes classes in class diagram and vice versa.
  • Show Class Hierarchy: To view the hierarchy of a class, select a class, right click and choose 'Show Class Hierarchy'. For this feature to work, the hierarchy classes should be available in workspace when the diagram was opened.
  • Double Click to Open Source: Double clicking a Class figure opens the class file.
  • Outline View: In class diagram Outline view, the list of classes in the class diagram is displayed. 
  • Classes can be Rearranged: Classes in class diagram can be rearranged to make the diagram more readable. Class relations can be bent by selecting a relation and dragging the centre point.

4.3 Common Features in both Class and Sequence Diagrams

The following features are available to both class and sequence diagrams.

  • Runtime Classes: All classes shown in the diagram are concrete runtime classes. No abstract base classes or interfaces are shown.
  • Save and Save As: Trace files are initially saved as *.ser file. This file holds the original call trace of the use case. The changes done to the diagram generated from a *.ser file cannot be saved back to the *.ser file. The changes have to be saved to a *.mnj file, that can also be opened in MaintainJ editor. Choose 'File-->Save As' to save the diagram to a file with extension *.mnj. You can change the diagram generated from *.mnj file and save the changes back to the same file.
  • Print: 'Print' option prints the active diagram.
  • Tool Tip: Tool tips for a class show the complete class name and methods of that class called in the use case. For calls, tool tip shows the response time and where this method is declared. If a method is defined in the super class and is called from sub class, the tool tip shows the super class name.
  • Export As  BMP / JPG Image: This option is used to export diagram as a bmp or jpg image. Choose a folder in the workspace and enter a file name with extension 'bmp' or  'jpg' to export the image.
  • Delete: Calls in sequence diagrams and classes in both diagrams can be deleted with the Delete key or 'Delete' option in the context menu. You can 'Undo' the delete operations.
  • Outline View: When a class or call is selected in the Outline view, the corresponding class or call is not automatically selected in the diagram. You need to right click and choose 'Select In Diagram' to select the corresponding class or call in the diagram.
MaintainJ