Blame view

js/app/views/PlotComponents/PlotDrawingObjectForm.js 1.55 KB
829160b3   Benjamin Renard   Add constants def...
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
/**
 * Project   : AMDA-NG
 * Name      : PlotDrawingObjectForm.js
 * @class   amdaPlotComp.PlotDrawingObjectForm
 * @extends amdaPlotComp.PlotStandardForm
 * @brief   Form to define a list of text legends
 * @author  Benjamin Renard
 * @version $Id: PlotDrawingObjectForm.js benjamin $
 */

Ext.define('amdaPlotComp.PlotDrawingObjectForm', {
	extend: 'amdaPlotComp.PlotStandardForm',
	
	setObject : function(object) {
		this.object = object;
		if (this.object != null)
			this.loadRecord(this.object);
	},
	
	getFormItems: function() {
		var me = this;
		return [
            {
            	xtype: 'button',
            	text: 'Add new constant',
            	iconCls: 'icon-add',
            	handler : function() {
            		var constantObject = me.object.createNewConstant();
            		me.crtTree.buildPanelAdditionalObjectsNode(me.object, constantObject.get('id'));
            	}
a8c54fb9   Benjamin Renard   Add text object p...
31
32
33
34
35
36
37
38
39
            },
            {
            	xtype: 'button',
            	text: 'Add new text',
            	iconCls: 'icon-add',
            	handler : function() {
            		var textObject = me.object.createNewTextObject();
            		me.crtTree.buildPanelAdditionalObjectsNode(me.object, textObject.get('id'));
            	}
dbb7bcbe   Benjamin Renard   Add curves defint...
40
41
42
43
44
45
46
47
48
            },
            {
            	xtype: 'button',
            	text: 'Add new curve',
            	iconCls: 'icon-add',
            	handler : function() {
            		var curveObject = me.object.createNewCurve();
            		me.crtTree.buildPanelAdditionalObjectsNode(me.object, curveObject.get('id'));
            	}
829160b3   Benjamin Renard   Add constants def...
49
50
51
52
            }
		];
	}
});