diff --git a/js/app/models/PlotObjects/PlotBaseSerieObject.js b/js/app/models/PlotObjects/PlotBaseSerieObject.js index f2c765a..75bf283 100644 --- a/js/app/models/PlotObjects/PlotBaseSerieObject.js +++ b/js/app/models/PlotObjects/PlotBaseSerieObject.js @@ -25,12 +25,9 @@ Ext.define('amdaPlotObj.PlotBaseSerieObject', { {name: 'serie-resolution', type: 'int'}, {name: 'serie-lines-activated', type: 'boolean'}, {name: 'serie-lines-color-activated', type: 'boolean'}, - {name: 'serie-lines-color-auto', type: 'boolean'}, {name: 'serie-lines-style', type: 'string'}, {name: 'serie-lines-width', type: 'float'}, {name: 'serie-lines-color', type: 'string'}, - {name: 'serie-lines-color-rgb', type: 'array'}, - {name: 'serie-symbols-activated', type: 'boolean'}, {name: 'serie-symbols-type', type: 'string'}, {name: 'serie-symbols-size', type: 'float'}, {name: 'serie-symbols-color', type: 'string'}, @@ -87,17 +84,6 @@ Ext.define('amdaPlotObj.PlotBaseSerieObject', { } this.dirty = false; }, - getDefaultColor:function(name){ - var defaultClors = new Object(); - defaultClors['serie-lines-color'] = amdaPlotObj.PlotObjectConfig.defaultValues.serie.lines.color; - defaultClors['serie-symbols-color'] = amdaPlotObj.PlotObjectConfig.defaultValues.serie.symbols.color; - defaultClors['serie-timetick-color'] = amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.color; - defaultClors['serie-timetick-symbols-color'] = amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.symbols.color; - defaultClors['serie-timetick-firstsymbols-color'] = amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.firstsymbols.color; - defaultClors['serie-intervaltick-color'] = amdaPlotObj.PlotObjectConfig.defaultValues.serie.intervaltick.color; - defaultClors['serie-intervaltick-symbols-color'] = amdaPlotObj.PlotObjectConfig.defaultValues.serie.intervaltick.symbols.color; - return defaultClors[name]; - }, setDefaultValues: function () { @@ -108,8 +94,6 @@ Ext.define('amdaPlotObj.PlotBaseSerieObject', { this.set('serie-lines-style', amdaPlotObj.PlotObjectConfig.defaultValues.serie.lines.style); this.set('serie-lines-width', amdaPlotObj.PlotObjectConfig.defaultValues.serie.lines.width); this.set('serie-lines-color', amdaPlotObj.PlotObjectConfig.defaultValues.serie.lines.color); - this.set('serie-lines-color-activated', false); - this.set('serie-lines-color-auto', true); this.set('serie-symbols-activated', false); this.set('serie-symbols-type', amdaPlotObj.PlotObjectConfig.defaultValues.serie.symbols.type); @@ -123,7 +107,6 @@ Ext.define('amdaPlotObj.PlotBaseSerieObject', { this.set('serie-timetick-nbmajor', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.nbmajor); this.set('serie-timetick-nbminor', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.nbminor); this.set('serie-timetick-color', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.color); - this.set('serie-errorbar-lines-color-rgb', amdaPlotObj.PlotObjectConfig.defaultValues.serie.lines.rgb); this.set('serie-timetick-symbols-type', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.symbols.type); this.set('serie-timetick-symbols-size', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.symbols.size); this.set('serie-timetick-symbols-color', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.symbols.color); @@ -174,9 +157,6 @@ Ext.define('amdaPlotObj.PlotBaseSerieObject', { serieValues['serie-lines-style'] = this.get('serie-lines-style'); serieValues['serie-lines-width'] = this.get('serie-lines-width'); serieValues['serie-lines-color'] = this.get('serie-lines-color'); - serieValues['serie-lines-color-activated'] = this.get('serie-lines-color-activated'); - serieValues['serie-lines-color-auto'] = this.get('serie-lines-color-auto'); - serieValues['serie-errorbar-lines-rgb'] = this.get('serie-errorbar-lines-rgb'); serieValues['serie-symbols-activated'] = this.get('serie-symbols-activated'); serieValues['serie-symbols-type'] = this.get('serie-symbols-type'); diff --git a/js/app/models/PlotObjects/PlotObjectConfig.js b/js/app/models/PlotObjects/PlotObjectConfig.js index 40c7363..712b4fa 100644 --- a/js/app/models/PlotObjects/PlotObjectConfig.js +++ b/js/app/models/PlotObjects/PlotObjectConfig.js @@ -138,8 +138,6 @@ Ext.define('amdaPlotObj.PlotObjectConfig', { } }, projection: 'XY', - 'rgb' : [0,0,0] - }, spectro: { yAxis: 'y-left', diff --git a/js/app/views/PlotComponents/PlotBaseAxisForm.js b/js/app/views/PlotComponents/PlotBaseAxisForm.js index c5443ca..d03a407 100644 --- a/js/app/views/PlotComponents/PlotBaseAxisForm.js +++ b/js/app/views/PlotComponents/PlotBaseAxisForm.js @@ -28,7 +28,7 @@ Ext.define('amdaPlotComp.PlotBaseAxisForm', { var legendItems = [ this.addStandardText('axis-legend-text', 'Text'), - this.addStandardColor('axis-legend-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors), + this.addColorsPicker('axis-legend-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'auto'), this.addStandardFont('axis-legend-font') ]; var manageTicksNumber = function (name, newValue, oldValue){ @@ -64,8 +64,9 @@ Ext.define('amdaPlotComp.PlotBaseAxisForm', { var axisItems = []; if (this.showScaleOption) axisItems.push(this.addStandardCombo('axis-scale', 'Scale', amdaPlotObj.PlotObjectConfig.availableAxisScales)); - if (this.showColorOption) - axisItems.push(this.addStandardColor('axis-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors)); + if (this.showColorOption) { + axisItems.push(this.addColorsPicker('axis-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'auto')); + } axisItems.push(this.addStandardFloat('axis-thickness', 'Thickness', 1, 10)); axisItems.push(this.addStandardCheck('axis-reverse', 'Reverse direction')); if (this.showRangeOptions) diff --git a/js/app/views/PlotComponents/PlotBaseSerieForm.js b/js/app/views/PlotComponents/PlotBaseSerieForm.js index 59f4f9d..9c7ea9e 100644 --- a/js/app/views/PlotComponents/PlotBaseSerieForm.js +++ b/js/app/views/PlotComponents/PlotBaseSerieForm.js @@ -57,7 +57,7 @@ Ext.define('amdaPlotComp.PlotBaseSerieForm', { this.addStandardFloat('serie-timetick-step', 'Time step (sec.)'), this.addStandardFloat('serie-timetick-nbmajor', 'Number of major ticks'), this.addStandardFloat('serie-timetick-nbminor', 'Number of minor ticks'), - this.addStandardColor('serie-timetick-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors), + this.addColorsPicker('serie-timetick-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew), this.addStandardFieldSet('Symbols', '', this.addStandardSymbolsItems('serie-timetick-symbols')), this.addStandardFieldSet('First symbol', 'serie-timetick-firstsymbols-activated', this.addStandardSymbolsItems('serie-timetick-firstsymbols')), this.addStandardFont('serie-timetick-font') @@ -69,7 +69,7 @@ Ext.define('amdaPlotComp.PlotBaseSerieForm', { return [ this.addStandardCombo('serie-intervaltick-mode', 'Mode', amdaPlotObj.PlotObjectConfig.availableIntervalTickModes), - this.addStandardColor('serie-intervaltick-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors), + this.addColorsPicker('serie-intervaltick-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew), this.addStandardFieldSet('Symbols', '', this.addStandardSymbolsItems('serie-intervaltick-symbols')), this.addStandardFont('serie-intervaltick-font') ]; diff --git a/js/app/views/PlotComponents/PlotColorAxisForm.js b/js/app/views/PlotComponents/PlotColorAxisForm.js index 8d176b5..6ae5457 100644 --- a/js/app/views/PlotComponents/PlotColorAxisForm.js +++ b/js/app/views/PlotComponents/PlotColorAxisForm.js @@ -17,10 +17,10 @@ Ext.define('amdaPlotComp.PlotColorAxisForm', { getFormItems: function() { var timeItems = [ this.addStandardCombo('axis-color-map', 'Color Map', amdaPlotObj.PlotObjectConfig.availableColorMaps), - this.addStandardColor('axis-color-minval', 'Min. Val. Color', amdaPlotObj.PlotObjectConfig.availableColors), - this.addStandardColor('axis-color-maxval', 'Max. Val. Color', amdaPlotObj.PlotObjectConfig.availableColors) + this.addColorsPicker('axis-color-minval', 'Min. Val. Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'none'), + this.addColorsPicker('axis-color-maxval', 'Max. Val. Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'none') ]; return Ext.Array.merge(timeItems, this.callParent()); } -}); \ No newline at end of file +}); diff --git a/js/app/views/PlotComponents/PlotColorPicker.js b/js/app/views/PlotComponents/PlotColorPicker.js index 99a7cd6..c24128c 100644 --- a/js/app/views/PlotComponents/PlotColorPicker.js +++ b/js/app/views/PlotComponents/PlotColorPicker.js @@ -18,11 +18,6 @@ Ext.define('amdaPlotComp.PlotColorPicker', { this.callParent(arguments); }, - /*setHexColor: function(hexColor) { - this.colorDisplayer.setValue(hexColor); - this.rgbColorPicker.setRgbColor(this.hexToRgb(hexColor)); - },*/ - rgbToHex : function(rgb) { return "#" + ((1 << 24) + (rgb[0] << 16) + (rgb[1] << 8) + rgb[2] ).toString(16).slice(1).toUpperCase(); }, @@ -36,27 +31,6 @@ Ext.define('amdaPlotComp.PlotColorPicker', { return arrByte.slice(1,4); }, - // Override createCheckboxCmp method - createCheckboxCmp: function() { - console.log('createCheckboxCmp'); - var me = this, - suffix = '-checkbox'; - - me.checkboxCmp = Ext.widget({ - xtype: 'checkbox', - hideEmptyLabel: true, - name: me.checkboxName || me.id + suffix, - cls: me.baseCls + '-header' + suffix, - id: me.id + '-legendChk', - checked: !me.collapsed, - listeners: { - change: me.onCheckChange, - scope: me - } - }); - return me.checkboxCmp; - }, - init : function(config) { var me = this; @@ -100,27 +74,14 @@ Ext.define('amdaPlotComp.PlotColorPicker', { }, listeners: { change: function (field, newValue, oldValue, eOpts) { - /*if (config.onChange) { - config.onChange(config.name, newValue, oldValue); - }*/ - - if ((newValue == 'auto') && this.checkboxCmp.getValue()) { + if (this.checkboxCmp && (newValue == this.mode) && this.checkboxCmp.getValue()) { this.collapse(); return; } - else if ((newValue != 'auto') && !this.checkboxCmp.getValue()) { + else if (this.checkboxCmp && (newValue != this.mode) && !this.checkboxCmp.getValue()) { this.expand(); return; } - /*console.log('displayer change - ' + this.colorDisplayer.inExpandCollapseEvent); - console.log(newValue + ' - ' + oldValue); - if (!this.colorDisplayer.inExpandCollapseEvent) { - if (newValue == 'auto') - this.collapse(); - else - this.expand(); - }*/ - console.log('============> ' + newValue); field.getEl().applyStyles({'background':newValue}); this.rgbColorPicker.setRgbColor(this.hexToRgb(newValue)); if (config.onChange) { @@ -195,12 +156,17 @@ Ext.define('amdaPlotComp.PlotColorPicker', { ] }); + if (!config.mode) { + config.mode = 'standard'; + } + var myConf = { cls: 'child-fieldset', title: config.label ? config.label : 'Color', - collapsible: true, + collapsible: config.mode != 'standard', collapsed: false, - checkboxToggle: true, + checkboxToggle: config.mode != 'standard', + mode: config.mode, layout: { type: 'vbox', pack: 'start', @@ -221,15 +187,12 @@ Ext.define('amdaPlotComp.PlotColorPicker', { this.rgbColorPicker ], listeners: { - expand: function (fieldset, eOpts) { - console.log(eOpts); - if (config.onChange) { - config.onChange(config.name, '#000000', 'auto'); - } + beforeexpand: function (fieldset, eOpts) { + me.colorDisplayer.setValue('#000000'); }, collapse: function (fieldset, eOpts) { if (config.onChange) { - config.onChange(config.name, 'auto', this.colorDisplayer.getValue()); + config.onChange(config.name, this.mode, this.colorDisplayer.getValue()); } }, scope: this diff --git a/js/app/views/PlotComponents/PlotFillForm.js b/js/app/views/PlotComponents/PlotFillForm.js index 3c38fc9..4b41ad9 100644 --- a/js/app/views/PlotComponents/PlotFillForm.js +++ b/js/app/views/PlotComponents/PlotFillForm.js @@ -88,8 +88,8 @@ Ext.define('amdaPlotComp.PlotFillForm', { this.addStandardCombo('fill-firstserie-id', 'First serie Id', []), this.addStandardCombo('fill-secondserie-id', 'Second serie Id', []), this.addStandardCombo('fill-constant-id', 'Constant Id', []), - this.addStandardColor('fill-greater-color', 'Greater Color', amdaPlotObj.PlotObjectConfig.availableBackgroundColors), - this.addStandardColor('fill-less-color', 'Less Color', amdaPlotObj.PlotObjectConfig.availableBackgroundColors) + this.addColorsPicker('fill-greater-color', 'Greater Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'none'), + this.addColorsPicker('fill-less-color', 'Less Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'none') ]; } -}); \ No newline at end of file +}); diff --git a/js/app/views/PlotComponents/PlotLegendSeriesForm.js b/js/app/views/PlotComponents/PlotLegendSeriesForm.js index 7465b0f..59211e6 100644 --- a/js/app/views/PlotComponents/PlotLegendSeriesForm.js +++ b/js/app/views/PlotComponents/PlotLegendSeriesForm.js @@ -22,7 +22,7 @@ Ext.define('amdaPlotComp.PlotLegendSeriesForm', { getFormItems: function() { var borderItems = [ - this.addStandardColor('legend-series-border-color', 'Border Color', amdaPlotObj.PlotObjectConfig.availableColors), + this.addColorsPicker('legend-series-border-color', 'Border Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'none') ]; var intervalInfoItems = [ @@ -32,7 +32,7 @@ Ext.define('amdaPlotComp.PlotLegendSeriesForm', { var legendItems = [ this.addStandardCombo('legend-series-type', 'Type', amdaPlotObj.PlotObjectConfig.availableLegendSeriesTypes), this.addStandardCombo('legend-series-position', 'Position', amdaPlotObj.PlotObjectConfig.availableLegendSeriesPositions), - this.addStandardColor('legend-series-defaulttextcolor', 'Default Text Color', amdaPlotObj.PlotObjectConfig.availableColors), + this.addColorsPicker('legend-series-defaulttextcolor', 'Default Text Color', amdaPlotObj.PlotObjectConfig.availableColorsNew), this.addStandardCheck('legend-series-showparaminfo', 'Show Param Info'), this.addStandardFieldSet('Show Interval Info', 'legend-series-intervalinfo-activated', intervalInfoItems), this.addStandardFieldSet('Border', 'legend-series-border-activated', borderItems), @@ -48,4 +48,4 @@ Ext.define('amdaPlotComp.PlotLegendSeriesForm', { }) ]; } -}); \ No newline at end of file +}); diff --git a/js/app/views/PlotComponents/PlotLegendTextForm.js b/js/app/views/PlotComponents/PlotLegendTextForm.js index 0408543..7c3cafa 100644 --- a/js/app/views/PlotComponents/PlotLegendTextForm.js +++ b/js/app/views/PlotComponents/PlotLegendTextForm.js @@ -22,7 +22,7 @@ Ext.define('amdaPlotComp.PlotLegendTextForm', { return [ this.addStandardText('legend-text-value', 'Text'), - this.addStandardColor('legend-text-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors), + this.addColorsPicker('legend-text-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew), this.addStandardCombo('legend-text-position', 'Position', amdaPlotObj.PlotObjectConfig.availableLegendTextPositions, function(name, value, oldValue) { me.object.set('legend-text-position', value); me.crtTree.refresh(); @@ -30,4 +30,4 @@ Ext.define('amdaPlotComp.PlotLegendTextForm', { this.addStandardFont('legend-text-font') ]; } -}); \ No newline at end of file +}); diff --git a/js/app/views/PlotComponents/PlotPageForm.js b/js/app/views/PlotComponents/PlotPageForm.js index f54571a..ba6d3b5 100644 --- a/js/app/views/PlotComponents/PlotPageForm.js +++ b/js/app/views/PlotComponents/PlotPageForm.js @@ -14,7 +14,7 @@ Ext.define('amdaPlotComp.PlotPageForm', { getFormItems: function() { var titleItems = [ this.addStandardText('page-title-text', 'Text'), - this.addStandardColor('page-title-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors), + this.addColorsPicker('page-title-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew), this.addStandardCombo('page-title-position', 'Position', amdaPlotObj.PlotObjectConfig.availableTitlePositions), this.addStandardCombo('page-title-alignment', 'Alignment', amdaPlotObj.PlotObjectConfig.availableTitleAlignments), this.addStandardFont('page-title-font') @@ -45,4 +45,4 @@ Ext.define('amdaPlotComp.PlotPageForm', { this.addStandardFont('page-font') ]; } -}); \ No newline at end of file +}); diff --git a/js/app/views/PlotComponents/PlotPanelForm.js b/js/app/views/PlotComponents/PlotPanelForm.js index 9604e63..26d718f 100644 --- a/js/app/views/PlotComponents/PlotPanelForm.js +++ b/js/app/views/PlotComponents/PlotPanelForm.js @@ -96,7 +96,7 @@ Ext.define('amdaPlotComp.PlotPanelForm', { var titleItems = [ this.addStandardText('panel-title-text', 'Text'), - this.addStandardColor('panel-title-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors), + this.addColorsPicker('panel-title-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew), this.addStandardCombo('panel-title-position', 'Position', amdaPlotObj.PlotObjectConfig.availableTitlePositions), this.addStandardCombo('panel-title-alignment', 'Alignment', amdaPlotObj.PlotObjectConfig.availableTitleAlignments), this.addStandardFont('panel-title-font') @@ -141,7 +141,7 @@ Ext.define('amdaPlotComp.PlotPanelForm', { me.object.set('panel-instant-time', value); me.crtTree.refresh(); }), - this.addStandardColor('panel-background-color', 'Background Color', amdaPlotObj.PlotObjectConfig.availableBackgroundColors), + this.addColorsPicker('panel-background-color', 'Background Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'none'), this.addStandardFieldSet('Manual Bounds', '', boundsItems), this.addStandardFieldSet('Manual Margins', '', marginItems), this.addStandardFieldSet('Preferred Dimensions', '', preferedDimItems), diff --git a/js/app/views/PlotComponents/PlotParamForm.js b/js/app/views/PlotComponents/PlotParamForm.js index 38f6014..3908fc4 100644 --- a/js/app/views/PlotComponents/PlotParamForm.js +++ b/js/app/views/PlotComponents/PlotParamForm.js @@ -123,7 +123,6 @@ Ext.define('amdaPlotComp.PlotParamForm', { onChangeParamArgs: function (uiScope, args_key, newValue, oldValue, isTemplateArg) { if ((uiScope.isFirstMsg) && (uiScope.object.get('type') == 2) && (uiScope.object.get('dim1-sum-type') == 0) && (uiScope.object.get('dim2-sum-type') == 0) && (uiScope.object.get('dim1-index') == '*') && (uiScope.object.get('dim2-index') == '*') && (uiScope.object.get('param-drawing-type') != 'sauvaud')) { - console.log(uiScope.object); uiScope.isFirstMsg = false; myDesktopApp.warningMsg('If argument <i>All</i> is set for both dimensions output will be the total sum <b>(not spectra!)</b>'); } diff --git a/js/app/views/PlotComponents/PlotSerieForm.js b/js/app/views/PlotComponents/PlotSerieForm.js index 7979ee0..4d428c0 100644 --- a/js/app/views/PlotComponents/PlotSerieForm.js +++ b/js/app/views/PlotComponents/PlotSerieForm.js @@ -82,17 +82,6 @@ Ext.define('amdaPlotComp.PlotSerieForm', { }); serieItems.push(this.addStandardFieldSet('Error Bar', 'serie-errorbar-activated', this.getErrorBarItems())); - /** - var colorPicker = Ext.create('Ext.menu.ColorPicker', { - value: '000000' - }); - var colorMenu =Ext.create('Ext.menu.Menu', { - items: [{ - text: 'Choose a color', - menu: colorPicker - }] - }).show(); - serieItems.push(colorMenu); */ return serieItems; } }); diff --git a/js/app/views/PlotComponents/PlotStandardForm.js b/js/app/views/PlotComponents/PlotStandardForm.js index 94a5d3a..6755898 100644 --- a/js/app/views/PlotComponents/PlotStandardForm.js +++ b/js/app/views/PlotComponents/PlotStandardForm.js @@ -14,7 +14,7 @@ Ext.define('amdaPlotComp.PlotStandardForm', { requires: [ 'amdaPlotObj.PlotObjectConfig', 'amdaPlotComp.EraseTrigger', - 'amdaPlotComp.PlotColorPicker' + 'amdaPlotComp.PlotColorPicker' ], //Object associated to this form @@ -194,13 +194,13 @@ Ext.define('amdaPlotComp.PlotStandardForm', { }; }, - addStandardFieldSet: function (title, checkboxName, items, onChangeCheck, collapsed_ = true) { + addStandardFieldSet: function (title, checkboxName, items, onChangeCheck) { return { xtype: 'fieldset', cls: 'child-fieldset', title: title, collapsible: true, - collapsed: collapsed_, + collapsed: true, checkboxName: checkboxName, checkboxToggle: checkboxName != '', layout: { @@ -406,8 +406,7 @@ Ext.define('amdaPlotComp.PlotStandardForm', { return [ this.addStandardCombo(namePrefix + '-style', 'Style', amdaPlotObj.PlotObjectConfig.availableLinesStyles), this.addStandardFloat(namePrefix + '-width', 'Width', 1, 10), - //this.addStandardColor(namePrefix + '-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors), - this.addColorsPicker(namePrefix + '-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew) + this.addColorsPicker(namePrefix + '-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'auto') ]; }, @@ -415,17 +414,17 @@ Ext.define('amdaPlotComp.PlotStandardForm', { return [ this.addStandardCombo(namePrefix + '-type', 'Type', amdaPlotObj.PlotObjectConfig.availableSymbolsTypes), this.addStandardFloat(namePrefix + '-size', 'Size', 1, 10), - this.addStandardColor(namePrefix + '-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors) + this.addColorsPicker(namePrefix + '-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'auto') ]; }, - addColorsPicker: function (name, label, availableColors, onChange) { + addColorsPicker: function (name, label, availableColors, mode) { + if (!mode) { + mode = 'standard'; + } var me =this; - return new amdaPlotComp.PlotColorPicker({name: name, label: label, colors: availableColors, onChange: function(name, newValue, oldValue) { + return new amdaPlotComp.PlotColorPicker({name: name, label: label, mode: mode, colors: availableColors, onChange: function(name, newValue, oldValue) { me.object.set(name, newValue); - console.log(newValue); - if (onChange != null) - onChange(name, newValue, oldValue); }}); }, diff --git a/js/app/views/PlotComponents/PlotTextForm.js b/js/app/views/PlotComponents/PlotTextForm.js index e6c782d..b55705e 100644 --- a/js/app/views/PlotComponents/PlotTextForm.js +++ b/js/app/views/PlotComponents/PlotTextForm.js @@ -62,7 +62,7 @@ Ext.define('amdaPlotComp.PlotTextForm', { var me = this; return [ this.addStandardText('text-value', 'Text'), - this.addStandardColor('text-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors), + this.addColorsPicker('text-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew), this.addStandardCombo('text-align', 'Alignment', amdaPlotObj.PlotObjectConfig.availableTextAlignments), this.addStandardCheck('text-x-relative', 'Relative X Position', function(name, value, oldValue) { me.updateOptions(me.crtTree.getSelectedPlotType()); @@ -78,4 +78,4 @@ Ext.define('amdaPlotComp.PlotTextForm', { this.addStandardFont('text-font') ]; } -}); \ No newline at end of file +}); -- libgit2 0.21.2