Features

The class diagrams of the ObjectAid UML Designer are based on the OMG's UML 2.0 specification (see http://www.omg.org/uml/). They can contain existing Java classes, interfaces, enumerations, annotations (collectively called classifiers henceforth in accordance with UML 2.0) as well as packages and package roots (i.e. JARs and source folders). Class diagrams only reflect the existing source code, which cannot be manipulated through the diagram. They are stored as XML files with the extension '.ucls'.

Here is a screenshot of the Java perspective in the Eclipse IDE with a class diagram and the outline view.

All user interaction with the class diagram is either graphical (clicking, dragging, drag and drop) or with context menus, with only a few exceptions:

  • A toolbar combobox allows the selection of zoom factors.
  • Accelerators are available for Delete (DEL), Open Source (double-click or F3), Open Type Hierarchy (F4) and some other common actions (Undo, Redo, Select All, Save, Save As).

Context menu commands apply to all selected items where feasible.

Eclipse refactoring is fully supported. Refactoring updates all diagrams in the workspace appropriately.

Class Diagrams

Class diagrams follow the standard Eclipse conventions for editors: They are opened from the Package Explorer and can be saved as usual. Standard undo/redo behavior is available. Class diagrams are created with a wizard:

  1. Go to the Package Explorer and select the package (or folder) where the diagram should be stored.
  2. To open the 'New' wizard, either press Ctrl+N or right-click and select 'New', then 'Other...'.
  3. In the 'New' wizard page select 'UML Diagram', then 'Class Diagram' and press the 'Next' button.
  4. In the 'New UML Class Diagram' wizard page, you can
    • Enter or browse for a folder.
    • Enter the name of the class diagram without the extension.
    • Under 'Classifiers', 'Relationships', 'Attributes' and 'Operations' the diagram's options for new classifiers and relationships can be selected.
  5. Press 'Finish' to create a new empty class diagram.
  6. The 'Classifiers' chapter describes how you can add classifiers and other items to the diagram.

The class diagram context menu has the following options:

  • Select everything, only nodes or only connections.
  • Add a classfier through a standard Eclipse dialog.
  • Layout the entire diagram.
  • Save the diagram as a GIF image.
  • The same options as the wizard. They control the display of new classifiers, associations, which relationships are added for new classifiers and the visibility of attributes and operations.

Integration with Views

The Outline View shows all nodes in a diagram, along with fields and methods. Selecting a node in the outline also selects it in the diagram (and scrolls the diagram to its position if necessary) and vice verse. Below the outline is a thumbnail of the entire diagram, which allows easy navigation in large diagrams.

The Javadoc View shows the documentation of the selected classfier. Similarly, the Declaration View shows the source code of the currently selected classifier.

The Console View contains a log of problems that occurred when a diagram was opened. This can be due to an invalid or outdated diagram, or simply because some Java elements or relationships don't exist any more and had to be deleted. The diagram's name is a hyperlink and clicking on it opens the diagram.

The References context menu of a classifier displays search results as usual in the Search View, from which classifiers can be dragged onto the diagram.

The Open Type Hierarchy context menu of a classifier shows its inheritance hierarchy as usual, from which classifiers can be dragged onto the diagram.

Classifiers

In the context of this document, a classifier is a Java type. Java classes, interfaces, enumerations and annotations are the supported classifiers.

Source and binary classifiers can be added to the diagram in various ways (as long as they are not there already):

  • Classifiers can be dragged from the Package Explorer, the Type Hierarchy View and the Search View. Note that when you drag a file from the Package Explorer, all classifiers in that file are added to the diagram.
  • Classifiers can be added directly by opening a dialog from the class diagram's context menu.
  • Classifiers with a particular relationship to the currently selected classifer can be added from the context menu. The supported relationships are: generalization (parents only), realization, association.
  • When an attribute is selected whose type is a classifier, that classifier can be added directly to the class diagram by selecting it from the context menu.
  • Java elements can be copied and pasted from one diagram to another. They appear in the same location as the previous diagram. All relationships between the elements are are copied as well, relationships to other classifiers are reverse engineered as usual.

Packages and package roots (i.e. JARs and source folders) can be dragged from the Package Explorer

The classifier context menu has the following options:

  • Open the classifier(s)' source in an editor.
  • Open the type hierarchy of the selected classifier.
  • Delete the selected classifer(s) from the diagram.
  • Add related classifiers or reverse engineer relationships.
  • Find references to the selected classifer and show them in the Search view.
  • Align two or more diagram nodes.
  • Various options for the display of classifiers.

Relationships

The following relationship types are supported: Generalization, Realization, Association, Dependency, Nesting. When a classifier is added to a diagram, relationships to other classifiers in the diagram are reverse engineered. They can be deleted from the diagram and reverse engineered again later.

  • The reverse engineering of relationships is configurable in the 'New UML Class Diagram' wizard and the class diagram context menu.
  • The reverse engineering of associations knows generics: generic collections and maps with type parameters are reverse engineered as associations to the classifier of the type parameter.
  • A non-generic collection or map can be converted into an association by selecting it and clicking the target classifier.
  • Two unidirectional associations between two classifiers can be merged into a single bidirectional association. The unidirectional associations have to point in opposite directions, but they can be on the same classifier.
  • Relationships can be reverse engineered by type for the selected classifer with a context menu.
  • Relationships can be routed automatically or manually. Moving a bend point in a relationship turns off automatic routing. A context menu option or moving the relationship back to a straight line turn it on again.
  • Attributes that participate in an association are not displayed on their classifier.

The relationship context menu has the following options:

  • Delete the selected relationship(s) from the diagram.
  • Turn off automatic routing for the selected relationship(s).
  • For associations, it is also possible to switch the display of attribute names and multiplicities.