# UML class diagrams

> **TL;DR**
> Right-click a class file or a package and select `Diagrams | Show Diagram` or `Diagrams | Show Diagram Popup`.

Procedure: Enable the Diagrams plugin

This functionality relies on the  Diagrams plugin, which  is bundled and enabled in IntelliJ IDEA   by default. If the relevant features are not available, make sure that you did not disable the plugin.

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Plugins`.

2. Open the Installed tab, find the Diagrams plugin, and select the checkbox next to the plugin name.

IntelliJ IDEA lets you generate  a diagram on a package in your project. Such diagrams always reflect the structure of actual classes and methods in your application.

> **Note:**
> IntelliJ IDEA supports creating and managing UML class diagrams for Kotlin the same way it does for Java.

Procedure: View diagram on a package

1. In the Project tool window, right-click a package  for which you want to create a diagram and select `Diagrams | Show Diagram` `Ctrl+Alt+Shift+U` (Windows), `⌘ ⌥ ⇧ U` (macOS), `⌘ ⌥ ⇧ U` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ ⇧ U` (macOS System Shortcuts), `Ctrl+Alt+Shift+U` (XWin), `Ctrl+Alt+Shift+U` (GNOME), `Ctrl+Alt+Shift+U` (KDE), `Ctrl+Alt+Shift+U` (Emacs), `Ctrl+Alt+Shift+U` (Sublime Text), `⌘ ⌥ ⇧ U` (Sublime Text (macOS)), `Ctrl+Alt+Shift+U` (NetBeans), `Ctrl+Alt+Shift+U` (Visual Studio), `⌘ ⌥ ⇧ U` (Visual Studio (macOS)), `Ctrl+Alt+Shift+U` (Eclipse), `⌘ ⌥ ⇧ U` (Eclipse (macOS)) ).

2. In the list that opens, select Java Class Diagram. IntelliJ IDEA generates a UML diagram for classes and their dependencies.

> **Tip:**
> You can view your VCS local changes as a diagram. Select `VCS | Uncommitted Changes| Show Local Changes as UML` `Ctrl+Alt+Shift+D` (Windows), `⌘ ⌥ ⇧ D` (macOS), `⌘ ⌥ ⇧ D` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ ⇧ D` (macOS System Shortcuts), `Ctrl+Alt+Shift+D` (XWin), `Ctrl+Alt+Shift+D` (GNOME), `Ctrl+Alt+Shift+D` (KDE), `Ctrl+Alt+Shift+D` (Emacs), `Ctrl+Alt+Shift+D` (Sublime Text), `⌘ ⌥ ⇧ D` (Sublime Text (macOS)), `Ctrl+Alt+Shift+D` (NetBeans), `Ctrl+Alt+Shift+D` (Visual Studio), `⌘ ⌥ ⇧ D` (Visual Studio (macOS)), `Ctrl+Alt+Shift+D` (Eclipse), `⌘ ⌥ ⇧ D` (Eclipse (macOS)).

## Analyze class diagram

> **Tip:**
> You can press `Ctrl+F12` (Windows), `⌘ F12` (macOS), `⌘ F12` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ 7` (macOS System Shortcuts), `Ctrl+F12` (XWin), `Ctrl+F12` (GNOME), `Ctrl+0` (KDE), `Ctrl+F12` (Emacs), `Ctrl+R` (Sublime Text), `⌘ R` (Sublime Text (macOS)), `Ctrl+F12` (NetBeans), `Alt+\` (Visual Studio), `⌥ \` (Visual Studio (macOS)), `Ctrl+F3` (Eclipse), `⌘ O` (Eclipse (macOS)) on the element to view a list of diagram elements and navigate between them.

To see the list of methods, fields, and other code elements, select the appropriate [icon](class-diagram-toolbar-and-context-menu.html) on the diagram toolbar located on top of the diagram editor.

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

The lists are displayed based on the selected visibility level, which you can change. For example, to view protected methods, click ![the Change Visibility Level button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.show.svg) on the diagram toolbar and select protected from the list. IntelliJ IDEA displays members with visibility not less than protected, such as public, package local, and protected ones. The protected methods are displayed with modifier icons ![key](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.nodes.accessProtected.png) next to them.

![Visibility level](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ac_diagrams_visibility_level.png)

You can click the ![the Show Dependencies icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/uml-support.icons.dependencies.svg) icon to see class dependencies. IntelliJ IDEA follows the [UML conventions](https://en.wikipedia.org/wiki/Class_diagram#Relationships) in showing relationships between the classes.

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

When you click through classes in the graph, IntelliJ IDEA greys out classes that do not reside in the same package. This might be helpful, when you generate a diagram on a package that contains inner packages.

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

To save the diagram as a file, right-click the diagram editor and from the context menu, select `Export Diagram | Export to File` and then the file extension in which you want to save the diagram.

## Manage class diagram

When working with diagrams, use the context menu in the diagram editor to perform different tasks. You can view members of the class, add new, delete the existing ones, see implementations, check parent classes, perform basic refactoring, add notes, and so on.

> **Tip:**
> You can select the ![the Edge Creation mode button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/uml-support.icons.edgemode.svg) icon on the diagram toolbar to draw relationship links between elements in your graph. To delete the existing links, select the ones you don't need and press `Delete` (Windows), `⌦` (macOS), `⌦` (IntelliJ IDEA Classic (macOS)), `⌦` (macOS System Shortcuts), `Delete` (XWin), `Delete` (GNOME), `Delete` (KDE), `Delete` (Emacs), `Delete` (Sublime Text), `⌦` (Sublime Text (macOS)), `Delete` (NetBeans), `Delete` (Visual Studio), `⌦` (Visual Studio (macOS)), `Delete` (Eclipse), `⌦` (Eclipse (macOS)). IntelliJ IDEA will update the source code accordingly.

Procedure: View the diagram structure

1. Generate a diagram.

2. Click Structure in the left toolbar. IntelliJ IDEA opens the Structure tool window that displays a map of your diagram with a small preview of the selected block and its neighbors.

![the Structure view](https://resources.jetbrains.com.cn/help/img/idea/2026.2/diagram_structure.png)

Use the context menu to zoom in and out, move canvas, change layout, and export part of the diagram into an image.

![the context menu](https://resources.jetbrains.com.cn/help/img/idea/2026.2/structure_context_menu.png)

Procedure: Add an existing class to a diagram

1. Press `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)).

