Check whether the UML class diagram plug-in is enabled

Idea is already integrated with this function by default, but it is not enabled by default. We need to manually enable it, as shown in the following figure:

The File – Settings – Plugins – UML Support:

 

 

Make sure the UML check box is checked, then click Apply, restart idea, then you can use this feature, of course you can enjoy yourself, but I recommend you continue to read, you will enjoy more

Two, detailed use

You can use UML class diagrams in the following ways:

1) Inside the class, right-click and select Diagrams — Show Diagram

2) Select a class in the left column, right click, and select Diagrams — Show Diagram

3) You can even select a package, right click, and choose Diagrams — Show Diagram (for the next demo, we do this by selecting a package)

Note: show and show… Popup is displayed in a floating window while Popup is created in a TAB:

 

Results:

 

1. Expand all nodes under each package in turn

 

Results:

 

Adjust your layout

The layout button is very common. When you apply a feature, the shape may change and you can show the power of the following commands

1) Fit the current window

 

2) Return to real size

 

3) Refresh the page according to the current layout

 

4) Adjust your layout

Right-click — Layout — and select your preferred display style

 

3. View class dependencies

Right click — select Show Dependencies

 

At this point, you find that the interface is messy and the line relationship is messy, so you can use the related commands to adjust the layout

 

Note:

Inheritance: solid blue arrow

Interface implementation relationship: green dotted arrow

4. Get rid of classes you don’t care about

In step 3, you find that there are too many classes and the shapes are too big for us to make sense of. At this point, we can manually delete the classes that we don’t care about

Select the class you want to delete and use the Delete key on your keyboard. The class diagram after cleaning is as follows:

 

We only keep the class diagram for one controller

5. View the class details

Right-click — Show Categories: Select Fields, Constructors, Methods, Properties

 

Results:

 

Some people say, ah, how is this enough, that inherited those methods I also want to see ah? Simple, IDEA all meet you.

What, in the method you want to filter, like, you want to see protected and above? Simply right-click and choose Change Visibility Level to adjust as required.

You can also adjust the display level of the class:

 

6. Manually add other classes to the existing class diagram

Right click on the page and select Add Class to Diagram or just press the space and enter the Class you want to Add:

 

7. Check the implementation/inheritance/parent of the class

 

Results:

 

8. Look at the code for the class

 

9, magnifier function

Press Alt on the keyboard, you can bring up the magnifier function, surprise, surprise!!

 

: www.toutiao.com/i6589439160…