Blame view

js/app/views/PlotComponents/PlotHistogram1DSerieForm.js 3.37 KB
2ac3a3f9   Erdogan Furkan   For now, histo1D ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
 * Project   : TMA-AMDA
 * Name      : PlotHistogram1DSerieForm.js
 * @class   amdaPlotComp.PlotHistogram1DSerieForm
 * @extends amdaPlotComp.PlotBaseSerieForm
 * @brief   Form to define specifics histogram1d serie options
 * @author  Furkan Erdogan
 * @version $Id: PlotHistogram1DSerieForm.js furkan $
 */

Ext.define('amdaPlotComp.PlotHistogram1DSerieForm', {
	extend: 'amdaPlotComp.PlotBaseSerieForm',

	setObject: function (object) {
		this.callParent(arguments);
ac2e2d61   Furkan   #11372 - Adding n...
16
		this.updateOptions(this.object.get('histo1d-function'));
2ac3a3f9   Erdogan Furkan   For now, histo1D ...
17
18
19
20
21
22
23
    },

	setParentObject: function (parentObject) {
		this.callParent(arguments);
		this.updateAxesRanges(parentObject);

	},
ac2e2d61   Furkan   #11372 - Adding n...
24
25
	updateOptions: function(functionType) {
		var isDensity = (functionType == 'density') || (functionType == 'normdensity');
2ac3a3f9   Erdogan Furkan   For now, histo1D ...
26

ac2e2d61   Furkan   #11372 - Adding n...
27
28
29
		var yParamField = this.getForm().findField('histotype-param');
		yParamField.setVisible(!isDensity)
	},
2ac3a3f9   Erdogan Furkan   For now, histo1D ...
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
	updateAxesRanges: function(parentObject) {
		var xAxisObj = parentObject.axes().getById('xaxis_id');
		
		this.getForm().findField('histo1d-xmin').setValue(xAxisObj.get('axis-range-min'));
		this.getForm().findField('histo1d-xmax').setValue(xAxisObj.get('axis-range-max'));
	},

	getRangeForms: function(){
		var me = this;
		return {
			xtype: 'fieldset',
			bodyStyle: { background: '#dfe8f6' },
			title: 'X ranges',
			name: 'histo1d-ranges',
			renderTo: Ext.getBody(),
			fieldDefaults: {
				labelAlign: 'right',
				msgTarget: 'side',
				labelWidth: 40,
			},
			defaults: {
				xtype: 'panel',
				bodyStyle: {background: '#dfe8f6'},
				flex: 1,
				border:false,
				layout: 'anchor',
			},
			layout:'hbox',
			frame: true,
			//bodyPadding: '5 5 5 5',
			items: 
			[{
				items:[
					me.addStandardFloat2('histo1d-xmin', 'X Min', -Number.MAX_VALUE, Number.MAX_VALUE, false, false, function(name, newValue, oldValue){
						me.parentObject.axes().getById('xaxis_id').set('axis-range-min', newValue);
					})
				]
			},
			{
				items:[
					me.addStandardFloat2('histo1d-xmax', 'X Max', -Number.MAX_VALUE, Number.MAX_VALUE, false, false, function(name, newValue, oldValue){
						me.parentObject.axes().getById('xaxis_id').set('axis-range-max', newValue);
					})
				]
			}]
		};

	},
	getFormItems: function() {
		var me = this;
		
		var histogram1DItems = [
c4d04b8c   Erdogan Furkan   #11376 - Done.
82
83
84
			this.addStandardCombo('histo1d-style', 'Drawing Style', amdaDefaultConfigs.availableHistogram1DStyles, function(name, value, oldValue) {
				me.object.set('histo1d-style', value);
			}),
2ac3a3f9   Erdogan Furkan   For now, histo1D ...
85
86
87
88
89
90
			// this.addStandardParamDropTarget('serie-xaxis-param', 'X Parameter', function(name, value, oldValue) {
			// 	me.object.set('serie-xaxis-param', value);
        	// 	me.crtTree.refresh();
			// }),
			me.getRangeForms(),
			// this.addStandardCombo('serie-resampling-mode', 'Reference parameter for resampling', amdaDefaultConfigs.availableResamplingModes),
c4d04b8c   Erdogan Furkan   #11376 - Done.
91

2ac3a3f9   Erdogan Furkan   For now, histo1D ...
92
93
			this.addStandardCombo('histo1d-function', 'Function to apply', amdaDefaultConfigs.availableHistogram1DFunctions, function(name, value, oldValue) {
				me.object.set('histo1d-function', value);
ac2e2d61   Furkan   #11372 - Adding n...
94
				me.updateOptions(value);
2ac3a3f9   Erdogan Furkan   For now, histo1D ...
95
			}),
ac2e2d61   Furkan   #11372 - Adding n...
96
97
98
99
100
			this.addStandardParamDropTarget('histotype-param', 'Y Parameter', function(name, value, oldValue) {
				me.object.set('histotype-param', value);
        		me.crtTree.refresh();
			}),

2ac3a3f9   Erdogan Furkan   For now, histo1D ...
101
102
103
104
105
106
107
			this.addStandardInteger('histo1d-xbinnumber', 'Nb. of bins'),
			this.addColorsPicker('histo1d-color', 'Color', amdaDefaultConfigs.availableColorsNew, 'none')
			
		];
		return histogram1DItems;
	}
});