UML class diagramsUltimate
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.
View diagram on a package
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 ).
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 | Show Local Changes as UML Ctrl+Alt+Shift+D.
Analyze class diagram
tip
You can press Ctrl+F12 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 on the diagram toolbar located on top of the diagram editor.

The lists are displayed based on the selected visibility level, which you can change. For example, to view protected methods, click 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
next to them.
You can click the icon to see class dependencies. IntelliJ IDEA follows the UML conventions in showing relationships between the classes.

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.

To save the diagram as a file, right-click the diagram editor and from the context menu, select Save UML 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
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 N/A. IntelliJ IDEA will update the source code accordingly.