Blame view

js/app/models/PlotObjects/PlotTreeNode.js 6.13 KB
437c4dbc   Benjamin Renard   First implementat...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/**
 * Project      : AMDA-NG
 * Name         : PlotTreeNode.js
 * @class   amdaPlotObj.PlotTreeNode
 * @extends Ext.data.Model
 * @brief   Plot Tree Node Definition 
 * @author  Benjamin Renard
 * @version $Id: PlotTreeNode.js benjamin $
 ******************************************************************************
 *    FT Id     :   Date   : Name - Description
 ******************************************************************************
 *	:           :23/07/2015: BRE  - file creation
 */

Ext.define('amdaPlotObj.PlotTreeNode', {
	extend: 'Ext.data.Model', 	
    
dbb7bcbe   Benjamin Renard   Add curves defint...
18
19
20
21
	requires: [
	           'amdaPlotObj.PlotObjectConfig'
	],
	
437c4dbc   Benjamin Renard   First implementat...
22
23
24
25
26
27
28
29
30
31
32
33
	//Node type
	type: '',
	
	//Node text
	text: '',
	
	//Node icon class
	iconCls: '',
	
	//Node leaf
	leaf: false,
	
abe09878   Benjamin Renard   Add panels and ax...
34
35
36
	//Node expanded
	expanded : true,
	
17433635   Benjamin Renard   Add series and sp...
37
38
39
	//Node can be removed by user
	removable : false,
	
437c4dbc   Benjamin Renard   First implementat...
40
41
42
	//Link to the object associated to this node 
	object: null,
	
abe09878   Benjamin Renard   Add panels and ax...
43
44
45
	//Additional information about a node to show in the tree view
	getAdditionalText : null,
	
437c4dbc   Benjamin Renard   First implementat...
46
47
48
49
50
51
	constructor : function(config)
    {
		this.callParent(arguments);
		this.set('text',this.text);
		this.set('iconCls',this.iconCls);
		this.set('leaf',this.leaf);
abe09878   Benjamin Renard   Add panels and ax...
52
53
		this.set('expanded',this.expanded);
		this.set('type',this.type);
17433635   Benjamin Renard   Add series and sp...
54
		this.set('removable',this.removable);
437c4dbc   Benjamin Renard   First implementat...
55
56
57
58
59
60
61
62
63
64
65
66
67
68
		if (config && config.object)
			this.object = config.object;
    }	
}, function () {
    Ext.data.NodeInterface.decorate(this);
});

Ext.define('amdaPlotObj.PlotPageTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	iconCls: 'icon-plot-page',
	
	text: 'Page',
	
abe09878   Benjamin Renard   Add panels and ax...
69
70
71
72
	type: 'page',
	
	getAdditionalText: function()
	{
fd5552a4   Benjamin Renard   Info for plot ele...
73
		return ' ('+this.object.getPageShortInfo()+')';
abe09878   Benjamin Renard   Add panels and ax...
74
	}
437c4dbc   Benjamin Renard   First implementat...
75
76
77
78
79
80
81
82
83
84
85
});

Ext.define('amdaPlotObj.PlotLayoutTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	leaf: true,
	
	iconCls: 'icon-plot-layout',
	
	text: 'Layout',
	
003ba315   Benjamin Renard   Add Epoch Plot an...
86
87
88
89
	type: 'layout',
	
	getAdditionalText: function()
	{
fd5552a4   Benjamin Renard   Info for plot ele...
90
		return ' ('+this.object.getLayoutShortInfo()+')';
003ba315   Benjamin Renard   Add Epoch Plot an...
91
	}
437c4dbc   Benjamin Renard   First implementat...
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
});

Ext.define('amdaPlotObj.PlotPanelsTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	iconCls: 'icon-plot-panels',
	
	text: 'Panels list',
	
	type: 'panels'
});

