blob: e7180d2895613ccfc34029e4880049de0d13ca40 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
/*
* Copyright:
* (C) 2006 by Derrell Lipman
* All rights reserved
*
* License:
* LGPL 2.1: http://creativecommons.org/licenses/LGPL/2.1/
*/
/**
* This class defines a module descriptor (the registration of a module) and
* maintains the list of modules that have been registered.
*
* A Module object contains the following public properties which may be
* accessed directly by name:
*
* fsm -
* The finite state machine for this module.
*
* canvas -
* The canvas on which to create the gui for this module
*
* name -
* The name of this module
*
* class -
* The class for this module
*
* @param moduleName {string}
* The name of the module being registered. This is the name that will
* appear in the Modules menu.
*
* @param class {class}
* The class which contains the module implementation. That class must
* extend swat.module.AbstractModule and implement a singleton interface
* that provides a public method called initialAppear() which takes this
* Module object as a parameter, and creates the finite state machine for
* the module (if applicable) and builds the graphical user interface for
* the module.
*/
qx.OO.defineClass("swat.module.Module", qx.core.Object,
function(moduleName, class)
{
qx.core.Object.call(this);
// Initialize commonly-used properties of a module
this.canvas = null;
this.fsm = null;
this.gui = null;
// Save the module name
this.name = moduleName;
// Save this class name
this.class = class;
// Add this new module to the module list.
swat.module.Module._list[moduleName] = this;
});
/**
* Return the list of modules
*/
qx.Class.getList = function()
{
return swat.module.Module._list;
};
/**
* The list of modules which have been registered.
*/
qx.Class._list = { };
|