Application to generate Java class hierarchy diagram

20,913

Solution 1

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

Solution 2

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???

Solution 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
Share:
20,913
Dave Jarvis
Author by

Dave Jarvis

https://dave.autonoma.ca/blog/

Updated on July 19, 2022

Comments

  • Dave Jarvis
    Dave Jarvis almost 2 years

    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?

  • Stephen C
    Stephen C almost 15 years
    My basic points still stands. Your requirements are not likely to be met by any existing OSS product.
  • Admin
    Admin over 13 years
    maven with some plugins is probably a better solution. JXR is way more useful than diagrams.
  • Pratik Khadloya
    Pratik Khadloya almost 10 years
    According to the author class-visualizer.net is the latest version of the class visualizer. The latest release 0.7.0 only works with Java 7+