Ext.define('amdaPlotObj.PlotPanelTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	iconCls: 'icon-plot-panel',
	
	text: 'Panel',
	
abe09878   Benjamin Renard   Add panels and ax...
111
112
	type: 'panel',
	
17433635   Benjamin Renard   Add series and sp...
113
114
	removable: true,
	
abe09878   Benjamin Renard   Add panels and ax...
115
116
	getAdditionalText: function()
	{
fd5552a4   Benjamin Renard   Info for plot ele...
117
		return ' ('+this.object.getPanelShortInfo()+')';
abe09878   Benjamin Renard   Add panels and ax...
118
	}
437c4dbc   Benjamin Renard   First implementat...
119
120
});

abe09878   Benjamin Renard   Add panels and ax...
121
Ext.define('amdaPlotObj.PlotAxesTreeNode', {
437c4dbc   Benjamin Renard   First implementat...
122
123
	extend: 'amdaPlotObj.PlotTreeNode',
	
abe09878   Benjamin Renard   Add panels and ax...
124
	expanded: false,
437c4dbc   Benjamin Renard   First implementat...
125
	
abe09878   Benjamin Renard   Add panels and ax...
126
	iconCls: 'icon-plot-axes',
437c4dbc   Benjamin Renard   First implementat...
127
	
abe09878   Benjamin Renard   Add panels and ax...
128
129
130
	text: 'Axes',
	
	type: 'axes'
437c4dbc   Benjamin Renard   First implementat...
131
132
133
134
135
});

Ext.define('amdaPlotObj.PlotTimeAxisTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
abe09878   Benjamin Renard   Add panels and ax...
136
137
	leaf: true,
	
437c4dbc   Benjamin Renard   First implementat...
138
139
140
141
142
143
144
	iconCls: 'icon-plot-axis-t',
	
	text: 'Time Axis',
	
	type: 'time-axis'
});

abe09878   Benjamin Renard   Add panels and ax...
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
Ext.define('amdaPlotObj.PlotEpochAxisTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	leaf: true,
	
	iconCls: 'icon-plot-axis-e',
	
	text: 'Epoch Axis',
	
	type: 'epoch-axis'
});

Ext.define('amdaPlotObj.PlotXAxisTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	leaf: true,
	
	iconCls: 'icon-plot-axis-x',
	
	text: 'X Axis',
	
	type: 'x-axis'
});

Ext.define('amdaPlotObj.PlotYLeftAxisTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	leaf: true,
	
	iconCls: 'icon-plot-axis-y-left',
	
	text: 'Y Left Axis',
	
	type: 'y-left-axis'
});

Ext.define('amdaPlotObj.PlotYRightAxisTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	leaf: true,
	
	iconCls: 'icon-plot-axis-y-right',
	
	text: 'Y Right Axis',
	
	type: 'y-right-axis'
});

Ext.define('amdaPlotObj.PlotColorAxisTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	leaf: true,
	
	iconCls: 'icon-plot-axis-color',
	
	text: 'Color Axis',
	
	type: 'color-axis'
});

17433635   Benjamin Renard   Add series and sp...
205
206
207
208
209
210
211
212
213
Ext.define('amdaPlotObj.PlotParamsTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	iconCls: 'icon-plot-params',
	
	text: 'Params',
	
	type: 'params'
});
abe09878   Benjamin Renard   Add panels and ax...
214

17433635   Benjamin Renard   Add series and sp...
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
Ext.define('amdaPlotObj.PlotParamTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	leaf: true,
	
	//iconCls: 'icon-plot-params',
	
	text: '',
	
	type: 'param',
	
	removable: true,
	
	getAdditionalText: function()
	{
dbb7bcbe   Benjamin Renard   Add curves defint...
230
231
		var parentNode = this.parentNode;
		var plotType = parentNode.object.get('panel-plot-type');
fd5552a4   Benjamin Renard   Info for plot ele...
232
		return this.object.getShortInfo(plotType);
17433635   Benjamin Renard   Add series and sp...
233
234
	}
});
abe09878   Benjamin Renard   Add panels and ax...
235

