UML Diagrams

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

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

The selected structs 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 struct

UML Diagram Preferences

For the selected structs 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 structs

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

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

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

  • 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 struct, you need to select its parents and show at least one level of associations.

UML Diagrams Legend

../../_images/edt-class-diagram-legend-a-struct-new.png

A struct.

../../_images/edt-class-diagram-legend-selected-struct-new.png

A selected struct.

../../_images/edt-class-diagram-legend-struct-with-members-new.png

A selected struct 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, # (hash) for protected, and ~ (tilda) for package. Fields that are not generated have an extra ! (exclamation mark), and those that are physical have a % (percent) after the access modifier flag.

../../_images/edt-class-diagram-legend-predefined-struct-new.png

A predefined struct.

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

Inheritance like: a_child_struct inherits from a_parent_struct. Inheritance when: GOOD a_child_struct inherits from a_child_struct.

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

Association: a_struct points to b_struct (has a field p_to_b of type b_struct).

../../_images/edt-class-diagram-legend-irrelevant-when-new.png

Relevant/Irrelevant when subtype: GOOD packet, SMALL packet and GOOD SMALL packet are relevant when subtypes (such packet extensions are explicitly defined), BAD packet (dotted gray box) is an irrelevant when subtype (no explicit BAD packet extension).