Reputation: 131038
I am a newbie in Java. I am trying to figure out how to work this code. It seems to me that it would be very useful if in the beginning I get the general structure of the code (which methods exists and how they are interrelated). For example I see that "main" uses "createAndShowGUI" which, in its turn, uses "addComponentsToPane" and so on. So, the code has kind of a tree structure and it would be nice if I can visualize this structure. Is there any software that can do it. Or, more specifically, can NetBeans do it?
Upvotes: 7
Views: 4265
Reputation: 205785
On Mac OS X, the Xcode design tool has a "Quick Model" feature that is specially handy for visualizing an existing class library.
Upvotes: 1
Reputation: 77995
You can use the excellent doxygen source-code documentation generation tool for that.
Upvotes: 0
Reputation: 904
In NetBeans open Window > Navigator
.
You'll get it as shown in the image-
Upvotes: 1
Reputation: 158
Right clicking on a method name in NetBeans, you can choose Call Hierarchy
. It'll open a window with a tree structure displayed. I think it defaults to the callers view. In the window's toolbar you can switch to the callees view. You will then have a navigable tree view of everything the current method calls. Expanding the tree on a callee will show that methods callees. It's not exactly a diagram but should help.
Upvotes: 5
Reputation: 346260
Not sure about Netbeans, but in eclipse, you can right-click on a method and select "open call hierarchy" to get a tree view of methods that call the method you have selected, and at the top of the view is an icon to reverse this ("Show Callee Hierarchy"), which does pretty much what you want (except it shows only one method's callees at a time).
Upvotes: 4
Reputation: 44063
I've some demo code here for an eclipse plugin. It creates a tree view and table view of instance variables and instance methods and how they relate to each other.
Upvotes: 0
Reputation: 41087
In eclipse you can see it in ast view. Netbeans might have something similar.
Upvotes: 1