NewPlotUI.js
4 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
/**
* Project : AMDA-NG
* Name : NewPlotUI.js
* @class amdaUI.NewPlotUI
* @extends Ext.container.Container
* @brief New Plot Module UI definition (View)
* @author Benjamin Renard
* @version $Id: NewPlotUI.js benjamin $
*/
Ext.define('amdaUI.NewPlotUI', {
extend: 'Ext.container.Container',
alias: 'widget.newPanelPlot',
requires: [
'amdaUI.TimeSelectorUI',
'amdaPlotComp.PlotTabPanel',
'amdaPlotComp.PlotOutputForm',
'amdaPlotComp.PlotElementPanel'
],
formPanel: null,
plotOutput: null,
plotTabs : null,
plotElement : null,
constructor: function(config) {
this.init(config);
this.callParent(arguments);
if (this.object)
{
//Force first tab creation
this.object.setDefaultValues();
this.object.createNewTab();
this.setObject(this.object);
}
},
setObject : function(object) {
this.object = object;
this.plotOutput.setObject(this.object);
this.plotTabs.setRequestObject(this.object);
},
/**
* plot method called by 'Do Plot' button to launch the plot process
*/
doPlot : function(){
// fire execution
var plotModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id);
if (plotModule)
plotModule.linkedNode.execute();
},
/**
* Check if changes were made before closing window
* @return false
*/
fclose : function() {
myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id, true, function (module) {
module.closeInteractiveSession();
});
return false;
},
init : function(config) {
this.timeSelector = new amdaUI.TimeSelectorUI( { id: 'plotTimeSelector' + config.id, flex: 1, hidden: true } );
this.plotOutput = new amdaPlotComp.PlotOutputForm({flex: 2});
this.plotElement = new amdaPlotComp.PlotElementPanel({flex: 3});
this.plotTabs = new amdaPlotComp.PlotTabPanel({flex: 2, plotElementPanel : this.plotElement});
this.optionsPanel = new Ext.form.Panel({
layout: {
type: 'vbox',
pack: 'start',
align: 'stretch'
},
bodyStyle: { background : '#dfe8f6' },
defaults: {
border: false
},
items: [
this.plotElement,
this.plotOutput
]
});
this.formPanel = new Ext.form.Panel({
region: 'center',
layout: {
type: 'hbox',
pack: 'start',
align: 'stretch'
},
bodyStyle: { background : '#dfe8f6' },
defaults: {
border: false
},
items: [
{
xtype : 'panel',
layout: {
type: 'vbox',
pack: 'start',
align: 'stretch'
},
bodyStyle: { background : '#dfe8f6' },
defaults: {
border: false
},
flex: 1,
items: [
this.plotTabs,
this.timeSelector
]
},
{
xtype : 'panel',
layout: 'fit',
bodyStyle: { background : '#dfe8f6' },
defaults: {
border: false
},
flex: 1,
items: [
this.optionsPanel
]
}
],
fbar: [
{
xtype: 'button',
text: 'Plot',
scope: this,
handler: function(button) {
this.doPlot();
}
},
' ',
{ xtype: 'button', text: 'Get Data' },
' ',
{ xtype: 'button', text: 'Reset' },
'->',
{ xtype: 'button', text: 'Save Request' }
]
});
var myConf = {
layout: 'border',
items: [
this.formPanel,
{
xtype: 'panel',
region: 'south',
title: 'Information',
collapsible: true,
height: 100,
autoHide: false,
bodyStyle: 'padding:5px',
iconCls: 'icon-information',
loader: {
autoLoad: true,
url: helpDir+'plotHOWTO'
}
}
]
};
Ext.apply (this , Ext.apply (arguments, myConf));
}
});