9

Looking for a tool that:

  • Produces a visually pleasing (not garish), orthogonally structured graph hierarchy
  • Outputs high-quality PNG images (300dpi+)
  • Visually differentiates classes, abstract classes, interfaces, and enumerated types (preferably by colour)
  • Interactive user interface
  • Allows pruning of packages and/or individual classes from the diagram
  • Seeds (e.g., File » Open) using a set of:
    • Directories
    • JAR files
    • Individual source files
    • Individual compiled classes
  • Performs a fully automatic analysis of class dependencies
  • Searches classpath to resolve as many unmet dependencies as possible
  • Uses a single executable
  • Is lightweight (~5MB) and fast (loads in under one second on an average 1.5GHz machine)
  • Is simple (under 10 clicks to generate a graph)
  • Is quick (graph 100 objects in a few seconds)
  • Is easy to use (minimal interface, focused on graph generation)
  • Is OSS or GPL
  • (Optional) Generates a call-graph hierarchy

Tools that will not accomplish this task include:

  • Doxygen + GraphViz (or dot)
  • Eclipse
  • UML modellers
  • Structural Analysis for Java (cannot parse source files)
  • JUDE Community (awkard interface, unsuitable autogeneration)
  • Integrated development environments (too complex, and use too much memory)

Any ideas?

Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315
  • I'll be interested if you find a solution. The programs I know of which are capable of doing all of those things are neither open source, nor lightweight (nor free). – Nick Jul 23 '09 at 04:46
  • My open source library FastClasspathScanner can generate class graph (class hierarchy) visualizations, among other things. The generated graph shows not only edges representing "extends", "implements" and "has annotation" relationships, but also "has field of type". See my answer here: http://stackoverflow.com/a/34354003/3950982 – Luke Hutchison Dec 18 '15 at 10:59

3 Answers3

5

It seems that Class Visualizer meets all your requirements (except of saving diagram as PNG).

Jonatan Kaźmierczak
  • 1,821
  • 2
  • 15
  • 9
  • According to the author http://class-visualizer.net/ is the latest version of the class visualizer. The latest release 0.7.0 only works with Java 7+ – Pratik Khadloya Jul 28 '14 at 22:06
3

The Netbeans UML plugin will cover some of your requirements.

  • Produces a visually appealing graph hierarchy: a matter of taste
  • Writes high-quality PNG images (300dpi+): I don't know
  • Visually differentiates classes, abstract classes, interfaces, and enumerated types: yes it does as it uses UML
  • Interactive user interface: yes
  • Allows pruning of packages and/or individual classes from the diagram: yes
  • Seeds (e.g., File » Open) using a set of: it work with netbeans projects
    • Directories
    • JAR files
    • Individual source files
    • Individual compiled classes
  • Performs a fully automatic analysis: maybe
  • Uses a single executable: not applicable, it's a plugin of Netbeans
  • Is lightweight and fast: like netbeans
  • Is simple, quick, and easy to use: depends of user
  • Is OSS or GPL: I think it is OSS, surely it is free as in free drink
  • (Optional) Generates a call-graph hierarchy (in addition to a class hierarchy): I don't think it does
Andrea Francia
  • 9,737
  • 16
  • 56
  • 70
3

The answer is probably "no such OSS / free application exists". Why? Because:

  1. Most people who want an inheritance diagram for a large number of classes are already working in the context of an IDE or similar. Ergo there is little motivation for OSS developers to produce such a tool.
  2. Automatically creating visually appealing diagrams of large numbers of classes is next to impossible.

I suggest that you relax your requirements. I mean, what is wrong with using a large scale IDE or UML modeller? Memory is cheap. What is wrong with waiting a few seconds to load / run the diagrammer? Patience grasshopper! What high-school student with 2 days of training is going to be looking at source-code base with 10,000+ classes???

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • 2
    My basic points still stands. Your requirements are not likely to be met by any existing OSS product. – Stephen C Jul 23 '09 at 07:52
  • maven with some plugins is probably a better solution. JXR is way more useful than diagrams. –  Mar 16 '11 at 05:18