PlotTabContent.js
3.73 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
/**
* Project : AMDA-NG
* Name : PlotTab.js
* @class amdaPlotComp.PlotTab
* @extends Ext.form.Panel
* @brief Tab content to define a plot
* @author Benjamin Renard
* @version $Id: PlotTab.js benjamin $
*/
Ext.define('amdaPlotComp.PlotTabContent', {
extend: 'Ext.form.Panel',
requires: [
'amdaUI.TimeSelectorUI',
'amdaPlotComp.PlotTree',
'amdaPlotComp.PlotOutputForm',
'amdaPlotComp.PlotElementPanel'
],
//Link to the Plot Node
plotNode: null,
timeSelector: null,
plotTree: null,
plotElement: null,
plotOutput: null,
constructor: function(config) {
this.init(config);
this.callParent(arguments);
},
setTime : function(startDate, stopDate) {
this.timeSelector.intervalSel.setInterval(startDate, stopDate);
},
updateTimeObject : function() {
var timeSource = this.timeSelector.getActiveTimeSource();
var tabForm = this.getForm();
tabForm.updateRecord(this.plotNode.get('object'));
this.plotNode.get('object').set('timesrc', timeSource);
if (timeSource === amdaModel.AmdaTimeObject.inputTimeSrc[0])
this.plotNode.get('object').set('timeTables',this.timeSelector.TTGrid.getStore().data.items);
},
doPlot : function() {
this.plotNode.execute();
},
init : function(config) {
var me = this;
me.plotNode = config.plotNode;
this.timeSelector = new amdaUI.TimeSelectorUI( { id: 'plotTimeSelectorTab' + me.plotNode.id, border : false, flex: 6, collapsible: true, collapseDirection : 'bottom'} );
this.plotElement = new amdaPlotComp.PlotElementPanel({flex: 11});
this.treePlot = new amdaPlotComp.PlotTree({flex: 11, plotElementPanel: this.plotElement});
this.plotOutput = new amdaPlotComp.PlotOutputForm({flex: 6, collapseDirection : 'bottom', collapsible : true });
var treePanel = new Ext.form.Panel({
flex: 1,
layout: {
type: 'vbox',
pack: 'start',
align: 'stretch'
},
bodyStyle: { background : '#dfe8f6' },
defaults: {
border: false
},
items: [
this.treePlot,
this.timeSelector
]
});
var optionsPanel = new Ext.form.Panel({
flex: 1,
layout: {
type: 'vbox',
pack: 'start',
align: 'stretch'
},
bodyStyle: { background : '#dfe8f6' },
defaults: {
border: false
},
items: [
this.plotElement,
this.plotOutput
]
});
var myConf = {
bodyStyle: { background : '#dfe8f6' },
border : false,
defaults: {
border: false
},
layout: {
type: 'hbox',
pack: 'start',
align: 'stretch'
},
items: [
treePanel,
optionsPanel
],
listeners: {
afterrender: function(comp, eOpts) {
this.plotOutput.setObject(this.plotNode.get('object'));
this.timeSelector.intervalSel.setInterval(this.plotNode.get('object').get('startDate'), this.plotNode.get('object').get('stopDate'));
this.timeSelector.setTTTab(this.plotNode.get('object').get('timeTables'));
this.treePlot.buildTree(this.plotNode.get('object'));
},
scope: this
}
};
Ext.apply (this , Ext.apply (arguments, myConf));
}
});