94abdb37   Benjamin Renard   Add params legend...
236
237
238
239
240
241
242
243
244
245
246
247
Ext.define('amdaPlotObj.PlotAdditionalObjectsTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	expanded: false,
	
	iconCls: 'icon-plot-add-objs',
	
	text: 'Additional Objects',
	
	type: 'objects'
});

437c4dbc   Benjamin Renard   First implementat...
248
249
250
Ext.define('amdaPlotObj.PlotLegendsTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
94abdb37   Benjamin Renard   Add params legend...
251
	iconCls: 'icon-plot-add-legends',
437c4dbc   Benjamin Renard   First implementat...
252
253
254
255
256
	
	text: 'Legends',
	
	type: 'legends'
});
94abdb37   Benjamin Renard   Add params legend...
257
258
259
260
261
262
263
264
265
266

Ext.define('amdaPlotObj.PlotSeriesLegendTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	leaf: true,
	
	iconCls: 'icon-plot-add-legend-series',
	
	text: 'Series Legend',
	
dbb7bcbe   Benjamin Renard   Add curves defint...
267
268
269
270
	type: 'series-legend',
	
	getAdditionalText: function()
	{
fd5552a4   Benjamin Renard   Info for plot ele...
271
272
273
		if (this.object.get('panel-legend-series'))
			return ' ('+this.object.get('panel-legend-series').getShortInfo()+')';
		return '';
dbb7bcbe   Benjamin Renard   Add curves defint...
274
	}
94abdb37   Benjamin Renard   Add params legend...
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
});

Ext.define('amdaPlotObj.PlotTextLegendsTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	iconCls: 'icon-plot-add-legends-text',
	
	text: 'Text Legends',
	
	type: 'text-legends'
});

Ext.define('amdaPlotObj.PlotTextLegendTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	leaf: true,
	
	iconCls: 'icon-plot-add-legend-text',
	
	text: 'Text Legend',
	
339866c4   Benjamin Renard   Add text legend d...
296
297
	type: 'text-legend',
	
dbb7bcbe   Benjamin Renard   Add curves defint...
298
299
300
301
	removable: true,
	
	getAdditionalText: function()
	{
fd5552a4   Benjamin Renard   Info for plot ele...
302
		return ' ('+this.object.getShortInfo()+')';
dbb7bcbe   Benjamin Renard   Add curves defint...
303
	}
94abdb37   Benjamin Renard   Add params legend...
304
305
});

829160b3   Benjamin Renard   Add constants def...
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
Ext.define('amdaPlotObj.PlotDrawingObjectsTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	iconCls: 'icon-plot-add-drawing-objs',
	
	text: 'Drawing objects',
	
	type: 'drawing-objects'
});

Ext.define('amdaPlotObj.PlotConstantTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	leaf: true,
	
	iconCls: 'icon-plot-add-drawing-constant',
	
	text: 'Constant',
	
	type: 'constant',
	
dbb7bcbe   Benjamin Renard   Add curves defint...
327
328
329
330
	removable: true,
	
	getAdditionalText: function()
	{
fd5552a4   Benjamin Renard   Info for plot ele...
331
		return ' ('+this.object.getShortInfo()+')';
dbb7bcbe   Benjamin Renard   Add curves defint...
332
	}
829160b3   Benjamin Renard   Add constants def...
333
334
});

a8c54fb9   Benjamin Renard   Add text object p...
335
336
337
338
339
340
341
342
343
344
345
346
347
Ext.define('amdaPlotObj.PlotTextTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	leaf: true,
	
	iconCls: 'icon-plot-add-drawing-text',
	
	text: 'Text',
	
	type: 'text-obj',
	
	removable: true
});
dbb7bcbe   Benjamin Renard   Add curves defint...
348
349
350
351
352
353
354
355
356
357
358
359
360
361

Ext.define('amdaPlotObj.PlotCurveTreeNode', {
	extend: 'amdaPlotObj.PlotTreeNode',
	
	leaf: true,
	
	iconCls: 'icon-plot-add-drawing-curve',
	
	text: 'Curve',
	
	type: 'curve',
	
	removable: true
});