UML Diagrams

To create UML diagrams, place the cursor on the name of a class, then use the DVT: Show Diagram command and select UML Diagram.

A diagram is created around a set of relevant classes you specify. For example, when you decide to show parents, children, or associations by using the available preferences, it applies only to selected classes.

The selected classes are colored with yellow fill. To add or remove an element to or from the current selection, use the Select/Deselect Type context menu actions.

Note

Dark theme will use the inverted color to highlight selected classes.

../../_images/uml_diagrams.gif

UML Diagram Actions

The following operations are available in the context menu of a class from the diagram editor:

  • Go To Source: Jump to the declaration of a field, event, or method

  • Select Type or Deselect Type: Add or remove an element to or from the current selection

  • Members: Show or hide members of a class

UML Diagram Preferences

For the selected classes you can choose to show parents, children, associations (pointers), customize the graph layout etc.

../../_images/vscode-dvt-class-diagram-preferences-new.png

You may choose to:

  • Show all, selected only, a specified depth or no parents for selected classes

  • Show all, selected only, a specified depth or no children for selected classes

  • Show all, selected only, a specified depth or no associations (pointers) for selected classes

  • Show all, public or no members - fields, events, methods (functions, tasks) - for the selected classes

  • Customize the graph layout

  • Show full method signature

  • Show labels on association edges

  • Route edges orthogonally

  • Show package information

  • Group by package

Note

To see the inherited pointers of a class, you need to select its parents and show at least one level of associations.

UML Diagrams Legend

../../_images/vlogdt-class-diagram-legend-a-class-new.png

A class.

../../_images/vlogdt-class-diagram-legend-selected-class-new.png

A selected class.

../../_images/vlogdt-class-diagram-legend-class-with-members-new.png

A selected class with members. The cells are (in order) for fields, events, and methods (functions and tasks). Each member name is preceded by an access modifier flag: + (plus) for public, - (minus) for private, and # (hash) for protected.

../../_images/vlogdt-class-diagram-legend-predefined-class-new.png

A predefined class.

../../_images/vlogdt-class-diagram-legend-inheritance-new.png

Inheritance: ChildClass inherits from ParentClass.

../../_images/vlogdt-class-diagram-legend-template-inheritance-new.png

Inheritance with parameters: SetParams inherits from AClassWithParams#(int) (sets T to int).

../../_images/vlogdt-class-diagram-legend-interface-new.png

Implementation: AClass implements InterfaceClass.

../../_images/vlogdt-class-diagram-legend-association-new.png

Association: AClass points to BClass (has a field f_bcl of type BClass).