3 * (C) 2006 by Derrell Lipman
7 * LGPL 2.1: http://creativecommons.org/licenses/LGPL/2.1/
11 #require(swat.module.AbstractModule)
12 #require(swat.module.statistics.Statistics)
13 #require(swat.module.documentation.Documentation)
20 qx.OO.defineClass("swat.main.Main", qx.component.AbstractApplication,
23 qx.component.AbstractApplication.call(this);
27 * The list of supported modules
38 "class" : swat.module.statistics.Statistics
45 "class" : swat.module.documentation.Documentation
52 ---------------------------------------------------------------------------
54 ---------------------------------------------------------------------------
57 qx.Proto.initialize = function()
59 var modules = swat.main.Main.modules;
61 // Set the resource URI
62 qx.Settings.setCustom("resourceUri", "./resource");
64 // Turn on JSON debugging for the time being
65 qx.Settings.setCustomOfClass("qx.io.Json", "enableDebug", true);
68 for (moduleName in modules.list)
70 // ... add the module's name to the module object, ...
71 modules.list[moduleName].name = moduleName;
73 // ... and call the module's buildInitialFsm() function
74 var module = modules.list[moduleName]["class"].getInstance();
75 module.buildInitialFsm(modules.list[moduleName]);
80 qx.Proto.main = function()
82 var modules = swat.main.Main.modules;
84 // Initialize the gui for the main menu
85 swat.main.Gui.buildGui(modules);
87 // Similarly, now that we have a canvas for each module, ...
88 for (moduleName in modules.list)
90 // ... call the module's buildInitialGui() function
91 var module = modules.list[moduleName]["class"].getInstance();
92 module.buildInitialGui(modules.list[moduleName]);
97 qx.Proto.finalize = function()
99 var modules = swat.main.Main.modules;
101 // Call each module's finalization function
102 for (moduleName in modules.list)
104 var module = modules.list[moduleName]["class"].getInstance();
105 module.finalize(modules.list[moduleName]);