import java.awt.event.*; import java.awt.*; import javax.swing.*; import java.util.*; import java.io.*; public class DirectoryTree { Dir files; static final int LINEAR=0, LOG=1, EXP=2, SQRT=3; static int scaleMode=LINEAR; static long now = System.currentTimeMillis(); public static void main(String argv[]) { String root; if (argv.length==0) root=System.getProperty("user.dir"); else root=argv[0]; Dir d=getDirectoryTree(root,LINEAR); d.print(); } // computes the directory tree starting at directory "startDir". // The size of each file and directory is computed using linear, // logarithmic, etc. scale as specified by the parameter "mode" static Dir getDirectoryTree(String startDir, int mode) { scaleMode=mode; File f=new File(startDir); return getDirectoryTree(new File[]{f}); } static Dir getDirectoryTree(File[] fa) { Vector v=new Vector(); long size=0; for(int i=0; i