2. In the search field that opens, start typing a name of the class you want to add. Then, select the required class from the suggestion list.

If you want to add a class that is out of the project scope, select the Include non-project items checkbox.

Alternatively, select one or more elements in the Project tool window and drag them to the diagram.

Procedure: Delete a node element from the diagram

1. In the diagram editor, select a node element you want to delete.

2. Right-click the element and from the context menu, select Delete `Delete` (Windows), `⌦` (macOS), `⌦` (IntelliJ IDEA Classic (macOS)), `⌦` (macOS System Shortcuts), `Delete` (XWin), `Delete` (GNOME), `Delete` (KDE), `Delete` (Emacs), `Delete` (Sublime Text), `⌦` (Sublime Text (macOS)), `Delete` (NetBeans), `Delete` (Visual Studio), `⌦` (Visual Studio (macOS)), `Delete` (Eclipse), `⌦` (Eclipse (macOS)).

Alternatively, select `Refactor | Safe Delete` `Alt+Delete` (Windows), `⌘ ⌦` (macOS), `⌘ ⌦` (IntelliJ IDEA Classic (macOS)), `⌘ ⌦` (macOS System Shortcuts), `Alt+Delete` (XWin), `Alt+Delete` (GNOME), `Alt+Delete` (KDE), `Alt+Delete` (Emacs), `Alt+Delete` (Sublime Text), `⌘ ⌦` (Sublime Text (macOS)), `Alt+Delete` (NetBeans), `Ctrl+R, D` (Visual Studio), `⌘ R, D` (Visual Studio (macOS)), `Alt+Delete` (Eclipse), `Alt+Delete` (Eclipse (macOS)). In this case, IntelliJ IDEA checks for [usages](find-highlight-usages.html) before applying the changes.

> **Tip:**
> You can quickly search for usages by pressing `Alt+F7` (Windows), `⌥ F7` (macOS), `⌥ F7` (IntelliJ IDEA Classic (macOS)), `⌃ U` (macOS System Shortcuts), `Alt+F7` (XWin), `Alt+Shift+7` (GNOME), `Alt+Shift+7` (KDE), `Alt+F7` (Emacs), `Alt+F7` (Sublime Text), `⌥ F7` (Sublime Text (macOS)), `Alt+F7` (NetBeans), `Shift+F12` (Visual Studio), `⇧ F12` (Visual Studio (macOS)), `Ctrl+G` (Eclipse), `⌘ ⇧ G` (Eclipse (macOS)) on a code element.

Procedure: Add new members to a class

You can perform some forward engineering while in the diagram editor.

1. In the diagram editor, right-click anywhere and from the context menu, select `Content | New`. Then select a code element you want to create.

2. Depending on your selection, IntelliJ IDEA opens the appropriate dialog where you specify the necessary information for creating the new element.

IntelliJ IDEA adds the item to your diagram as well as to your project tree  .

Procedure: View implementations and parent classes

You can view implementations and parent classes in your diagram. If IntelliJ IDEA finds more than one parent class or implementation, it displays a list of appropriate items. Select the one you need to see the connections between the parent and its children.

1. In the diagram editor, select an item for which you want to see implementations or parent classes.

