Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to quickly check the class diagram relationship with IDEA by java

2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "java how to use IDEA to quickly view class diagram relationships". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian and go deep into it slowly to study and learn "java how to use IDEA to quickly view class diagram relationships" together!

Java developers are now generally using ideas. It can be said that idea is a well-deserved Java development artifact. If you haven't used an idea yet, you haven't felt its power yet.

Well, without further ado, today's topic is mainly to teach you how to quickly view the class diagram relationship of a class through idea, that is, which classes a class inherits, which interfaces it implements, and which sub-interfaces and implementation classes the interface has.

I. Class relations

Take a blocking queue LinkedBlockingQueue as an example:

1) Find this class by Ctrl+Shift+N.

2) Go to the class, right-click on the class name, and select Diagrams -> Show Diagram. (Of course, you can also choose the second Popup, but it is a class diagram displayed in the form of a pop-up window)

3) In this way, you can see the complete class diagram relationship of the current class. Of course, if the class diagram is more complex, the computer can not see all, you can enlarge the window, and then select the adaptive button below, adaptive content.

II. Interface relations

In addition, if you want to see which implementation classes are available for an interface, you can right-click an interface above the class diagram and select Show Implementations. Take BlockingQueue for example.

As you can see, all subinterfaces and implementation classes of the current interface are displayed. (I have an extra 1 displayed here. I don't know what ghost it is. There is no response to clicking it. No matter what, it has no effect.)

If you want to add all subinterfaces and implementation classes to the class diagram, Ctrl+A selects all. However, this is not recommended. Because the class diagram relationship will definitely be very complicated, adding dozens of classes at once will not be clear at all, and it is unnecessary. I will not demonstrate, interested can try it themselves.

Generally, they choose the category they are interested in to view. So, here I choose another commonly used ArrayBlockingQueue. The class diagram looks like this.

In addition, there is a way to view all the implementation classes of an interface. Click on a class in the diagram and Ctrl + H to bring up the class hierarchy. As shown, select this button to display all subinterfaces and implementation classes. There would also be a line of small words above it.

Then, you can select multiple subclasses and implementation classes and see their class diagram relationships. For example, in the picture I selected four.

Diagrams -> Show Diagram

Select the first Java Class Diagrams,

Note, however, that this method opens a new class diagram relationship, rather than adding it to the original class diagram.

If you want to extend the original class diagram, you should use Show Implementations honestly. (This is also a reasonable way.)

After reading it, does it feel very simple? Hurry up and practice it.

Thank you for reading, the above is "java how to use IDEA to quickly view the class diagram relationship" content, after the study of this article, I believe we have a deeper understanding of java how to use IDEA to quickly view the class diagram relationship, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report