# Class diagram toolbar, context menu, and legend

For more information about using the UML class diagram, refer to [UML class diagrams](class-diagram.html)  .

## Toolbar

| Item | Description |
| --- | --- |
|  ![Fields](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.nodes.field.svg)   | Click this button to show fields in the class nodes. |
|  ![Constructors](https://resources.jetbrains.com.cn/help/img/idea/2026.2/uml-support.icons.expui.constructor.svg)   | Click this button to show constructors in the class nodes. |
|  ![Methods](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.nodes.method.svg) | Click this button to show methods in the class nodes. |
| ![property](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.nodes.property.svg) | Click this button to show properties in the class nodes. |
| ![inner class](https://resources.jetbrains.com.cn/help/img/idea/2026.2/uml-support.icons.expui.innerClass.svg) | Click this button to show inner classes in the class nodes. |
| ![visibility level](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.inspections.inspectionsEye.svg) | Click this button to reveal the combo box, and select visibility level of the elements to be displayed in a diagram.  |
| ![scope](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.filter.svg) | Click this button to reveal the combo box, and select the desired scope of elements to be displayed in diagram, for example, project or non-project files. The elements out of the selected scope will be hidden. |
| ![the Edge Creation mode button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/uml-support.icons.expui.edgeMod.svg)  | Click this button to enable creating extends or implements links between node elements. If this button is not pressed, links cannot be drawn.  |
|  ![show dependencies](https://resources.jetbrains.com.cn/help/img/idea/2026.2/uml-support.icons.expui.dependencies.svg)  | Click this button to show dependencies of the selected class or package.  |
|  ![Change Item Ordering](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.objectBrowser.sortByType.svg)  | Click this icon to configure the sorting order in the displayed diagram. |
| ![Zoom In](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.image.zoomIn.svg) | Click this button to increase the scale of the diagram, or press `NumPad+` (Windows), `NumPad+` (macOS), `NumPad+` (IntelliJ IDEA Classic (macOS)), `NumPad+` (macOS System Shortcuts), `NumPad+` (XWin), `NumPad+` (GNOME), `NumPad+` (KDE), `NumPad+` (Emacs), `NumPad+` (Sublime Text), `NumPad+` (Sublime Text (macOS)), `NumPad+` (NetBeans), `NumPad+` (Visual Studio), `NumPad+` (Visual Studio (macOS)), `NumPad+` (Eclipse), `NumPad+` (Eclipse (macOS)).  |
| ![Zoom Out](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.image.zoomOut.svg) | Click this button to decrease the scale of the diagram, or press `NumPad-` (Windows), `NumPad-` (macOS), `NumPad-` (IntelliJ IDEA Classic (macOS)), `NumPad-` (macOS System Shortcuts), `NumPad-` (XWin), `NumPad-` (GNOME), `NumPad-` (KDE), `NumPad-` (Emacs), `NumPad-` (Sublime Text), `NumPad-` (Sublime Text (macOS)), `NumPad-` (NetBeans), `NumPad-` (Visual Studio), `NumPad-` (Visual Studio (macOS)), `NumPad-` (Eclipse), `NumPad-` (Eclipse (macOS)).  |
| ![Actual Size](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.image.actualZoom.svg) | Click this button to restore the actual size of the diagram. |
| ![Fit Content](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.image.fitContent.svg) | Click this button to make the contents fit into the current diagram size. |
| ![Apply Current Layout](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.graph.graphLayout.svg) | Click this button to apply the current layout, selected from the context menu of the diagram, or press `F5` (Windows), `F5` (macOS), `F5` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ Y` (macOS System Shortcuts), `F5` (XWin), `F5` (GNOME), `F5` (KDE), `F5` (Emacs), `F5` (Sublime Text), `F5` (Sublime Text (macOS)), `F5` (NetBeans), `F5` (Visual Studio), `F5` (Visual Studio (macOS)), `F5` (Eclipse), `F5` (Eclipse (macOS)). |
|  ![Route Edges](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.actions.moveToButton.svg)  | Click this icon to scale the diagram to the edges of the window. |
|  ![Copy Diagram to Clipboard](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.copy.svg)  | Click this icon to copy the diagram into the clipboard. |
|  ![Copy Selection to Clipboard](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.actions.inSelection.svg)  | Click this icon and then select any diagram area with the mouse: the selected area will be copied into the clipboard. |
|  ![Export Diagram](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.export.svg)  |    Click this icon to export a diagram using various formats, which are compatible with third-party tools, to a file, to an image, or open the diagram in the browser.      ![Export Diagram](https://resources.jetbrains.com.cn/help/img/idea/2026.2/export_diagram.png)                     You can select and configure the following options:       * ![Open in Web Editor](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.runConfigurations.webApp.svg): click this button to select a third-party editor to which you can export the diagram.    * ![Copy Diagram to Clipboard](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.copy.svg): click this button to save the diagram to a clipboard using one of the available formats.    * ![Save diagram](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.save.svg): click this button to save the current diagram as a file. You can use one of the available formats from the list.    * ![Save image](https://resources.jetbrains.com.cn/help/img/idea/2026.2/markdown.icons.imageGutter.svg): click this button to save the current diagram in the PNG format.    * ![Print](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.print.svg): click this button to print the diagram.    |
| ![Refresh Data Model](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.refresh.svg) | Click this button to refresh the whole diagram.  |
|  ![Open Diagram Settings](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.settings.svg)  |  Click this button to open the [Diagram settings](diagrams.html) where you can configure additional options.  |

## Context Menu

This section describes only those context menu commands that are not available from the toolbar.

| Item | Description |
| --- | --- |
| Selected Element Actions | Use this option to open a list of actions that is applied to a selected element in the diagram. You can select actions to copy an element, jump to its source, find its usages, use the Navigate actions, various Git actions,  and so on.  |
| Content | Use this option to open a list of actions that help you to add new elements, show dependencies, sort elements inside the diagram, and so on .     * Add class to diagram (`Space` (Windows), `Space` (macOS), `Space` (IntelliJ IDEA Classic (macOS)), `Space` (macOS System Shortcuts), `Space` (XWin), `Space` (GNOME), `Space` (KDE), `Space` (Emacs), `Space` (Sublime Text), `Space` (Sublime Text (macOS)), `Space` (NetBeans), `Space` (Visual Studio), `Space` (Visual Studio (macOS)), `Space` (Eclipse), `Space` (Eclipse (macOS))): Choose this command to [add existing class](class-diagram.html#add_class) to the diagram background.    * New (`Alt+Insert` (Windows), `⌘ N` (macOS), `⌃ N` (IntelliJ IDEA Classic (macOS)), `⌘ N` (macOS System Shortcuts), `Alt+Insert` (XWin), `Alt+Insert` (GNOME), `Alt+Insert` (KDE), `Alt+Insert` (Emacs), `Alt+Insert` (Sublime Text), `⌘ N` (Sublime Text (macOS)), `Alt+Insert` (NetBeans), `Alt+Insert` (Visual Studio), `⌘ ⌃ N` (Visual Studio (macOS)), `Alt+Insert` (Eclipse), `⌘ N` (Eclipse (macOS))): Choose this command to create a new node element or member.    * Show Categories: Choose this command to show the selected code element in the class nodes. For example, you can select Fields to see all the field elements in the classes . ![Fields in Classes](https://resources.jetbrains.com.cn/help/img/idea/2026.2/fields_of_class.png)     > **Note:** > The rest of the commands in the list are available in the [toolbar](#toolbar).    |
| Show Implementations (`Ctrl+Alt+B` (Windows), `⌘ ⌥ B` (macOS), `⌘ ⌥ B` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ B` (macOS System Shortcuts), `Ctrl+Alt+B` (XWin), `Ctrl+Alt+B` (GNOME), `Ctrl+Alt+B` (KDE), `Ctrl+Alt+B` (Emacs), `Ctrl+Alt+B` (Sublime Text), `⌘ ⌥ B` (Sublime Text (macOS)), `Ctrl+Alt+B` (NetBeans), `Alt+End` (Visual Studio), `⌘ ⌥ Click` (Visual Studio (macOS)), `Ctrl+T` (Eclipse), `Ctrl+Alt+B` (Eclipse (macOS))) | Choose this command to display implementations of the selected class.   ![Implementations](https://resources.jetbrains.com.cn/help/img/idea/2026.2/show_implementations.png)  |
| Show Parents (`Ctrl+Alt+P` (Windows), `⌃ P` (macOS), `⌃ P` (IntelliJ IDEA Classic (macOS)), `⌃ P` (macOS System Shortcuts), `Ctrl+Alt+P` (XWin), `Ctrl+Alt+P` (GNOME), `Ctrl+Alt+P` (KDE), `Ctrl+Alt+P` (Emacs), `Ctrl+Alt+P` (Sublime Text), `Ctrl+Alt+P` (Sublime Text (macOS)), `Ctrl+Alt+P` (NetBeans), `Ctrl+Alt+P` (Visual Studio), `⌃ P` (Visual Studio (macOS)), `Ctrl+Alt+P` (Eclipse), `⌃ P` (Eclipse (macOS))) | Choose this command to display parent classes for the selected class.   ![Parent Classes](https://resources.jetbrains.com.cn/help/img/idea/2026.2/show_parent_classes.png)  |
| Collapse nodes (`C` (Windows), `C` (macOS), `C` (IntelliJ IDEA Classic (macOS)), `C` (macOS System Shortcuts), `C` (XWin), `C` (GNOME), `C` (KDE), `C` (Emacs), `C` (Sublime Text), `C` (Sublime Text (macOS)), `C` (NetBeans), `C` (Visual Studio), `C` (Visual Studio (macOS)), `C` (Eclipse), `C` (Eclipse (macOS))) | Choose this command to show the containing package of the selected node.  |
| Expand nodes (`E` (Windows), `E` (macOS), `E` (IntelliJ IDEA Classic (macOS)), `E` (macOS System Shortcuts), `E` (XWin), `E` (GNOME), `E` (KDE), `E` (Emacs), `E` (Sublime Text), `E` (Sublime Text (macOS)), `E` (NetBeans), `E` (Visual Studio), `E` (Visual Studio (macOS)), `E` (Eclipse), `E` (Eclipse (macOS))) | Choose this command to show class diagram of the selected package. |
| Refactor | Point to this node to select one of the refactoring commands available in this context. |
| Analyze Graph | Use this node to select one of the commands to analyze a diagram. You can check the graph characteristics, change the focus of the graph, measure graph centrality, and so on. |
| Analyze | Point to this node to select one of the code analysis commands available in this context. |
| Actual Size | Use this option to restore the actual size of the diagram. |
| Fit Content | Use this option to fit the content into the current diagram size. |
| Layout | Use this option to select the desired diagram layout from the submenu. |
| Route Edges | Select this action to center the diagram in the editor. |
| Orientation | Use this command to select the following orientation options: Bottom to Top, Top to Bottom, and so on. |
| Apply Current Layout | Use this option to apply the current layout, selected from the Layout node of the diagram context menu |
| Show Edge Labels | Check this command to show multiplicities in diagram.  |
| Appearance | Use this option to manage the way the diagram is presented by showing the grid, edge labels, bridges. This option also allows you to merge edges and select edge shapes. |
| Behavior | Use this option to select commands related to the diagram behavior sucha as aligning elements against the grid, showing structure view for the selected node, or fitting the content after the layout. |

> **Note:**
> The rest of the context menu is available on the [diagram toolbar](#toolbar).

## Legend of the Class Diagram

IntelliJ IDEA follows the [UML conventions](https://en.wikipedia.org/wiki/Class_diagram#Relationships) in showing relationships between the classes.

![Diagram editor](https://resources.jetbrains.com.cn/help/img/idea/2026.2/uml_class_diagram_legend.png)

Besides that, IntelliJ IDEA supports the following colors and arrows:

| Item | Description |
| --- | --- |
| ![implements](https://resources.jetbrains.com.cn/help/img/idea/2026.2/implements.png) | The green arrow corresponds to the `implements` clause in a class declaration. |
| ![extends](https://resources.jetbrains.com.cn/help/img/idea/2026.2/extends.png) | The blue arrow corresponds to the `extends` clause in a class declaration . |
| ![inner class](https://resources.jetbrains.com.cn/help/img/idea/2026.2/inner_class.png) | This sign appears for the inner classes. |

## See also

### Procedures

[UML class diagrams](class-diagram.html)

### External Links

[http://www.omg.org](http://www.omg.org)

