Reputation: 13
For a student project I need to extend a Java project. The problem is that this project doesn't have a lot of comments and it's hard to analyze it. I'm searching for something to generate a class diagram and, if possible, a sequence diagram.
I have already tried umbrello
(but there are some bugs with big classes) and agilej
but the project has a lot of packages and sub-packages and I did not find how to generate the diagram recursively.
Are there other tools to do this?
Thank you in advance.
Upvotes: 1
Views: 331
Reputation: 11
In Eclipse you have the option to set the package presentation to Flat or Hierarchical. In the flat mode you see the fully qualified name of each package under the src/ folder, and in the hierarchical mode you have to expand to see src/com/mypackage etc. In AgileJ when you are in flat mode (the default mode for Eclipse) then whatever you drag from the package explorer, be it a project, folder, library, Java source file, class or whatever, it will recurse down through the ownership tree and add the classes which it finds as you would expect it to do.
The anomaly you describe in you question - not recursing through the sub-packages - happens when you have the package explorer in hierarchy mode. In this case what happens is that the class diagram just receives notification of a drop of a package - but it has no way of knowing the package presentation mode of the package explorer or even if the drag originated from the package explorer.
So if you really want to recurse down through a hierarchy of packages, and for some reason don't want to multiple select them with the package explorer in flat mode, then the easiest thing to do is switch to the Resource perspective and in the Navigator view find the folder which is the parent of all the packages you want to include then drag that onto the class diagram. That will kick off a recursive search for classes down through the sub-packages.
Please note that if you drag in a large enough number of classes (the exact threshold is configurable) then it will offer to filter them down - for example you might want to filter out unit tests or generated classes. If you try to add a really large number of classes (again, it is configurable, but by default it is 200) then you'll be blocked - but what is the point of a single class diagram with 200 classes on it, it will only result in an unreadable class diagram.
Upvotes: 1
Reputation: 1477
Another eclipse plugin is called 'metrics', which you can find on sourceforge. It can provide a bunch of information about a Java project, both in textual and graphical form.
Upvotes: 0