Blame view

js/app/models/PlotObjects/PlotIntervalsObject.js 3.41 KB
ebebd92d   Benjamin Renard   Add intervals dra...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
 * Project      : AMDA-NG
 * Name         : PlotIntervalsObject.js
 * @class   amdaPlotObj.PlotIntervalsObject
 * @extends Ext.data.Model
 * @brief   Plot Intervals Business Object Definition 
 * @author  Benjamin Renard
 * @version $Id: PlotIntervalsObject.js benjamin $
 ******************************************************************************
 *    FT Id     :   Date   : Name - Description
 ******************************************************************************
 *	:           :04/04/2019: BRE  - file creation
 */
 
 		
Ext.define('amdaPlotObj.PlotIntervalsObject', {
	extend: 'Ext.data.Model',
	
	requires: [
	           'amdaPlotObj.PlotObjectConfig'
	],
	
5b1abd71   Erdogan Furkan   7616 - Adding col...
23
    fields: [
7b86b04f   Erdogan Furkan   IHM modifications...
24
        { name: 'intervals-color', type: 'string', defaultValue: "none" },
58c42032   Benjamin Renard   Fix
25
        { name: 'legend-text-activated', type: 'boolean', defaultValue: true},
7b86b04f   Erdogan Furkan   IHM modifications...
26
27
28
29
30
31
32
33
34
        { name: 'legend-text-value', type: 'string' },
        { name: 'legend-text-position', type: 'string', defaultValue: "top" },
        { name: 'legend-text-color', type: 'string' },
        { name: 'legend-text-font-activated', type: 'boolean' },
        { name: 'legend-text-font-name', type: 'string', defaultValue: "sans-serif" },
        { name: 'legend-text-font-size', type: 'int', defaultValue: "12" },
        { name: 'legend-text-font-bold', type: 'boolean' },
        { name: 'legend-text-font-italic', type: 'boolean' }

ebebd92d   Benjamin Renard   Add intervals dra...
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
    ],
    
    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;
    },
    
    setDefaultValues: function()
    {
5b1abd71   Erdogan Furkan   7616 - Adding col...
53
        this.set('intervals-color', amdaPlotObj.PlotObjectConfig.defaultValues.intervals.color);
58c42032   Benjamin Renard   Fix
54
	this.set('legend-text-activated', true);
7b86b04f   Erdogan Furkan   IHM modifications...
55
56
57
58
59
60
61
62
63
64
        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);


ebebd92d   Benjamin Renard   Add intervals dra...
65
66
67
68
69
    },
    
    getJsonValues : function() 
    {
    	var intervalsValues  = new Object();
5b1abd71   Erdogan Furkan   7616 - Adding col...
70
        intervalsValues['intervals-color'] = this.get('intervals-color');
58c42032   Benjamin Renard   Fix
71
	intervalsValues['legend-text-activated'] = this.get('legend-text-activated');
7b86b04f   Erdogan Furkan   IHM modifications...
72
73
74
75
76
77
78
79
        intervalsValues['legend-text-value'] = this.get('legend-text-value');
        intervalsValues['legend-text-position'] = this.get('legend-text-position');
        intervalsValues['legend-text-color'] = this.get('legend-text-color');
        intervalsValues['legend-text-font-activated'] = this.get('legend-text-font-activated');
        intervalsValues['legend-text-font-name'] = this.get('legend-text-font-name');
        intervalsValues['legend-text-font-size'] = this.get('legend-text-font-size');
        intervalsValues['legend-text-font-bold'] = this.get('legend-text-font-bold');
        intervalsValues['legend-text-font-italic'] = this.get('legend-text-font-italic');
5b1abd71   Erdogan Furkan   7616 - Adding col...
80

ebebd92d   Benjamin Renard   Add intervals dra...
81
82
83
    	return intervalsValues;
    }
});