PlotParam.js 2.17 KB
/**
 * Project      : AMDA-NG
 * Name         : PlotParam.js
 * @class   amdaModel.PlotParam
 * @extends amdaModel.PlotObject
 * @brief   PlotParam Business Object Definition 
 * @author  Caroline DARMON
 * @version $Id: PlotParam.js 2490 2014-08-27 16:08:06Z elena $ 
 ******************************************************************************
 *    FT Id     :   Date   : Name - Description
 ******************************************************************************
 *	:           :08/09/2011: CDA  - file creation
 */

Ext.define('amdaModel.PlotParam', {	
    extend: 'amdaModel.PlotObject',
    
    statics: {
        rowClass : 'plotParamBgColor',
        ADD_PARAM_MODE : ['simple','function']    
    },
    
    fields : [  { name: 'paramArgs', type: 'string', defaultValue: 'select...' },
	 	{ name: 'isScatter', type: 'boolean',  defaultValue: true },
		{ name: 'downloadParamArgs', defaultValue: null },
		{ name: 'needsArgs', type: 'boolean',  defaultValue: false },
                { name: 'plotOnly', type: 'boolean',  defaultValue: false },	
		{ name: 'isSpectra', type: 'boolean',  defaultValue: false },
		{ name: 'yaxe', type: 'boolean',  defaultValue: false },		
		{ name: 'checked', defaultValue: null }
 	    ],
	   
    belongsTo: 'amdaModel.PlotPanel', 
	 
    constructor: function(configParam){
	    this.callParent(arguments);

	    this.set('id',Ext.id());
	    this.set('leaf',true);
	    this.set('rowCls', this.getRowClass());	 
	    // set this instance as unmodified
	    this.commit();
         
     },

     getJsonValues: function(){	     
	    var myValues  = new Object();
	     
	    myValues.name = this.get('name');
	    myValues.leaf = true;
	    myValues.text = this.get('text');
	    myValues.paramArgs = this.get('paramArgs');
	    myValues.isScatter = this.get('isScatter');
	    myValues.needsArgs = this.get('needsArgs');
	    myValues.plotOnly = this.get('plotOnly');
            
	    if (this.get('downloadParamArgs')) {
	      myValues.downloadParamArgs = this.get('downloadParamArgs');
	    }
            myValues.yaxe = this.get('yaxe');
         return myValues;
      },
	 
      getRowClass: function(){
	  return amdaModel.PlotParam.rowClass;
      }
	 
});