Blame view

js/app/models/PlotObjects/PlotLegendTextObject.js 2.88 KB
339866c4   Benjamin Renard   Add text legend d...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/**
 * Project      : AMDA-NG
 * Name         : PlotLegendTextObject.js
 * @class   amdaPlotObj.PlotLegendTextObject
 * @extends Ext.data.Model
 * @brief   Plot Text Legend Business Object Definition 
 * @author  Benjamin Renard
 * @version $Id: PlotLegendTextObject.js benjamin $
 ******************************************************************************
 *    FT Id     :   Date   : Name - Description
 ******************************************************************************
 *	:           :01/09/2015: BRE  - file creation
 */
 
 		
Ext.define('amdaPlotObj.PlotLegendTextObject', {
	extend: 'Ext.data.Model',
dbb7bcbe   Benjamin Renard   Add curves defint...
18
	idProperty: 'id',
339866c4   Benjamin Renard   Add text legend d...
19
20
21
22
23
24
	
	requires: [
	           'amdaPlotObj.PlotObjectConfig'
	],
	
	fields : [
fd5552a4   Benjamin Renard   Info for plot ele...
25
	          {name: 'id', type: 'int'},
339866c4   Benjamin Renard   Add text legend d...
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
	          {name: 'legend-text-value', type: 'string'},
	          {name: 'legend-text-position', type: 'string'},
	          {name: 'legend-text-color', type: 'string'},
	          {name: 'legend-text-font-activated', type: 'boolean'},
              {name: 'legend-text-font-name', type: 'string'},
              {name: 'legend-text-font-size', type: 'int'},
              {name: 'legend-text-font-bold', type: 'boolean'},
              {name: 'legend-text-font-italic', type: 'boolean'}
    ],
    
    setDefaultValues: function()
    {
    	this.set('legend-text-value', '');
    	this.set('legend-text-position', amdaPlotObj.PlotObjectConfig.defaultValues.legends.text.position);
    	this.set('legend-text-color', amdaPlotObj.PlotObjectConfig.defaultValues.legends.text.color);
    	this.set('legend-text-font-activated', false);
    	this.set('legend-text-font-name', amdaPlotObj.PlotObjectConfig.defaultValues.legends.text.font.name);
    	this.set('legend-text-font-size', amdaPlotObj.PlotObjectConfig.defaultValues.legends.text.font.size);
    	this.set('legend-text-font-bold', false);
    	this.set('legend-text-font-italic', false);
    },
    
fd5552a4   Benjamin Renard   Info for plot ele...
48
49
50
51
52
53
    getShortInfo : function()
    {
    	var position = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaPlotObj.PlotObjectConfig.availableLegendTextPositions, this.get('legend-text-position'));
		return position;
    },
    
339866c4   Benjamin Renard   Add text legend d...
54
55
56
57
    getJsonValues : function() 
    {
    	var legendValues  = new Object();
    	
dbb7bcbe   Benjamin Renard   Add curves defint...
58
    	legendValues['id'] = this.get('id');    	
339866c4   Benjamin Renard   Add text legend d...
59
60
61
62
63
64
65
66
67
68
69
70
    	legendValues['legend-text-value'] = this.get('legend-text-value');
    	legendValues['legend-text-position'] = this.get('legend-text-position');
    	legendValues['legend-text-color'] = this.get('legend-text-color');
    	legendValues['legend-text-font-activated'] = this.get('legend-text-font-activated');
    	legendValues['legend-text-font-name'] = this.get('legend-text-font-name');
    	legendValues['legend-text-font-size'] = this.get('legend-text-font-size');
    	legendValues['legend-text-font-bold'] = this.get('legend-text-font-bold');
    	legendValues['legend-text-font-italic'] = this.get('legend-text-font-italic');
    	
    	return legendValues;
    }
});