2. Right-click the items and from the context menu, select the 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)) or 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), `⌘ ⌥ P` (Sublime Text (macOS)), `Ctrl+Alt+P` (NetBeans), `Ctrl+R, P` (Visual Studio), `⌘ R, P` (Visual Studio (macOS)), `Ctrl+Alt+P` (Eclipse), `⌘ ⌥ P` (Eclipse (macOS)) respectively.

3. In the popup that opens, select items you need and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (NetBeans), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (Eclipse), `⏎` (Eclipse (macOS)). To extend your selection up or down while in the popup, press `Shift+Up` (Windows), `⇧ ↑` (macOS), `⇧ ↑` (IntelliJ IDEA Classic (macOS)), `⇧ ↑` (macOS System Shortcuts), `Shift+Up` (XWin), `Shift+Up` (GNOME), `Shift+Up` (KDE), `Shift+Up` (Emacs), `Shift+Up` (Sublime Text), `⇧ ↑` (Sublime Text (macOS)), `Shift+Up` (NetBeans), `Shift+Up` (Visual Studio), `⇧ ↑` (Visual Studio (macOS)), `Shift+Up` (Eclipse), `⇧ ↑` (Eclipse (macOS)) or `Shift+Down` (Windows), `⇧ ↓` (macOS), `⇧ ↓` (IntelliJ IDEA Classic (macOS)), `⇧ ↓` (macOS System Shortcuts), `Shift+Down` (XWin), `Shift+Down` (GNOME), `Shift+Down` (KDE), `Shift+Down` (Emacs), `Shift+Down` (Sublime Text), `⇧ ↓` (Sublime Text (macOS)), `Shift+Down` (NetBeans), `Shift+Down` (Visual Studio), `⇧ ↓` (Visual Studio (macOS)), `Shift+Down` (Eclipse), `⇧ ↓` (Eclipse (macOS)) respectively.

Procedure: Configure diagram settings

You can configure the diagram settings so that you have certain options available by default when you create a diagram.

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Tools | Diagrams`.

2. In the right-hand pane, select the options that you want to see by default and click OK to apply your changes.

## Analyze graph

The Analyze Graph action group lets you analyze the graph in various ways such as perform auto clusterization, measure the node centrality, search cycles, filter path between two nodes, and so on.

Procedure: Filter paths between two nodes

Most of the time, generated diagrams are big and complicated. Typically, you want to concentrate only on the specific part of the diagram. IntelliJ IDEA lets you filter paths between two diagram elements.

1. In the diagram editor, select two nodes on which you want to focus and right-click one of them to open the context menu.

2. From the context menu, select `Analyze Graph | Focus On Paths Between Two Nodes`.

> **Note:**
> If you want to focus not only on just two nodes, but on how the selected node is connected with its neighbors, select the Focus on Node Neighborhood option from the context menu.

3. In the dialog that opens, select additional options if needed and click Find.

![the Focus on Paths between Two Nodes dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/focus_view_on_path_dialog.png)

IntelliJ IDEA displays connections associated only with the selected nodes.

![Paths between nodes](https://resources.jetbrains.com.cn/help/img/idea/2026.2/paths_between_nodes.animated.gif)

Procedure: Measure diagram centrality

You can use this action to identify the important nodes in the graph.

1. In the diagram editor, right-click anywhere in the editor to open the context menu.

2. From the context menu, select `Analyze Graph | Measure Centrality`.

3. In the dialog that opens, select additional options if needed and click Measure.

![Measure Centrality](https://resources.jetbrains.com.cn/help/img/idea/2026.2/measure_centrality_dialog.png)

The node "importance" is expressed via fractional value from 0.0 to 1.0 measurement, and the brightest node selection should be explored first.

![Measure Nodes](https://resources.jetbrains.com.cn/help/img/idea/2026.2/measurements.png)

> **Tip:**
> Press `Ctrl+Z` (Windows), `⌘ Z` (macOS), `⌘ Z` (IntelliJ IDEA Classic (macOS)), `⌘ Z` (macOS System Shortcuts), `Ctrl+Z` (XWin), `Ctrl+Z` (GNOME), `Ctrl+Z` (KDE), `Ctrl+Shift+Minus` (Emacs), `Ctrl+Z` (Sublime Text), `⌘ Z` (Sublime Text (macOS)), `Ctrl+Z` (NetBeans), `Ctrl+Z` (Visual Studio), `⌘ Z` (Visual Studio (macOS)), `Ctrl+Z` (Eclipse), `⌘ Z` (Eclipse (macOS)) to cancel the actions.

## See also

### Reference

[Diagram toolbar and context menu](diagram-toolbar-and-context-menu.html) [Class diagram toolbar, context menu, and legend](class-diagram-toolbar-and-context-menu.html)

