PlotBaseAxisForm.js 2.11 KB
/**
 * Project   : AMDA-NG
 * Name      : PlotBaseAxisForm.js
 * @class   amdaPlotComp.PlotBaseAxisForm
 * @extends amdaPlotComp.PlotStandardForm
 * @brief   Form to define common options of all axes
 * @author  Benjamin Renard
 * @version $Id: PlotBaseAxisForm.js benjamin $
 */

Ext.define('amdaPlotComp.PlotBaseAxisForm', {
	extend: 'amdaPlotComp.PlotStandardForm',
	
	showScaleOption  : true,
	showColorOption  : true,
	showRangeOptions : true,
	showTickGridOptions : true,
	
	getFormItems: function() {
		var rangeItems = [
                this.addStandardFloat('axis-range-min', 'Min', -Number.MAX_VALUE, Number.MAX_VALUE),
                this.addStandardFloat('axis-range-max', 'Max', -Number.MAX_VALUE, Number.MAX_VALUE),
                this.addStandardCheck('axis-range-extend', 'Extend Axis Range')
		];
		
		var legendItems = [
		        this.addStandardText('axis-legend-text', 'Text'),
		        this.addStandardColor('axis-legend-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors),
		        this.addStandardFont('axis-legend-font')
		];
		
		var tickGridItems = [
                this.addStandardCombo('axis-tick-position', 'Ticks position', amdaPlotObj.PlotObjectConfig.availableTicksPositions),
                this.addStandardCheck('axis-grid-major', 'Major grid'),
                this.addStandardCheck('axis-grid-minor', 'Minor grid')
        ];
		
		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));
		axisItems.push(this.addStandardFloat('axis-thickness', 'Thickness', 1, 10));
		axisItems.push(this.addStandardCheck('axis-reverse', 'Reverse direction'));
		if (this.showRangeOptions)
			axisItems.push(this.addStandardFieldSet('Range', '', rangeItems));
		axisItems.push(this.addStandardFieldSet('Legend', '', legendItems));
		if (this.showTickGridOptions)
			axisItems.push(this.addStandardFieldSet('Ticks and Grid', '', tickGridItems));
		
		return axisItems;
	}
});