PlotLegendSeriesObject.js 5.05 KB
/**
 * Project      : AMDA-NG
 * Name         : PlotLegendSeriesObject.js
 * @class   amdaPlotObj.PlotLegendSeriesObject
 * @extends Ext.data.Model
 * @brief   Plot Series Legend Business Object Definition 
 * @author  Benjamin Renard
 * @version $Id: PlotLegendSeriesObject.js benjamin $
 ******************************************************************************
 *    FT Id     :   Date   : Name - Description
 ******************************************************************************
 *	:           :31/08/2015: BRE  - file creation
 */
 
 		
Ext.define('amdaPlotObj.PlotLegendSeriesObject', {
	extend: 'Ext.data.Model',
	
	requires: [
	           'amdaPlotObj.PlotObjectConfig'
	],
	
	fields : [
	          {name: 'legend-series-activated', type: 'boolean', defaultValue: false},
	          {name: 'legend-series-type', type: 'string', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.type},
	          {name: 'legend-series-position', type: 'string', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.position},
	          {name: 'legend-series-showparaminfo', type: 'boolean', defaultValue: true},
		      {name: 'legend-series-defaulttextcolor', type: 'string', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.text.color},
	          {name: 'legend-series-border-activated', type: 'boolean', defaultValue: false},
	          {name: 'legend-series-border-color', type: 'string', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.border.color},
	          {name: 'legend-series-intervalinfo-activated', type: 'boolean', defaultValue: false},
	          {name: 'legend-series-intervalinfo-type', type: 'string', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.intervalinfo.type},
	          {name: 'legend-series-font-activated', type: 'boolean', defaultValue: false},
              {name: 'legend-series-font-name', type: 'string', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.font.name},
              {name: 'legend-series-font-size', type: 'int', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.font.size},
              {name: 'legend-series-font-bold', type: 'boolean', defaultValue: false},
              {name: 'legend-series-font-italic', type: 'boolean', defaultValue: false}
    ],
    
    setDefaultValues: function()
    {
    	/*this.set('legend-series-activated', false);
    	this.set('legend-series-type', amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.type);
    	this.set('legend-series-position', amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.position);
    	this.set('legend-series-showparaminfo', true);
    	this.set('legend-series-defaulttextcolor', amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.text.color);
    	this.set('legend-series-border-activated', false);
    	this.set('legend-series-border-color', amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.border.color);
    	this.set('legend-series-intervalinfo-activated', false);
    	this.set('legend-series-intervalinfo-type', amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.intervalinfo.type);
    	this.set('legend-series-font-activated', false);
    	this.set('legend-series-font-name', amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.font.name);
    	this.set('legend-series-font-size', amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.font.size);
    	this.set('legend-series-font-bold', false);
    	this.set('legend-series-font-italic', false);*/
    },
    
    getShortInfo : function()
    {
    	var info = '';
		if (this.get('legend-series-activated'))
			info += 'Activated';
		else
			info += 'Deactivated';
		return info;
    },
    
    getJsonValues : function() 
    {
    	var legendValues  = new Object();
    	
    	legendValues['legend-series-activated'] = this.get('legend-series-activated');
    	legendValues['legend-series-type'] = this.get('legend-series-type');
    	legendValues['legend-series-position'] = this.get('legend-series-position');
    	legendValues['legend-series-showparaminfo'] = this.get('legend-series-showparaminfo');
    	legendValues['legend-series-defaulttextcolor'] = this.get('legend-series-defaulttextcolor');
    	legendValues['legend-series-border-activated'] = this.get('legend-series-border-activated');
    	legendValues['legend-series-border-color'] = this.get('legend-series-border-color');
    	legendValues['legend-series-intervalinfo-activated'] = this.get('legend-series-intervalinfo-activated');
    	legendValues['legend-series-intervalinfo-type'] = this.get('legend-series-intervalinfo-type');
    	legendValues['legend-series-font-activated'] = this.get('legend-series-font-activated');
    	legendValues['legend-series-font-name'] = this.get('legend-series-font-name');
    	legendValues['legend-series-font-size'] = this.get('legend-series-font-size');
    	legendValues['legend-series-font-bold'] = this.get('legend-series-font-bold');
    	legendValues['legend-series-font-italic'] = this.get('legend-series-font-italic');
    	
    	return legendValues;
    }
});