The fourth programming project involves writing a program that accepts information contained in a file about the class dependencies in a Java program and creates a directed graph from that information. From the directed graph, it produces two different kinds of displays of those dependency relationships.
The first name of each line of the file is a Java class upon which other classes depend. The remaining names are
the classes that depend upon the first class on that line. The first line of the above file, for example, indicates
that ClassA has three classes that depend upon it, ClassC, ClassE and ClassJ. A class that have does any
classes that depend on it, need not appear at the head of any line.
The main method in the class for this project should allow user select the input file from the default directory by
using the JFileChooser class. It should then add the edges to a directed graph that defines these class
A second class, DirectedGraph, should be a generic class, whose generic parameter specifies the type of the
labels that are associated with the vertices of the graph. The internal representation of the graph should be the
alternate adjacency list representation illustrated in Figure 10.7 of our textbook Object-Oriented Data
Structures Using Java. Unlike that graph, however, this graph will not be a weighted graph.
Get Free Quote!
345 Experts Online