PlotPageForm.js 2 KB
/**
 * Project   : AMDA-NG
 * Name      : PlotPageForm.js
 * @class   amdaPlotComp.PlotPageForm
 * @extends amdaPlotComp.PlotStandardForm
 * @brief   Form to define page options
 * @author  Benjamin Renard
 * @version $Id: PlotPageForm.js benjamin $
 */

Ext.define('amdaPlotComp.PlotPageForm', {
	extend: 'amdaPlotComp.PlotStandardForm',

	getFormItems: function() {
		var titleItems = [
		        this.addStandardText('page-title-text', 'Text'),
			this.addColorsPicker('page-title-color', 'Color', amdaDefaultConfigs.availableColorsNew),
		        this.addStandardCombo('page-title-position', 'Position', amdaDefaultConfigs.availableTitlePositions),
		        this.addStandardCombo('page-title-alignment', 'Alignment', amdaDefaultConfigs.availableTitleAlignments),
		        this.addStandardFont('page-title-font')
		];
		
		var marginItems = [
		    this.addStandardFloat('page-margin-x', 'Horizontal', 0, 100),
		    this.addStandardFloat('page-margin-y', 'Vertical', 0, 100)
		];
		
		var me = this;
		return [
		        //this.addStandardCombo('page-mode', 'Mode', amdaDefaultOptions['plot.page.mode'].store),
    	        this.addStandardCombo('page-orientation', 'Orientation', amdaDefaultConfigs.availablePageOrientations, function(name, value, oldValue) {
    	        	me.object.set('page-orientation', value);
	        		me.crtTree.refresh();
    	        }),
    	        this.addStandardCombo('page-dimension', 'Dimension', amdaDefaultConfigs.availablePageDimensions, function(name, value, oldValue) {
    	        	me.object.set('page-dimension', value);
	        		me.crtTree.refresh();
    	        }),
    	        this.addStandardCheck('page-superpose-mode', 'Epoch Superposed Mode', function(name, value, oldValue) {
    	        	me.object.set('page-superpose-mode', value);
	        		me.crtTree.refresh();
    	        }),
		        this.addStandardFieldSet('Title', '', titleItems),
		        this.addStandardFieldSet('Margins', 'page-margins-activated', marginItems),
		        this.addStandardFont('page-font')
		];
	}
});