summaryrefslogtreecommitdiff
path: root/webapps/swat/source/class/swat/main/Main.js
diff options
context:
space:
mode:
Diffstat (limited to 'webapps/swat/source/class/swat/main/Main.js')
-rw-r--r--webapps/swat/source/class/swat/main/Main.js94
1 files changed, 94 insertions, 0 deletions
diff --git a/webapps/swat/source/class/swat/main/Main.js b/webapps/swat/source/class/swat/main/Main.js
new file mode 100644
index 0000000000..dc3bbc031e
--- /dev/null
+++ b/webapps/swat/source/class/swat/main/Main.js
@@ -0,0 +1,94 @@
+/*
+ * Copyright:
+ * (C) 2006 by Derrell Lipman
+ * All rights reserved
+ *
+ * License:
+ * LGPL 2.1: http://creativecommons.org/licenses/LGPL/2.1/
+ */
+
+/*
+#require(swat.module.Module)
+#require(swat.module.AbstractModule)
+*/
+
+/**
+ * Swat main menu
+ */
+qx.OO.defineClass("swat.main.Main", qx.component.AbstractApplication,
+function()
+{
+ qx.component.AbstractApplication.call(this);
+});
+
+/*
+ * Register our supported modules
+ */
+
+//#require(swat.module.statistics.Statistics)
+new swat.module.Module("Statistics",
+ swat.module.statistics.Statistics);
+
+//#require(swat.module.ldbbrowse.LdbBrowse)
+new swat.module.Module("LDB Browser",
+ swat.module.ldbbrowse.LdbBrowse);
+
+//#require(swat.module.documentation.Documentation)
+//#require(api.Viewer)
+new swat.module.Module("API Documentation",
+ swat.module.documentation.Documentation);
+
+
+/*
+---------------------------------------------------------------------------
+ METHODS
+---------------------------------------------------------------------------
+*/
+
+qx.Proto.initialize = function()
+{
+ // Set the resource URI
+ qx.Settings.setCustom("resourceUri", "./resource");
+
+ // Turn on JSON debugging for the time being
+ qx.Settings.setCustomOfClass("qx.io.Json", "enableDebug", true);
+
+ // For each module...
+ var moduleList = swat.module.Module.getList();
+ for (moduleName in moduleList)
+ {
+ // ... call the module's buildInitialFsm() function
+ var module = moduleList[moduleName]["class"].getInstance();
+ module.buildInitialFsm(moduleList[moduleName]);
+ }
+};
+
+
+qx.Proto.main = function()
+{
+ var moduleList = swat.module.Module.getList();
+
+ // Initialize the gui for the main menu
+ swat.main.Gui.buildGui(moduleList);
+
+ // Similarly, now that we have a canvas for each module, ...
+ for (moduleName in moduleList)
+ {
+ // ... call the module's buildInitialGui() function
+ var module = moduleList[moduleName]["class"].getInstance();
+ module.buildInitialGui(moduleList[moduleName]);
+ }
+};
+
+
+qx.Proto.finalize = function()
+{
+ // Call each module's finalization function
+ var moduleList = swat.module.Module.getList();
+ for (moduleName in moduleList)
+ {
+ var module = moduleList[moduleName]["class"].getInstance();
+ module.finalize(moduleList[moduleName]);
+ }
+};
+