SpecialParamNode.js
3.13 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/**
* Project : AMDA-NG4
* Name : SpecialParamNode.js
* @class amdaModel.SpecialParamNode
* @extends amdaModel.InteractiveNode
* @brief
* @author
* @version $Id: MyDataNode.js 2267 2014-04-03 10:13:16Z elena $
* @todo
*******************************************************************************
* FT Id : Date : Name - Description
*******************************************************************************
*
*/
Ext.define('amdaModel.SpecialParamNode', {
extend: 'amdaModel.InteractiveNode',
statics:{
nodeType: 'specialParam'
},
fields:
[
],
dependentRootNodeId : 'specialParam-treeRootNode',
constructor : function(config){
this.callParent(arguments);
this.set('moduleId',myDesktopApp.dynamicModules.param.id);
this.set('objectDataModel',amdaModel.Parameter.$className);
},
localMenuItems : function() {
var menuItems =
[{
fnId: 'leaf-plotParam',
text: 'Plot Parameter',
hidden: true
}, {
fnId: 'leaf-downParam',
text: 'Download Parameter',
hidden: true
}, {
fnId: 'para-plotParam',
text: 'Plot Parameter',
hidden: true
}, {
fnId: 'para-downParam',
text: 'Download Parameter',
hidden: true
},{
fnId : 'leaf-createDerivedParam',
text : 'Create Derived Parameter',
hidden : true
},];
return menuItems;
},
getAllContextMenuItems: function(){
var locMenuItems = this.localMenuItems();
return locMenuItems;
},
onMenuItemClick : function(menu,item,event) {
var fnId = Ext.util.Format.substr(item.fnId, 5, item.fnId.length);
if(item){
switch (item.fnId)
{
case 'root-collapseAll':
case 'dire-collapseAll':
case 'miss-collapseAll':
if(this && !this.isLeaf()) {
this.collapse(true);
}
break;
case 'leaf-createDerivedParam':
this.createLeaf(this);
break;
case 'leaf-plotParam':
case 'para-plotParam':
this.createPlot(this);
break;
case 'leaf-downParam':
case 'para-downParam':
this.createDownload(this);
break;
default:
break;
} // switch end
}
},
createLeaf: function(node)
{
myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.param.id, true, function(module) {
if (!myDesktopApp.desktop.getWindow(myDesktopApp.dynamicModules.param.id)) {
var param = Ext.create(node.get('objectDataModel'));
var newNode = Ext.create(amdaModel.DerivedParamNode.$className, {leaf : true, object : param});
// edit newNode into Parameter Module with node as contextNode
newNode.editInModule();
}
var paramName = node.get('id');
var components = null;
module.addParam(paramName,node.get('leaf'),node.get('needsArgs'),components, null, null);
});
},
});