FileDocCategorySizeDatePackage
TreeWriter.javaAPI DocExample4027Wed Apr 19 11:17:10 BST 2000com.sun.tools.doclets.standard

TreeWriter

public class TreeWriter extends AbstractTreeWriter
Generate Class Hierarchy page for all the Classes in this run. Use {@link com.sun.tools.doclets.ClassTree} for building the Tree. The name of the generated file is "overview-tree.html" and it is generated in the current or the destination directory.
author
Atul M Dambalkar

Fields Summary
private PackageDoc[]
packages
Packages in this run.
private boolean
classesonly
True if there are no packages specified on the command line, False otherwise.
Constructors Summary
public TreeWriter(String filename, ClassTree classtree)
Constructor to construct TreeWriter object.

param
file String filename
param
classtree Tree built using {@link com.sun.tools.doclets.ClassTree}.

        super(filename, classtree);
        packages = Standard.configuration().packages;
	classesonly = packages.length == 0;
    
Methods Summary
public static voidgenerate(ClassTree classtree)
Create a TreeWriter object and use it to generate the "overview-tree.html" file.

param
classtree {@link com.sun.tools.doclets.ClassTree}.

        TreeWriter treegen;
        String filename = "overview-tree.html";
        try {
            treegen = new TreeWriter(filename, classtree); 
            treegen.generateTreeFile();
            treegen.close();
        } catch (IOException exc) {
            Standard.configuration().standardmessage.
                error("doclet.exception_encountered", exc.toString(), filename);
            throw new DocletAbortException();
        }
    
public voidgenerateTreeFile()
Print the interface hierarchy and class hierarchy in the file.

        printHeader(getText("doclet.Window_Class_Hierarchy",
                            Standard.configuration().windowtitle));
        printTreeHeader();

        printPageHeading();
    
        printPackageTreeLinks();

        generateTree(classtree.baseclasses(), "doclet.Class_Hierarchy"); 
        generateTree(classtree.baseinterfaces(), "doclet.Interface_Hierarchy"); 

        printTreeFooter();
    
protected voidprintPackageTreeLinks()
Generate the links to all the package tree files.

        if (!classesonly) {
            dl();
            dt();
            boldText("doclet.Package_Hierarchies");
            dd();
            for (int i = 0; i < packages.length; i++) {
                String filename = pathString(packages[i], "package-tree.html");
                printHyperLink(filename, "", packages[i].name());
                if (i < packages.length - 1) {
                    print(", ");
                }
            }
            dlEnd();
            hr();
        }
    
protected voidprintPageHeading()
Print the page title "Hierarchy For All Packages" at the top of the tree page.

        center();
        h2();
        printText("doclet.Hierarchy_For_All_Packages");
        h2End();
        centerEnd();
    
protected voidprintTreeFooter()
Print the navigation bar links at the bottom.

        hr(); 
        navLinks(false);
        printBottom();
        printBodyHtmlEnd();
    
protected voidprintTreeHeader()
Print the navigation bar links at the top.

        navLinks(true);
        hr();