/Users/lyon/j4p/src/graphics/graph/Main.java

1    package graphics.graph; 
2     
3    import classUtils.reflection.TypeUtil; 
4     
5    import java.awt.*; 
6     
7    /** 
8     *  Start up the application. 
9     */ 
10   public class Main { 
11       public static void main(String args[]) { 
12           ControlPanel g = new ControlPanel(); 
13           g = setupGraph(); 
14           setupFrame(g); 
15           System.out.println("g.start"); 
16       } 
17    
18       private static void setupFrame(ControlPanel cp) { 
19           ClosableFrame f = new ClosableFrame(); 
20           f.setSize(400, 400); 
21           f.setLayout(new BorderLayout()); 
22           f.add(cp.getControlPanel(), 
23                   BorderLayout.SOUTH); 
24           f.add(cp.getImagePanel(), 
25                   BorderLayout.CENTER); 
26           f.setVisible(true); 
27           cp.start(); 
28       } 
29    
30       private static ControlPanel 
31               setupGraph2(ControlPanel g, Object o) { 
32           addClass(o.getClass(), g); 
33           return g; 
34       } 
35    
36       private static void addClass(Class c, ControlPanel g) { 
37           String s; 
38           TypeUtil tu; 
39           s = TypeUtil.getTypeName(c); 
40           tu = new TypeUtil(c); 
41           tu.addClassesAndInterfaces(); 
42           // tu.initAllFriends(); 
43           add(g, s, tu.getAllClasses()); 
44       } 
45    
46       private static void add(ControlPanel cp, String s, Class ca[]) { 
47           for (int i = 0; i < ca.length; i++) { 
48               String cn = TypeUtil.getTypeName(ca[i]); 
49               cp.addEdge(s, cn); 
50           } 
51       } 
52    
53       private static ControlPanel setupGraph() { 
54           ControlPanel g = new ControlPanel(); 
55           String s = "net.AtomicClock"; 
56           g.addEdge(s, "net.AutoServer"); 
57           g.addEdge(s, "gui.html.Browser"); 
58           g.addEdge(s, "addBk.addressBook.CSVExport"); 
59           g.addEdge(s, "addBk.addressBook.CSVMerge"); 
60           g.addEdge(s, "net.web.ChartServer"); 
61           g.addEdge(s, "net.ComputeServer"); 
62           g.addEdge(s, "net.ComputeThread"); 
63           g.addEdge(s, "futils.CsvReader"); 
64           g.addEdge(s, "net.DateServer"); 
65           g.addEdge(s, "utils.Dos"); 
66           g.addEdge(s, "addBk.addressBook.DosDialer"); 
67    
68           s = "futils.Futil"; 
69           g.addEdge(s, "net.MainServer"); 
70           g.addEdge(s, "futils.ReaderUtils"); 
71           g.addEdge(s, "net.RemoteClassLoader"); 
72           g.addEdge(s, "futils.SerializeTest"); 
73           g.addEdge(s, "futils.SimpleWriter"); 
74           g.addEdge(s, "net.Smtp"); 
75           g.addEdge(s, "futils.StreamSniffer"); 
76           g.addEdge(s, "net.web.WebServer"); 
77           g.addEdge(s, "ip.gif.WriteGIF"); 
78           g.addEdge(s, "xml.Xml2Cart"); 
79    
80           s = "net.web.ChartServer"; 
81           g.addEdge(s, "graphics.ImageFrame"); 
82           g.addEdge(s, "graphics.ImageUtils"); 
83           g.addEdge(s, "graphics.sprials.Spirals"); 
84           g.addEdge(s, "ip.gif.WriteGIF"); 
85    
86    
87           s = "graphics.ImageUtils"; 
88           g.addEdge(s, "net.web.ChartServer"); 
89           g.addEdge(s, "graphics.ImageFrame"); 
90           g.addEdge(s, "graphics.ImageUtils"); 
91           g.addEdge(s, "graphics.sprials.Spirals"); 
92    
93    
94           g.start(); 
95           return g; 
96       } 
97   }