Commit 001b071015d5ee65a3f05721230fe801db7c95c6

Authored by Hacene SI HADJ MOHAND
1 parent f8dfaec8

us 6954 ok

js/app/models/PlotObjects/PlotAxisObject.js
... ... @@ -33,8 +33,8 @@ Ext.define('amdaPlotObj.PlotAxisObject', {
33 33 {name: 'axis-color', type: 'string'},
34 34 {name: 'axis-thickness', type: 'int'},
35 35 {name: 'axis-tick-showmarks', type: 'boolean'},
36   - {name: 'axis-grid-spicify-ticks-number', type: 'boolean'},
37   - {name: 'axis-grid-spicify-ticks-spacing', type: 'boolean'},
  36 + {name: 'axis-grid-specify-ticks-number', type: 'boolean'},
  37 + {name: 'axis-grid-specify-ticks-spacing', type: 'boolean'},
38 38 {name: 'axis-tick-position', type: 'string'},
39 39 {name: 'axis-grid-minor', type: 'boolean'},
40 40 {name: 'axis-grid-major', type: 'boolean'},
... ... @@ -100,8 +100,8 @@ Ext.define('amdaPlotObj.PlotAxisObject', {
100 100 this.set('axis-grid-minor-space',0);
101 101 this.set('axis-grid-major-space',0);
102 102 this.set('axis-grid-minor', false);
103   - this.set('axis-grid-spicify-ticks-number', false);
104   - this.set('axis-grid-spicify-ticks-spacing', false);
  103 + this.set('axis-grid-specify-ticks-number', false);
  104 + this.set('axis-grid-specify-ticks-spacing', false);
105 105 this.set('axis-grid-major', false);
106 106 this.set('axis-legend-activated', true);
107 107 this.set('axis-legend-text', '');
... ... @@ -142,8 +142,10 @@ Ext.define('amdaPlotObj.PlotAxisObject', {
142 142 axisValues['axis-grid-major'] = this.get('axis-grid-major');
143 143 axisValues['axis-grid-minor-number']=this.get('axis-grid-minor-number');
144 144 axisValues['axis-grid-major-number']=this.get('axis-grid-major-number');
  145 + axisValues['axis-grid-specify-ticks-number']=this.get('axis-grid-specify-ticks-number');
145 146 axisValues['axis-grid-minor-space']=this.get('axis-grid-minor-space');
146 147 axisValues['axis-grid-major-space']=this.get('axis-grid-major-space');
  148 + axisValues['axis-grid-specify-ticks-spacing']=this.get('axis-grid-specify-ticks-spacing');
147 149 axisValues['axis-legend-activated'] = this.get('axis-legend-activated');
148 150 axisValues['axis-legend-text'] = this.get('axis-legend-text');
149 151 axisValues['axis-legend-color'] = this.get('axis-legend-color');
... ...
js/app/views/PlotComponents/PlotBaseAxisForm.js
... ... @@ -15,8 +15,11 @@ Ext.define('amdaPlotComp.PlotBaseAxisForm', {
15 15 showColorOption : true,
16 16 showRangeOptions : true,
17 17 showTickGridOptions : true,
  18 + disableTicksSpacing : true,
  19 + disableTicksNumbers : true,
18 20  
19 21 getFormItems: function() {
  22 + var me = this;
20 23 var rangeItems = [
21 24 this.addStandardFloat2('axis-range-min', 'Min', -Number.MAX_VALUE, Number.MAX_VALUE),
22 25 this.addStandardFloat2('axis-range-max', 'Max', -Number.MAX_VALUE, Number.MAX_VALUE),
... ... @@ -28,18 +31,37 @@ Ext.define('amdaPlotComp.PlotBaseAxisForm', {
28 31 this.addStandardColor('axis-legend-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors),
29 32 this.addStandardFont('axis-legend-font')
30 33 ];
31   -
  34 + var manageTicksNumber = function (name, newValue, oldValue){
  35 + var disableTicksNumbers = me.getForm( ).findField('axis-grid-minor-number').disabled
  36 + me.getForm( ).findField('axis-grid-minor-number').setDisabled( !newValue);
  37 + me.getForm( ).findField('axis-grid-major-number').setDisabled( !newValue);
  38 + if( newValue){
  39 + me.getForm( ).findField('axis-grid-minor-space').setDisabled(newValue);
  40 + me.getForm( ).findField('axis-grid-major-space').setDisabled(newValue);
  41 + me.getForm( ).findField('axis-grid-specify-ticks-spacing').setValue(!newValue);
  42 + }
  43 + };
  44 + var manageTicksSpacing = function (name, newValue, oldValue){
  45 + var disableTicksSacing = me.getForm( ).findField('axis-grid-minor-space').disabled
  46 + me.getForm( ).findField('axis-grid-minor-space').setDisabled( !newValue );
  47 + me.getForm( ).findField('axis-grid-major-space').setDisabled( !newValue );
  48 + if( newValue ){
  49 + me.getForm( ).findField('axis-grid-minor-number').setDisabled(newValue);
  50 + me.getForm( ).findField('axis-grid-major-number').setDisabled(newValue);
  51 + me.getForm( ).findField('axis-grid-specify-ticks-number').setValue(!newValuee);
  52 + }
  53 + };
32 54 var tickGridItems = [
33 55 this.addStandardCombo('axis-tick-position', 'Ticks position', amdaPlotObj.PlotObjectConfig.availableTicksPositions),
34 56 this.addStandardCheck('axis-tick-showmarks', 'Show tick marks'),
35 57 this.addStandardCheck('axis-grid-major', 'Show major grid'),
36 58 this.addStandardCheck('axis-grid-minor', 'Show minor grid'),
37   - this.addStandardCheck('axis-grid-spicify-ticks-number', 'spicify ticks number'),
38   - this.addStandardInteger('axis-grid-major-number', 'Nb of Major Ticks', 0, Number.MAX_VALUE,true),
39   - this.addStandardInteger('axis-grid-minor-number', 'Nb of Minor Ticks', 0, Number.MAX_VALUE,true),
40   - this.addStandardCheck('axis-grid-spicify-ticks-spacing', 'spicify ticks spacing'),
41   - this.addStandardFloat2('axis-grid-major-space', ' Major Ticks Space', 0, Number.MAX_VALUE,true),
42   - this.addStandardFloat2('axis-grid-minor-space', ' Minor Ticks Space', 0, Number.MAX_VALUE,true),
  59 + this.addStandardCheck('axis-grid-specify-ticks-number', 'Specify ticks number', manageTicksNumber),
  60 + this.addStandardInteger('axis-grid-major-number', 'Nb of Major Ticks', 0, Number.MAX_VALUE,true,true),
  61 + this.addStandardInteger('axis-grid-minor-number', 'Nb of Minor Ticks', 0, Number.MAX_VALUE,true,true),
  62 + this.addStandardCheck('axis-grid-specify-ticks-spacing', 'Specify ticks spacing',manageTicksSpacing),
  63 + this.addStandardFloat2('axis-grid-major-space', ' Major Ticks Space', 0, Number.MAX_VALUE,true,true),
  64 + this.addStandardFloat2('axis-grid-minor-space', ' Minor Ticks Space', 0, Number.MAX_VALUE,true,true),
43 65  
44 66 ];
45 67  
... ...
js/app/views/PlotComponents/PlotStandardForm.js
... ... @@ -83,7 +83,7 @@ Ext.define('amdaPlotComp.PlotStandardForm', {
83 83 }
84 84 };
85 85 },
86   - addStandardInteger: function(name, label, min, max, allowBlank, onChange) {
  86 + addStandardInteger: function(name, label, min, max, allowBlank, disabled,onChange) {
87 87 allowBlank = (typeof allowBlank !== 'undefined') ? allowBlank : false;
88 88  
89 89 return {
... ... @@ -91,6 +91,7 @@ Ext.define('amdaPlotComp.PlotStandardForm', {
91 91 xtype: 'numberfield',
92 92 name: name,
93 93 fieldLabel: label,
  94 + disabled:(disabled)? true:false,
94 95 regex:/^\d+$/,
95 96 decimalPrecision : 20,
96 97 minValue : min,
... ... @@ -107,7 +108,7 @@ Ext.define('amdaPlotComp.PlotStandardForm', {
107 108 };
108 109 },
109 110  
110   - addStandardFloat2: function(name, label, min, max, allowBlank, onChange,disable) {
  111 + addStandardFloat2: function(name, label, min, max, allowBlank, disabled, onChange) {
111 112 allowBlank = (typeof allowBlank !== 'undefined') ? allowBlank : false;
112 113  
113 114 return {
... ... @@ -116,7 +117,7 @@ Ext.define('amdaPlotComp.PlotStandardForm', {
116 117 name: name,
117 118 fieldLabel: label,
118 119 regex : /[-+]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][-+]?\d+)?/,
119   - disable:disable,
  120 + disabled:(disabled)? true:false,
120 121 validator: function (val) {
121 122 var errMsg = null;
122 123 if (!allowBlank && Ext.isEmpty(val)) {
... ... @@ -179,13 +180,6 @@ Ext.define('amdaPlotComp.PlotStandardForm', {
179 180 this.object.set(name, newValue);
180 181 if (onChange != null)
181 182 onChange(name, newValue, oldValue);
182   - if(name=='axis-grid-spicify-ticks-number'){
183   - console.log(tyopeof(this));
184   - }else if(name=='axis-grid-spicify-ticks-spacing'){
185   - this.desableTickSpacing=! this.desableTickSpacing;
186   - console.log( this.getDockedComponent('axis-grid-spicify-ticks-spacing'));
187   - console.log( this.getDockedComponent(1));
188   - }
189 183 },
190 184 scope: this
191 185 }
... ...