PlotConstantForm.js
1.63 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
/**
* Project : AMDA-NG
* Name : PlotConstantForm.js
* @class amdaPlotComp.PlotConstantForm
* @extends amdaPlotComp.PlotStandardForm
* @brief Form to define specifics Text legend options
* @author Benjamin Renard
* @version $Id: PlotConstantForm.js benjamin $
*/
Ext.define('amdaPlotComp.PlotConstantForm', {
extend: 'amdaPlotComp.PlotStandardForm',
setObject : function(object) {
this.object = object;
if (this.object != null)
this.loadRecord(this.object);
this.updateOptions(this.object.get('constant-axis-id'), this.crtTree.getSelectedPlotType());
},
updateOptions: function(axisId, plotType) {
var timeValueField = this.getForm().findField('constant-time-value');
var floatValueField = this.getForm().findField('constant-float-value');
var isTimePlot = (plotType == 'timePlot');
timeValueField.setVisible(isTimePlot && (axisId == "x"));
floatValueField.setVisible(!(isTimePlot && (axisId == "x")));
},
getFormItems: function() {
var me = this;
return [
this.addStandardCombo('constant-axis-id', 'Axis attachment', amdaPlotObj.PlotObjectConfig.availableConstantAxes, function (name, value, oldValue) {
if (me.object.get('constant-axis-id') != value)
{
me.updateOptions(value, me.crtTree.getSelectedPlotType());
me.object.set('constant-axis-id', value);
me.crtTree.refresh();
}
}),
this.addStandardDate('constant-time-value', 'Value'),
this.addStandardText('constant-float-value', 'Value'),
this.addStandardFieldSet('Line', '', this.addStandardLineItems('constant-line'))
];
}
});