NetBeans 7 dependency graph (unused class/method)

2019-04-14 20:18发布

问题:

Is there a way to create a dependency graph for classes and/or methods of Java SE projects within NetBeans 7? I have a very large project and I'd like to clean up unused classes or methods (and a dependency graph would also be useful).

The "center" of the graph would be the main() entry point of main classes I invoke, and adjacencies would be method calls (including some Swing framework methods to classes which override the Java Swing framework).

回答1:

That's weird, when I right click on a project in NetBeans 7.0.1 I can choose "Show dependency graph" and it shows me a dependency graph, complete with conflicts and everything!



回答2:

if you want method dependency (calll hirearchy) viewer, it is descripted: http://netbeans.dzone.com/announcements/new-class-visualization-module

in plugin manager add update center: http://updates.netbeans.org/netbeans/updates/dev/uc/final/main/catalog.xml.gz and http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/nbms/updates.xml.gz

now you can install

Graphical Class View

Version: 1.4 Source: Latest Development Build
Plugin Description Provides a diagram of Java classes showing interdependencies between fields and methods in that class. Useful for quickly figuring out what are the important methods and fields in an unfamiliar Java class.

you can invoke right click to method -> graphical view,

is it ? Jirka