PlotTabContent.js 1.35 KB
/**
 * Project   : AMDA-NG
 * Name      : PlotTab.js
 * @class   amdaPlotComp.PlotTab
 * @extends Ext.form.Panel
 * @brief   Tab content to define a plot
 * @author  Benjamin Renard
 * @version $Id: PlotTab.js benjamin $
 */

Ext.define('amdaPlotComp.PlotTabContent', {
	extend: 'Ext.form.Panel',
	
	requires: [
	           'amdaUI.TimeSelectorUI',
	           'amdaPlotComp.PlotTree'
    ],
	
    treePlot: null,
    
    //Link to the Plot Element Panel
    plotElementPanel: null,
    
    //Tab Object
    object: null,
    
    constructor: function(config) {
		this.init(config);	    
		this.callParent(arguments);
	},
	
	setTabObject : function(object) {
		this.object = object;
		this.treePlot.buildTree(this.object);
	},
	
	init : function(config) {
		var me = this;
		
		this.plotElementPanel = config.plotElementPanel;
		
		var timeSelector = new amdaUI.TimeSelectorUI( { id: 'plotTimeSelector' + config.tabNumber, flex: 2} );
		this.treePlot = new amdaPlotComp.PlotTree({flex: 3, plotElementPanel: this.plotElementPanel});
		
		var myConf = {
				bodyStyle: { background : '#dfe8f6' },  
				defaults: {
					border: false
				},
				layout: {
				    type: 'vbox',
				    pack: 'start',
				    align: 'stretch'
				},
				items: [
				        this.treePlot,
				        timeSelector  
				]
		};
		
		Ext.apply (this , Ext.apply (arguments, myConf));
		
		
	}
});