Blame view

js/app/models/PlotObjects/PlotLegendSeriesObject.js 4.39 KB
94abdb37   Benjamin Renard   Add params legend...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/**
 * 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', {
41109aaa   Benjamin Renard   Set amdaPlotObj.P...
17
    extend: 'Ext.data.Model',
94abdb37   Benjamin Renard   Add params legend...
18
	
41109aaa   Benjamin Renard   Set amdaPlotObj.P...
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
    fields : [
        {name: 'legend-series-activated', type: 'boolean'},
        {name: 'legend-series-type', type: 'string'},
        {name: 'legend-series-position', type: 'string'},
        {name: 'legend-series-showparaminfo', type: 'boolean'},
        {name: 'legend-series-defaulttextcolor', type: 'string'},
        {name: 'legend-series-border-activated', type: 'boolean'},
        {name: 'legend-series-border-color', type: 'string'},
        {name: 'legend-series-intervalinfo-activated', type: 'boolean'},
        {name: 'legend-series-intervalinfo-type', type: 'string'},
        {name: 'legend-series-font-activated', type: 'boolean'},
        {name: 'legend-series-font-name', type: 'string'},
        {name: 'legend-series-font-size', type: 'int'},
        {name: 'legend-series-font-bold', type: 'boolean'},
        {name: 'legend-series-font-italic', type: 'boolean'}
94abdb37   Benjamin Renard   Add params legend...
34
    ],
41109aaa   Benjamin Renard   Set amdaPlotObj.P...
35
36
37
38
39
40
41
42
43
44
45
46
47
48

    constructor: function()
    {
        var me = this;
        me.callParent(arguments);
        if ((arguments.length > 0) && arguments[0])
        {
        }
        else {
            //new object, set default fields values
            me.setDefaultValues();
        }
        this.dirty = false;
    },
94abdb37   Benjamin Renard   Add params legend...
49
50
51
    
    setDefaultValues: function()
    {
41109aaa   Benjamin Renard   Set amdaPlotObj.P...
52
    	this.set('legend-series-activated', false);
b1dc2eb3   Erdogan Furkan   More modifications
53
54
    	this.set('legend-series-type', amdaDefaultValues.plot.legends.series.type);
    	this.set('legend-series-position', amdaDefaultValues.plot.legends.series.position);
94abdb37   Benjamin Renard   Add params legend...
55
    	this.set('legend-series-showparaminfo', true);
b1dc2eb3   Erdogan Furkan   More modifications
56
    	this.set('legend-series-defaulttextcolor', amdaDefaultValues.plot.legends.series.text.color);
94abdb37   Benjamin Renard   Add params legend...
57
    	this.set('legend-series-border-activated', false);
b1dc2eb3   Erdogan Furkan   More modifications
58
    	this.set('legend-series-border-color', amdaDefaultValues.plot.legends.series.border.color);
94abdb37   Benjamin Renard   Add params legend...
59
    	this.set('legend-series-intervalinfo-activated', false);
b1dc2eb3   Erdogan Furkan   More modifications
60
    	this.set('legend-series-intervalinfo-type', amdaDefaultValues.plot.legends.series.intervalinfo.type);
94abdb37   Benjamin Renard   Add params legend...
61
    	this.set('legend-series-font-activated', false);
b1dc2eb3   Erdogan Furkan   More modifications
62
63
    	this.set('legend-series-font-name', amdaDefaultValues.plot.legends.series.font.name);
    	this.set('legend-series-font-size', amdaDefaultValues.plot.legends.series.font.size);
94abdb37   Benjamin Renard   Add params legend...
64
    	this.set('legend-series-font-bold', false);
41109aaa   Benjamin Renard   Set amdaPlotObj.P...
65
    	this.set('legend-series-font-italic', false);
94abdb37   Benjamin Renard   Add params legend...
66
67
    },
    
fd5552a4   Benjamin Renard   Info for plot ele...
68
69
70
71
72
73
74
75
76
77
    getShortInfo : function()
    {
    	var info = '';
		if (this.get('legend-series-activated'))
			info += 'Activated';
		else
			info += 'Deactivated';
		return info;
    },
    
94abdb37   Benjamin Renard   Add params legend...
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
    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;
    }
41109aaa   Benjamin Renard   Set amdaPlotObj.P...
99
});