1 package org.catacomb.dataview;
2
3 import org.catacomb.dataview.build.Dataview;
4 import org.catacomb.dataview.read.ContentReader;
5 import org.catacomb.dataview.read.Importer;
6 import org.catacomb.druid.build.Context;
7 import org.catacomb.druid.gui.base.DruApplication;
8 import org.catacomb.interlish.reflect.ReflectionConstructor;
9
10
11 import java.io.File;
12
13
14 public class DataViewer {
15
16
17 DataviewController controller;
18
19
20 public DataViewer(File fconf) {
21
22 ContentReader dsr = Importer.getReader(fconf);
23
24 Object obj = dsr.getMain();
25
26
27 Dataview dv = (Dataview)obj;
28
29 Context ctxt = new Context();
30
31
32 DruApplication druapp = dv.buildApplication(ctxt);
33
34 druapp.pack();
35 druapp.show();
36
37 controller = new DataviewController(dv);
38 controller.setMainFrame(druapp.getMainFrame());
39
40
41
42
43
44
45 controller.initData(dsr);
46 }
47
48
49
50 public DataviewController getController() {
51 return controller;
52 }
53
54
55
56 public static void main(String[] argv) {
57 ReflectionConstructor.addPath("org.catacomb.dataview.build");
58 new DataViewer(new File(argv[0]));
59 }
60
61
62 }