当前位置:网站首页>The idea of the diagram
The idea of the diagram
2022-08-04 01:32:00 【Can't type 314】
diagram usage in idea
Reference URL:
https://mp.weixin.qq.com/s/BLIuW_xjN8Tnd0ZxqC1dlQ
Description
This article basically summarizes all the usage of diagram, to prevent loss, collect and reprint a wave
1. View the inheritance chain in graphical form
In the tab of the class you want to view, right-click and select Diagrams, there are show and show … Popup, but the former is newly created in the tab, and the latter is displayed in the form of a floating window:
Actually, you can also right-click on the class you want to view from the project directory tree on the left, and select Diagrams as well, the effect is the same:
Then you will get the inheritance relationship graph as shown below, taking a custom servlet as an example:
It is obvious that:
- The solid blue arrow indicates the inheritance relationship
- The green dotted arrow refers to the interface implementation relationship
2, optimize the inheritance chain graphics, think what I think
2.1 remove unrelated classes
Some of the inheritance relationship graphs obtained are not what we want to know, such as Object and Serializable in the above figure. We only want to care about the important inheritance relationships of Servlet. What should we do?
Simple, delete.Click to select the class you want to delete, then just use the delete key on your keyboard.After cleaning up the relationships of other classes, the graph is as follows:
2.2 Display class details
Some people say, eh, how can that be enough? I also want to see the inherited methods?Simple, IDEA has everything for you.
Right-click on the page, select show categories, and expand the properties, methods, constructors, etc. in the class as needed.Of course, the second method can also directly use the above toolbar:
Then you will get:
What, do you still want to filter in the method, for example, you want to see protected permissions and above?Simple, right-click to select Change Visibility Level, and adjust as needed.
What, do you think the graphics are too small for you to see clearly?IDEA can also satisfy you. Press and hold Alt on the keyboard, and a magnifying glass appears. Is it surprising or unexpected?
2.3 Add other classes to the relationship
When we also need to check whether other classes have an inheritance relationship with the current class, we can choose to add them to the current inheritance relationship graph.
Right-click on the page, select Add Class to Diagram, and then enter the class you want to add:
For example, we added a Student class as shown in the following figure.Well, there is no arrow, it seems that it has no indescribable relationship with the current classes and interfaces:
2.4 View specific code
If you want to view the specific source code of a certain class, such as a certain method, of course, it is impossible to display it on the graphics, otherwise the screen will not be able to explode?
But you can use graphics, or cooperate with IDEA's structure to easily and quickly enter the source code of a class for viewing.
After double-clicking a class, you can walk in the method list under it. For the method you want to view, right-click and select Jump to Source:
After selecting the structure in the left column, all the methods in the class will be displayed on the left as shown in the figure above. Click which method, and the page content will jump to the method section.
3, last
08464499)]
After selecting the structure in the left column, all the methods in the class will be displayed on the left as shown in the figure above. Click which method, and the page content will jump to the method section.
3, last
Using the IDEA functions mentioned above, learning and viewing class relationships, and understanding things such as mainstream framework source code, can be said to be very comfortable.
边栏推荐
- What warehouse management problems can WMS warehouse management system solve in the electronics industry?
- 观察者模式
- OpenCV如何实现Sobel边缘检测
- Linux安装mysql最简单教程(一次成功)
- Web3 安全风险令人生畏?应该如何应对?
- VR全景拍摄线上展馆,3D全景带你沉浸体验
- 【正则表达式】笔记
- Electronics manufacturing enterprise deployment WMS what are the benefits of warehouse management system
- Observability:你所需要知道的关于 Syslog 的一些知识
- typescript48-函数之间的类型兼容性
猜你喜欢
JS 从零教你手写节流throttle
Web3 security risks daunting?How should we respond?
nodejs+express实现数据库mysql的访问,并展示数据到页面上
typescript50-交叉类型和接口之间的类型说明
jmeter distributed stress test
typescript55 - generic constraints
nodejs切换版本使用(不需要卸载重装)
持续投入商品研发,叮咚买菜赢在了供应链投入上
【虚拟户生态平台】虚拟化平台安装时遇到的坑
Apache DolphinScheduler新一代分布式工作流任务调度平台实战-中
随机推荐
nodejs+express realizes the access to the database mysql and displays the data on the page
Summary of GNSS Articles
【虚拟化生态平台】虚拟化平台esxi挂载USB硬盘
持续投入商品研发,叮咚买菜赢在了供应链投入上
GNSS【0】- 专题
typescript54 - generic constraints
Google Earth Engine - Calculates the effective width of rivers using publicly available river data
typescript56-泛型接口
typescript50 - type specification between cross types and interfaces
nodejs 安装多版本 版本切换
观察者模式
nodejs+npm的安装与配置
互斥锁、读写锁、自旋锁,以及原子操作指令xaddl、cmpxchg的使用场景剖析
企业虚拟偶像产生了实质性的价值效益
VR全景拍摄线上展馆,3D全景带你沉浸体验
html select标签赋值数据库查询结果
LDO investigation
Sticker Spelling - Memory Search / Shape Pressure DP
typescript50-交叉类型和接口之间的类型说明
JS 保姆级贴心,从零教你手写实现一个防抖debounce方法