Commit 437c4dbc7846788efd4f464ab2324ae997ac13f4

Authored by Benjamin Renard
1 parent bdeecff0

First implementation of the new plot IHM

desktop.php
... ... @@ -73,7 +73,9 @@
73 73 'samp' : 'js/lib/SAMP',
74 74 'amdaDesktop' : 'js/app/controllers',
75 75 'amdaUI' : 'js/app/views',
  76 + 'amdaPlotComp' : 'js/app/views/PlotComponents',
76 77 'amdaModel' : 'js/app/models',
  78 + 'amdaPlotObj' : 'js/app/models/PlotObjects',
77 79 'amdaReader' : 'js/app/stores',
78 80 'amdaApp' : 'js/app'
79 81 });
... ...
js/app/AmdaApp.js
... ... @@ -49,10 +49,10 @@ Ext.define('amdaApp.AmdaApp', {
49 49 useLauncher : true
50 50 },
51 51 plot : {
52   - id : 'plot-win',
  52 + id : 'new-plot-win',
53 53 icon : 'icon-plot',
54 54 title : 'Plot Manager',
55   - source : 'amdaDesktop.PlotModule',
  55 + source : 'amdaDesktop.NewPlotModule',
56 56 useLauncher : true
57 57 },
58 58 search : {
... ... @@ -273,7 +273,7 @@ Ext.define('amdaApp.AmdaApp', {
273 273 data: [
274 274 { name: 'Help', iconCls: 'help', module: 'help-win' },
275 275 { name: 'Create/Modify parameter', iconCls: 'edit', module: 'param-win' },
276   - { name: 'Plot data', iconCls: 'plot', module: 'plot-win'},
  276 + { name: 'Plot data', iconCls: 'plot', module: 'new-plot-win'},
277 277 { name: 'Data mining', iconCls: 'search', module: 'search-win'},
278 278 { name: 'Download data', iconCls: 'download_manager', module: 'down-win'},
279 279 { name: 'Upload data', iconCls: 'mydata', module: 'up-win'},
... ...
js/app/controllers/NewPlotModule.js 0 → 100644
... ... @@ -0,0 +1,61 @@
  1 +/**
  2 + * Project  : AMDA-NG
  3 + * Name : NewPlotModule.js
  4 + * @class amdaDesktop.NewPlotModule
  5 + * @extends amdaDesktop.InteractiveModule
  6 + * @brief New Plot Module controller definition
  7 + * @author Benjamin Renard
  8 + * $Id: NewPlotModule.js benjamin $
  9 + */
  10 +
  11 +Ext.define('amdaDesktop.NewPlotModule', {
  12 + extend: 'amdaDesktop.InteractiveModule',
  13 +
  14 + requires: [
  15 + 'amdaUI.NewPlotUI',
  16 + 'amdaPlotObj.PlotRequestObject',
  17 + 'amdaModel.NewPlotNode'
  18 + ],
  19 +
  20 + contentId : 'newPlotUI',
  21 + linkedNode : null,
  22 +
  23 + /**
  24 + * @cfg {String} data models
  25 + * @required
  26 + */
  27 + nodeDataModel : 'amdaModel.NewPlotNode',
  28 + //objectDataModel : 'amdaPlotObj.PlotRequestObject',
  29 +
  30 + /**
  31 + * @cfg {String} window definitions
  32 + * @required
  33 + */
  34 + width: 600,
  35 + height: 620,
  36 + uiType : 'newPanelPlot',
  37 + helpTitle : 'Help on Plot Module',
  38 +
  39 + /**
  40 + * @override
  41 + */
  42 + createWindow : function() {
  43 + if (!this.linkedNode){
  44 + this.setLinkedNode(amdaModel.NewPlotNode);
  45 + }
  46 + this.callParent(arguments);
  47 + },
  48 +
  49 + saveState: function() {
  50 + /*var uiContent = this.getUiContent();
  51 + var form = uiContent.down('form').getForm();
  52 + var values = form.getValues();
  53 + // Ext.state.Manager.set(this.id + '_form', values);
  54 + Ext.state.Manager.set('timeinterval', {'startDate' : values.startDate,'stopDate' : values.stopDate });*/
  55 + },
  56 +
  57 + getState : function() {
  58 + // return Ext.state.Manager.get(this.id + '_form');
  59 + return Ext.state.Manager.get('timeinterval');
  60 + }
  61 +});
0 62 \ No newline at end of file
... ...
js/app/models/AmdaTimeObject.js
... ... @@ -30,7 +30,7 @@ Ext.define('amdaModel.TTobject', {
30 30 Ext.define('amdaModel.AmdaTimeObject', {
31 31 extend: 'amdaModel.AmdaObject',
32 32 statics:{
33   - inputTimeSrc: ['TimeTable','Interval']
  33 + inputTimeSrc: ['TimeTable','Interval','Catalog']
34 34 },
35 35 fields : [
36 36 { name: 'resultId', type: 'string'},
... ...
js/app/models/NewPlotNode.js 0 → 100644
... ... @@ -0,0 +1,131 @@
  1 +/**
  2 + * Project : AMDA-NG4
  3 + * Name : NewPlotNode.js
  4 + * @class amdaModel.NewPlotNode
  5 + * @extends amdaModel.ExecutableNode
  6 + * @brief Basic Model of Node corresponding to a plot request
  7 + * @author Benjamin Renard
  8 + * @version $Id: $
  9 + * @todo
  10 + *******************************************************************************
  11 + * FT Id : Date : Name - Description
  12 + *******************************************************************************
  13 + * : :21/08/2015: BRE - file creation
  14 + */
  15 +
  16 +Ext.define('amdaModel.NewPlotNode', {
  17 + singleton: true,
  18 +
  19 + extend: 'amdaModel.ExecutableNode',
  20 +
  21 + requires: [
  22 + 'amdaPlotObj.PlotRequestObject'
  23 + ],
  24 +
  25 + statics: {
  26 + nodeType: 'request'
  27 + },
  28 +
  29 + constructor : function(config){
  30 +
  31 + this.callParent(arguments);
  32 + this.set('moduleId',myDesktopApp.dynamicModules.plot.id);
  33 + this.set('objectDataModel',amdaPlotObj.PlotRequestObject.$className);
  34 + this.set('ownerTreeId',amdaUI.ExplorerUI.OPE_TAB.TREE_ID);
  35 + this.set('nodeType',amdaModel.PlotNode.nodeType);
  36 + },
  37 +
  38 + allMenuItems : function() {
  39 + var menuItems =
  40 + [{
  41 + fnId : 'root-createDir',
  42 + text : 'Create Folder'
  43 + }, {
  44 + fnId : 'dire-createDir',
  45 + text : 'Create Folder'
  46 + }, {
  47 + fnId : 'dire-renameNode',
  48 + text : 'Rename Folder'
  49 + }, {
  50 + fnId : 'dire-deleteNode',
  51 + text : 'Delete Folder'
  52 + }, {
  53 + fnId : 'leaf-editPlot',
  54 + text : 'Plot By Request'
  55 + }, {
  56 + fnId : 'leaf-editDownload',
  57 + text : 'Download By Request'
  58 + }, {
  59 + fnId : 'leaf-renameNode',
  60 + text : 'Rename Request'
  61 + }, {
  62 + fnId : 'leaf-deleteNode',
  63 + text : 'Delete Request'
  64 + }];
  65 +
  66 + return menuItems;
  67 + },
  68 +
  69 + allMenuMultiItems : function() {
  70 + var menuMulti = [
  71 + {
  72 + fnId : 'mult-deleteMulti',
  73 + text : 'Delete selected Requests'
  74 + }
  75 + ];
  76 + return menuMulti;
  77 + },
  78 +
  79 + getAllContextMenuItems: function(){
  80 + return this.allMenuItems();
  81 + },
  82 +
  83 + getMultiContextMenuItems: function(){
  84 + return this.allMenuMultiItems();
  85 + },
  86 +
  87 + onMenuItemClick : function(menu,item,event) {
  88 + // fnId parsing :
  89 + var fnId = Ext.util.Format.substr(item.fnId, 5, item.fnId.length);
  90 +
  91 + switch (fnId) {
  92 +
  93 + case 'createDir':
  94 + this.createDir();
  95 + break;
  96 +
  97 + case 'deleteNode':
  98 + this.deleteNode();
  99 + break;
  100 +
  101 + case 'renameNode':
  102 + this.renameNode();
  103 + break;
  104 +
  105 + case 'editPlot':
  106 + this.editLeaf(this);
  107 + break;
  108 +
  109 + case 'editDownload':
  110 + amdaModel.DownloadNode.set('realLinkedNode',this);
  111 +
  112 + if (!this.get('object')){
  113 + AmdaAction.getObject(this.get('id'), this.get('nodeType'), amdaModel.DownloadNode.getObjectCallback, this);
  114 + }
  115 + else {
  116 + var downObject = amdaModel.DownloadNode.decodeObject();
  117 + amdaModel.DownloadNode.set('object',Ext.create('amdaModel.Download',downObject));
  118 + amdaModel.DownloadNode.editInModule();
  119 + }
  120 + break;
  121 +
  122 + case 'deleteMulti':
  123 + this.deleteMulti();
  124 + break;
  125 +
  126 + default:
  127 + break;
  128 + } // switch end
  129 + }
  130 +
  131 +});
... ...
js/app/models/PlotObjects/PlotObjectConfig.js 0 → 100644
... ... @@ -0,0 +1,99 @@
  1 +/**
  2 + * Project  : AMDA-NG
  3 + * Name : PlotObjectConfig.js
  4 + * @class amdaPlotObj.PlotObjectConfig
  5 + * @extends Ext.data.Model
  6 + * @brief Plot Request object configuration
  7 + * @author Benjamin Renard
  8 + * @version $Id: PlotObjectConfig.js benjamin $
  9 + ******************************************************************************
  10 + * FT Id : Date : Name - Description
  11 + ******************************************************************************
  12 + * : :21/07/2015: BRE - file creation
  13 + */
  14 +
  15 +
  16 +Ext.define('amdaPlotObj.PlotObjectConfig', {
  17 + singleton: true,
  18 +
  19 + defaultValues : {
  20 + file : {
  21 + format : 'PNG',
  22 + output : 'INTERACTIVE',
  23 + oneFilePerInterval: false
  24 + },
  25 + page : {
  26 + xMargin : 15.,
  27 + yMargin : 20.,
  28 + mode : 'color',
  29 + orientation: 'landscape',
  30 + dimension : 'ISO A4',
  31 + title : {
  32 + position: 'top',
  33 + alignment: ' center',
  34 + color: '#000000'
  35 + },
  36 + font : {
  37 + name : 'sans-serif',
  38 + size: '12'
  39 + }
  40 + }
  41 + },
  42 +
  43 + availableFileFormats : [
  44 + {'key' : 'PNG', 'value' : 'PNG'},
  45 + {'key' : 'PDF', 'value' : 'PDF'},
  46 + {'key' : 'PS', 'value' : 'PS'},
  47 + {'key' : 'SVG', 'value' : 'SVG'}
  48 + ],
  49 +
  50 + availableFileOutputsForPng : [
  51 + {'key' : 'INTERACTIVE', 'value' : 'Interactive mode'},
  52 + {'key' : 'TGZ', 'value' : 'tar+gzip archive'},
  53 + {'key' : 'ZIP', 'value' : 'zip archive'}
  54 + ],
  55 +
  56 + availableFileOutputsForOtherFormats : [
  57 + {'key' : 'TGZ', 'value' : 'tar+gzip archive'},
  58 + {'key' : 'ZIP', 'value' : 'zip archive'}
  59 + ],
  60 +
  61 + availablePageModes : [
  62 + {'key' : 'color', 'value' : 'Color'},
  63 + {'key' : 'grayscale', 'value' : 'Grayscale'}
  64 + ],
  65 +
  66 + availablePageOrientations : [
  67 + {'key' : 'landscape', 'value' : 'Lanscape'},
  68 + {'key' : 'portrait', 'value' : 'Portrait'}
  69 + ],
  70 +
  71 + availablePageDimensions : [
  72 + {'key' : 'ISO A4', 'value' : 'ISO A4'},
  73 + {'key' : 'US letter', 'value' : 'US letter'}
  74 + ],
  75 +
  76 + availableFontNames : [
  77 + {'key' : 'sans-serif', 'value' : 'sans-serif'},
  78 + {'key' : 'serif', 'value' : 'serif'},
  79 + {'key' : 'monospace', 'value' : 'monospace'},
  80 + {'key' : 'script', 'value' : 'script'}
  81 + ],
  82 +
  83 + availableTitlePositions : [
  84 + {'key' : 'top', 'value' : 'Top'},
  85 + {'key' : 'bottom', 'value' : 'Bottom'}
  86 + ],
  87 +
  88 + availableTitleAlignments : [
  89 + {'key' : 'center', 'value' : 'Center'},
  90 + {'key' : 'left', 'value' : 'Left'},
  91 + {'key' : 'right', 'value' : 'Right'}
  92 + ],
  93 +
  94 + availableColors : [
  95 + {'color' : '#000000', 'value' : 'Black'},
  96 + {'color' : '#0000FF', 'value' : 'Blue'},
  97 + {'color' : '#FF0000', 'value' : 'Red'}
  98 + ]
  99 +});
0 100 \ No newline at end of file
... ...
js/app/models/PlotObjects/PlotRequestObject.js 0 → 100644
... ... @@ -0,0 +1,98 @@
  1 +/**
  2 + * Project  : AMDA-NG
  3 + * Name : PlotRequestObject.js
  4 + * @class amdaPlotObj.PlotRequestObject
  5 + * @extends amdaModel.AmdaTimeObject
  6 + * @brief Plot Request Business Object Definition
  7 + * @author Benjamin Renard
  8 + * @version $Id: PlotRequestObject.js benjamin $
  9 + ******************************************************************************
  10 + * FT Id : Date : Name - Description
  11 + ******************************************************************************
  12 + * : :21/07/2015: BRE - file creation
  13 + */
  14 +
  15 +
  16 +Ext.define('amdaPlotObj.PlotRequestObject', {
  17 + extend: 'amdaModel.AmdaTimeObject',
  18 + idProperty: 'id',
  19 +
  20 + requires: [
  21 + 'amdaPlotObj.PlotObjectConfig',
  22 + 'amdaPlotObj.PlotTabObject'
  23 + ],
  24 +
  25 + fields : [
  26 + {name: 'id', type:'string'},
  27 + {name: 'file-format', type: 'string'},
  28 + {name: 'file-output', type: 'string'},
  29 + {name: 'file-prefix', type: 'string'},
  30 + {name: 'one-file-per-interval', type: 'boolean'},
  31 + {name: 'request-name', type: 'string'}
  32 + ],
  33 +
  34 + hasMany: {
  35 + model : 'amdaPlotObj.PlotTabObject',
  36 + name : 'tabs'
  37 + },
  38 +
  39 + setDefaultValues: function()
  40 + {
  41 + this.set('file-format', amdaPlotObj.PlotObjectConfig.defaultValues.file.format);
  42 + this.set('file-output', amdaPlotObj.PlotObjectConfig.defaultValues.file.output);
  43 + this.set('file-prefix', '');
  44 + this.set('one-file-per-interval', amdaPlotObj.PlotObjectConfig.defaultValues.file.oneFilePerInterval);
  45 + this.set('request-name', '');
  46 + },
  47 +
  48 + getJsonValues : function(hasId)
  49 + {
  50 + var requestValues = new Object();
  51 +
  52 + requestValues['nodeType'] = 'request';
  53 +
  54 + if (hasId) {
  55 + requestValues['id'] = this.get('id');
  56 + }
  57 +
  58 + requestValues['file-format'] = this.get('file-format');
  59 + requestValues['file-output'] = this.get('file-output');
  60 + requestValues['file-prefix'] = this.get('file-prefix');
  61 + requestValues['one-file-per-interval'] = this.get('one-file-per-interval');
  62 + requestValues['request-name'] = this.get('request-name');
  63 +
  64 + requestValues['timesrc'] = "Interval";//BRE - ToDo this.get('timesrc');
  65 + // if there's at least one timeTable name into 'timeTables' collection
  66 + if (this.get('timesrc') == amdaModel.AmdaTimeObject.inputTimeSrc[0] && this.get('timeTables') && this.get('timeTables').length){
  67 + // get complete timeTables collection
  68 + var timeTables = this.get('timeTables');
  69 + // init an empty array for timeTables
  70 + requestValues['timeTables'] = [];
  71 + // for each interval record
  72 + Ext.Array.each(timeTables, function(item, index, all){
  73 + if (!item.$className) {
  74 + requestValues['timeTables'][index] = {timeTableName : item.timeTableName, id : item.id};
  75 + }
  76 + // get Json simplified value
  77 + else {
  78 + requestValues['timeTables'][index] = item.getJsonValues();
  79 + }
  80 + });
  81 + } else {
  82 + requestValues['startDate'] = this.get('startDate');
  83 + requestValues['stopDate'] = this.get('stopDate');
  84 + requestValues['durationDay'] = this.get('durationDay');
  85 + requestValues['durationHour'] = this.get('durationHour');
  86 + requestValues['durationMin'] = this.get('durationMin');
  87 + requestValues['durationSec'] = this.get('durationSec');
  88 + }
  89 +
  90 + requestValues['tabs'] = [];
  91 +
  92 + this.tabs().each(function (tab, index) {
  93 + requestValues['tabs'][index] = tab.getJsonValues();
  94 + });
  95 +
  96 + return requestValues;
  97 + }
  98 +});
0 99 \ No newline at end of file
... ...
js/app/models/PlotObjects/PlotTabObject.js 0 → 100644
... ... @@ -0,0 +1,111 @@
  1 +/**
  2 + * Project  : AMDA-NG
  3 + * Name : PlotTabObject.js
  4 + * @class amdaPlotObj.PlotTabObject
  5 + * @extends Ext.data.Model
  6 + * @brief Plot Tab Business Object Definition
  7 + * @author Benjamin Renard
  8 + * @version $Id: PlotTabObject.js benjamin $
  9 + ******************************************************************************
  10 + * FT Id : Date : Name - Description
  11 + ******************************************************************************
  12 + * : :22/07/2015: BRE - file creation
  13 + */
  14 +
  15 +
  16 +Ext.define('amdaPlotObj.PlotTabObject', {
  17 + extend: 'Ext.data.Model',
  18 +
  19 + requires: [
  20 + 'amdaPlotObj.PlotObjectConfig'
  21 + ],
  22 +
  23 + fields : [
  24 + {name: 'id', type: 'string'},
  25 + {name: 'page-title-text', type: 'string'},
  26 + {name: 'page-title-color', type: 'string'},
  27 + {name: 'page-title-position', type: 'string'},
  28 + {name: 'page-title-alignment', type: 'string'},
  29 + {name: 'page-title-font-activated', type: 'boolean'},
  30 + {name: 'page-title-font-name', type: 'string'},
  31 + {name: 'page-title-font-size', type: 'int'},
  32 + {name: 'page-title-font-bold', type: 'boolean'},
  33 + {name: 'page-title-font-italic', type: 'boolean'},
  34 + {name: 'page-margins-activated', type: 'boolean'},
  35 + {name: 'page-margin-x', type: 'float'},
  36 + {name: 'page-margin-y', type: 'float'},
  37 + {name: 'page-mode', type: 'string'},
  38 + {name: 'page-orientation', type: 'string'},
  39 + {name: 'page-dimension', type: 'string'},
  40 + {name: 'page-superpose-mode', type: 'boolean'},
  41 + {name: 'page-font-activated', type: 'boolean'},
  42 + {name: 'page-font-name', type: 'string'},
  43 + {name: 'page-font-size', type: 'int'},
  44 + {name: 'page-font-bold', type: 'boolean'},
  45 + {name: 'page-font-italic', type: 'boolean'}
  46 + ],
  47 +
  48 + associations : [
  49 + {
  50 + type : 'belongsTo',
  51 + model : 'amdaPlotObj.PlotRequestObject',
  52 + ownerName : 'request'
  53 + }
  54 + ],
  55 +
  56 + setDefaultValues: function()
  57 + {
  58 + this.set('page-title-text', '');
  59 + this.set('page-title-color', amdaPlotObj.PlotObjectConfig.defaultValues.page.title.color);
  60 + this.set('page-title-position', amdaPlotObj.PlotObjectConfig.defaultValues.page.title.position);
  61 + this.set('page-title-alignment', amdaPlotObj.PlotObjectConfig.defaultValues.page.title.alignment);
  62 +
  63 + this.set('page-title-font-activated', false);
  64 + this.set('page-title-font-name', amdaPlotObj.PlotObjectConfig.defaultValues.page.font.name);
  65 + this.set('page-title-font-size', amdaPlotObj.PlotObjectConfig.defaultValues.page.font.size);
  66 + this.set('page-title-font-bold', false);
  67 + this.set('page-title-font-italic', false);
  68 +
  69 + this.set('page-margins-activated', false);
  70 + this.set('page-margin-x', amdaPlotObj.PlotObjectConfig.defaultValues.page.xMargin);
  71 + this.set('page-margin-y', amdaPlotObj.PlotObjectConfig.defaultValues.page.yMargin);
  72 + this.set('page-mode', amdaPlotObj.PlotObjectConfig.defaultValues.page.mode);
  73 + this.set('page-orientation', amdaPlotObj.PlotObjectConfig.defaultValues.page.orientation);
  74 + this.set('page-dimension', amdaPlotObj.PlotObjectConfig.defaultValues.page.dimension);
  75 + this.set('page-superpose-mode', false);
  76 + this.set('page-font-activated', false);
  77 + this.set('page-font-name', amdaPlotObj.PlotObjectConfig.defaultValues.page.font.name);
  78 + this.set('page-font-size', amdaPlotObj.PlotObjectConfig.defaultValues.page.font.size);
  79 + this.set('page-font-bold', false);
  80 + this.set('page-font-italic', false);
  81 + },
  82 +
  83 + getJsonValues : function(hasId)
  84 + {
  85 + var tabValues = new Object();
  86 +
  87 + tabValues['page-title-text'] = this.get('page-title-text');
  88 + tabValues['page-title-color'] = this.get('page-title-color');
  89 + tabValues['page-title-position'] = this.get('page-title-position');
  90 + tabValues['page-title-alignment'] = this.get('page-title-alignment');
  91 + tabValues['page-title-font-activated'] = this.get('page-title-font-activated');
  92 + tabValues['page-title-font-name'] = this.get('page-title-font-name');
  93 + tabValues['page-title-font-size'] = this.get('page-title-font-size');
  94 + tabValues['page-title-font-bold'] = this.get('page-title-font-bold');
  95 + tabValues['page-title-font-italic'] = this.get('page-title-font-italic');
  96 + tabValues['page-margins-activated'] = this.get('page-margins-activated');
  97 + tabValues['page-margin-x'] = this.get('page-margin-x');
  98 + tabValues['page-margin-y'] = this.get('page-margin-y');
  99 + tabValues['page-mode'] = this.get('page-mode');
  100 + tabValues['page-orientation'] = this.get('page-orientation');
  101 + tabValues['page-dimension'] = this.get('page-dimension');
  102 + tabValues['page-superpose-mode'] = this.get('page-superpose-mode');
  103 + tabValues['page-font-activated'] = this.get('page-font-activated');
  104 + tabValues['page-font-name'] = this.get('page-font-name');
  105 + tabValues['page-font-size'] = this.get('page-font-size');
  106 + tabValues['page-font-bold'] = this.get('page-font-bold');
  107 + tabValues['page-font-italic'] = this.get('page-font-italic');
  108 +
  109 + return tabValues;
  110 + }
  111 +});
0 112 \ No newline at end of file
... ...
js/app/models/PlotObjects/PlotTreeNode.js 0 → 100644
... ... @@ -0,0 +1,117 @@
  1 +/**
  2 + * Project  : AMDA-NG
  3 + * Name : PlotTreeNode.js
  4 + * @class amdaPlotObj.PlotTreeNode
  5 + * @extends Ext.data.Model
  6 + * @brief Plot Tree Node Definition
  7 + * @author Benjamin Renard
  8 + * @version $Id: PlotTreeNode.js benjamin $
  9 + ******************************************************************************
  10 + * FT Id : Date : Name - Description
  11 + ******************************************************************************
  12 + * : :23/07/2015: BRE - file creation
  13 + */
  14 +
  15 +Ext.define('amdaPlotObj.PlotTreeNode', {
  16 + extend: 'Ext.data.Model',
  17 +
  18 + //Node type
  19 + type: '',
  20 +
  21 + //Node text
  22 + text: '',
  23 +
  24 + //Node icon class
  25 + iconCls: '',
  26 +
  27 + //Node leaf
  28 + leaf: false,
  29 +
  30 + //Link to the object associated to this node
  31 + object: null,
  32 +
  33 + constructor : function(config)
  34 + {
  35 + this.callParent(arguments);
  36 + this.set('text',this.text);
  37 + this.set('iconCls',this.iconCls);
  38 + this.set('leaf',this.leaf);
  39 + this.set('expanded',true);
  40 + if (config && config.object)
  41 + this.object = config.object;
  42 + }
  43 +}, function () {
  44 + Ext.data.NodeInterface.decorate(this);
  45 +});
  46 +
  47 +Ext.define('amdaPlotObj.PlotPageTreeNode', {
  48 + extend: 'amdaPlotObj.PlotTreeNode',
  49 +
  50 + iconCls: 'icon-plot-page',
  51 +
  52 + text: 'Page',
  53 +
  54 + type: 'page'
  55 +});
  56 +
  57 +Ext.define('amdaPlotObj.PlotLayoutTreeNode', {
  58 + extend: 'amdaPlotObj.PlotTreeNode',
  59 +
  60 + leaf: true,
  61 +
  62 + iconCls: 'icon-plot-layout',
  63 +
  64 + text: 'Layout',
  65 +
  66 + type: 'layout'
  67 +});
  68 +
  69 +Ext.define('amdaPlotObj.PlotPanelsTreeNode', {
  70 + extend: 'amdaPlotObj.PlotTreeNode',
  71 +
  72 + iconCls: 'icon-plot-panels',
  73 +
  74 + text: 'Panels list',
  75 +
  76 + type: 'panels'
  77 +});
  78 +
  79 +Ext.define('amdaPlotObj.PlotPanelTreeNode', {
  80 + extend: 'amdaPlotObj.PlotTreeNode',
  81 +
  82 + iconCls: 'icon-plot-panel',
  83 +
  84 + text: 'Panel',
  85 +
  86 + type: 'panel'
  87 +});
  88 +
  89 +Ext.define('amdaPlotObj.PlotAxisTreeNode', {
  90 + extend: 'amdaPlotObj.PlotTreeNode',
  91 +
  92 + iconCls: 'icon-plot-axis',
  93 +
  94 + text: 'Axis',
  95 +
  96 + type: 'axis'
  97 +});
  98 +
  99 +Ext.define('amdaPlotObj.PlotTimeAxisTreeNode', {
  100 + extend: 'amdaPlotObj.PlotTreeNode',
  101 +
  102 + iconCls: 'icon-plot-axis-t',
  103 +
  104 + text: 'Time Axis',
  105 +
  106 + type: 'time-axis'
  107 +});
  108 +
  109 +Ext.define('amdaPlotObj.PlotLegendsTreeNode', {
  110 + extend: 'amdaPlotObj.PlotTreeNode',
  111 +
  112 + iconCls: 'icon-plot-legends',
  113 +
  114 + text: 'Legends',
  115 +
  116 + type: 'legends'
  117 +});
... ...
js/app/views/NewPlotUI.js 0 → 100644
... ... @@ -0,0 +1,175 @@
  1 +/**
  2 + * Project  : AMDA-NG
  3 + * Name : NewPlotUI.js
  4 + * @class amdaUI.NewPlotUI
  5 + * @extends Ext.container.Container
  6 + * @brief New Plot Module UI definition (View)
  7 + * @author Benjamin Renard
  8 + * @version $Id: NewPlotUI.js benjamin $
  9 + */
  10 +
  11 +
  12 +Ext.define('amdaUI.NewPlotUI', {
  13 + extend: 'Ext.container.Container',
  14 + alias: 'widget.newPanelPlot',
  15 +
  16 + requires: [
  17 + 'amdaUI.TimeSelectorUI',
  18 + 'amdaPlotComp.PlotTabPanel',
  19 + 'amdaPlotComp.PlotOutputForm',
  20 + 'amdaPlotComp.PlotElementPanel'
  21 + ],
  22 +
  23 + formPanel: null,
  24 +
  25 + plotOutput: null,
  26 +
  27 + plotTabs : null,
  28 +
  29 + plotElement : null,
  30 +
  31 + constructor: function(config) {
  32 + this.init(config);
  33 + this.callParent(arguments);
  34 + if (this.object)
  35 + {
  36 + this.object.setDefaultValues();
  37 + //Force first tab creation
  38 + var tabs = this.object.tabs().add({id : 1});
  39 + tabs[0].setDefaultValues();
  40 + this.setObject(this.object);
  41 + }
  42 + },
  43 +
  44 + setObject : function(object) {
  45 + this.object = object;
  46 + this.plotOutput.setObject(this.object);
  47 + this.plotTabs.setRequestObject(this.object);
  48 + },
  49 +
  50 + /**
  51 + * plot method called by 'Do Plot' button to launch the plot process
  52 + */
  53 + doPlot : function(){
  54 + // fire execution
  55 + var plotModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id);
  56 + if (plotModule)
  57 + plotModule.linkedNode.execute();
  58 + },
  59 +
  60 + /**
  61 + * Check if changes were made before closing window
  62 + * @return false
  63 + */
  64 + fclose : function() {
  65 + return false;
  66 + },
  67 +
  68 + init : function(config) {
  69 + this.timeSelector = new amdaUI.TimeSelectorUI( { id: 'plotTimeSelector' + config.id, flex: 1, hidden: true } );
  70 +
  71 + this.plotOutput = new amdaPlotComp.PlotOutputForm({flex: 2});
  72 +
  73 + this.plotElement = new amdaPlotComp.PlotElementPanel({flex: 3});
  74 +
  75 + this.plotTabs = new amdaPlotComp.PlotTabPanel({flex: 2, plotElementPanel : this.plotElement});
  76 +
  77 + this.optionsPanel = new Ext.form.Panel({
  78 + layout: {
  79 + type: 'vbox',
  80 + pack: 'start',
  81 + align: 'stretch'
  82 + },
  83 + bodyStyle: { background : '#dfe8f6' },
  84 + defaults: {
  85 + border: false
  86 + },
  87 + items: [
  88 + this.plotElement,
  89 + this.plotOutput
  90 + ]
  91 + });
  92 +
  93 + this.formPanel = new Ext.form.Panel({
  94 + region: 'center',
  95 + layout: {
  96 + type: 'hbox',
  97 + pack: 'start',
  98 + align: 'stretch'
  99 + },
  100 + bodyStyle: { background : '#dfe8f6' },
  101 + defaults: {
  102 + border: false
  103 + },
  104 + items: [
  105 + {
  106 + xtype : 'panel',
  107 + layout: {
  108 + type: 'vbox',
  109 + pack: 'start',
  110 + align: 'stretch'
  111 + },
  112 + bodyStyle: { background : '#dfe8f6' },
  113 + defaults: {
  114 + border: false
  115 + },
  116 + flex: 1,
  117 + items: [
  118 + this.plotTabs,
  119 + this.timeSelector
  120 + ]
  121 + },
  122 + {
  123 + xtype : 'panel',
  124 + layout: 'fit',
  125 + bodyStyle: { background : '#dfe8f6' },
  126 + defaults: {
  127 + border: false
  128 + },
  129 + flex: 1,
  130 + items: [
  131 + this.optionsPanel
  132 + ]
  133 + }
  134 + ],
  135 + fbar: [
  136 + {
  137 + xtype: 'button',
  138 + text: 'Plot',
  139 + scope: this,
  140 + handler: function(button) {
  141 + this.doPlot();
  142 + }
  143 + },
  144 + ' ',
  145 + { xtype: 'button', text: 'Get Data' },
  146 + ' ',
  147 + { xtype: 'button', text: 'Reset' },
  148 + '->',
  149 + { xtype: 'button', text: 'Save Request' }
  150 + ]
  151 + });
  152 +
  153 + var myConf = {
  154 + layout: 'border',
  155 + items: [
  156 + this.formPanel,
  157 + {
  158 + xtype: 'panel',
  159 + region: 'south',
  160 + title: 'Information',
  161 + collapsible: true,
  162 + height: 100,
  163 + autoHide: false,
  164 + bodyStyle: 'padding:5px',
  165 + iconCls: 'icon-information',
  166 + loader: {
  167 + autoLoad: true,
  168 + url: helpDir+'plotHOWTO'
  169 + }
  170 + }
  171 + ]
  172 + };
  173 + Ext.apply (this , Ext.apply (arguments, myConf));
  174 + }
  175 +});
0 176 \ No newline at end of file
... ...
js/app/views/PlotComponents/PlotElementPanel.js 0 → 100644
... ... @@ -0,0 +1,62 @@
  1 +/**
  2 + * Project  : AMDA-NG
  3 + * Name : PlotElementPanel.js
  4 + * @class amdaPlotComp.PlotElementPanel
  5 + * @extends Ext.form.Panel
  6 + * @brief Element of a plot request definition
  7 + * @author Benjamin Renard
  8 + * @version $Id: PlotElementPanel.js benjamin $
  9 + */
  10 +
  11 +Ext.define('amdaPlotComp.PlotElementPanel', {
  12 + extend: 'Ext.form.Panel',
  13 +
  14 + requires: [
  15 + 'amdaPlotComp.PlotPageForm'
  16 + ],
  17 +
  18 + constructor: function(config) {
  19 + this.init(config);
  20 + this.callParent(arguments);
  21 + },
  22 +
  23 + setElement: function(type, object) {
  24 + this.removeAll();
  25 +
  26 + if (type == null || type == '')
  27 + {
  28 + this.add(new Ext.form.Label({text: 'Select an element to the tree to show options'}));
  29 + return;
  30 + }
  31 +
  32 + switch (type)
  33 + {
  34 + case 'page' :
  35 + var pageForm = new amdaPlotComp.PlotPageForm();
  36 + this.add(pageForm);
  37 + pageForm.setObject(object);
  38 + break;
  39 + default :
  40 + this.add(new Ext.form.Label({text: 'No available options for this element'}));
  41 + }
  42 + },
  43 +
  44 + resetElement: function() {
  45 + this.setElement(null,null);
  46 + },
  47 +
  48 + init : function(config) {
  49 + var me = this;
  50 +
  51 + var myConf = {
  52 + title : 'Selected element options',
  53 + bodyStyle: { background : '#dfe8f6' },
  54 + autoScroll: true,
  55 + defaults: {
  56 + border: false
  57 + }
  58 + };
  59 +
  60 + Ext.apply (this , Ext.apply (arguments, myConf));
  61 + }
  62 +});
0 63 \ No newline at end of file
... ...
js/app/views/PlotComponents/PlotOutputForm.js 0 → 100644
... ... @@ -0,0 +1,65 @@
  1 +/**
  2 + * Project  : AMDA-NG
  3 + * Name : PlotOutputForm.js
  4 + * @class amdaPlotComp.PlotOutputForm
  5 + * @extends amdaPlotComp.PlotStandardForm
  6 + * @brief Form to define output options
  7 + * @author Benjamin Renard
  8 + * @version $Id: PlotOutputForm.js benjamin $
  9 + */
  10 +
  11 +Ext.define('amdaPlotComp.PlotOutputForm', {
  12 + extend: 'amdaPlotComp.PlotStandardForm',
  13 +
  14 + title: 'output options',
  15 +
  16 + updateOneFilePerIntOption : function() {
  17 + var formatField = this.getForm().findField('file-format');
  18 + var oneFilePerIntField = this.getForm().findField('one-file-per-interval');
  19 +
  20 + oneFilePerIntField.setDisabled((formatField.getValue() == 'PNG') || (formatField.getValue() == 'SVG'));
  21 + },
  22 +
  23 + updateFilePrefixOption : function() {
  24 + var prefixField = this.getForm().findField('file-prefix');
  25 + var outputField = this.getForm().findField('file-output');
  26 +
  27 + if (outputField.getValue() == 'INTERACTIVE')
  28 + prefixField.setValue("");
  29 + prefixField.setDisabled(outputField.getValue() == 'INTERACTIVE');
  30 + },
  31 +
  32 + updateOutputOption : function() {
  33 + var formatField = this.getForm().findField('file-format');
  34 + var outputField = this.getForm().findField('file-output');
  35 +
  36 + if (formatField.getValue() == 'PNG')
  37 + {
  38 + outputField.getStore().loadData(amdaPlotObj.PlotObjectConfig.availableFileOutputsForPng);
  39 + outputField.setValue('INTERACTIVE');
  40 + }
  41 + else
  42 + {
  43 + outputField.getStore().loadData(amdaPlotObj.PlotObjectConfig.availableFileOutputsForOtherFormats);
  44 + if (outputField.getValue() == 'INTERACTIVE')
  45 + outputField.setValue('TGZ');
  46 + }
  47 + },
  48 +
  49 + getFormItems: function() {
  50 + var me = this;
  51 +
  52 + return [
  53 + this.addStandardCombo('file-format', 'File format', amdaPlotObj.PlotObjectConfig.availableFileFormats, function(name, value) {
  54 + me.updateOutputOption();
  55 + me.updateOneFilePerIntOption();
  56 + }),
  57 + this.addStandardCombo('file-output', 'File output', amdaPlotObj.PlotObjectConfig.availableFileOutputs, function(name, value) {
  58 + me.updateFilePrefixOption();
  59 + }),
  60 + this.addStandardText('file-prefix', 'File prefix'),
  61 + this.addStandardCheck('one-file-per-interval', 'One file per interval'),
  62 + this.addStandardText('request-name', 'Request name')
  63 + ];
  64 + }
  65 +});
0 66 \ No newline at end of file
... ...
js/app/views/PlotComponents/PlotPageForm.js 0 → 100644
... ... @@ -0,0 +1,37 @@
  1 +/**
  2 + * Project  : AMDA-NG
  3 + * Name : PlotPageForm.js
  4 + * @class amdaPlotComp.PlotPageForm
  5 + * @extends amdaPlotComp.PlotStandardForm
  6 + * @brief Form to define page options
  7 + * @author Benjamin Renard
  8 + * @version $Id: PlotPageForm.js benjamin $
  9 + */
  10 +
  11 +Ext.define('amdaPlotComp.PlotPageForm', {
  12 + extend: 'amdaPlotComp.PlotStandardForm',
  13 +
  14 + getFormItems: function() {
  15 + var titleItems = [
  16 + this.addStandardText('page-title-text', 'Text'),
  17 + this.addStandardColor('page-title-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors),
  18 + this.addStandardCombo('page-title-position', 'Position', amdaPlotObj.PlotObjectConfig.availableTitlePositions),
  19 + this.addStandardCombo('page-title-alignment', 'Alignment', amdaPlotObj.PlotObjectConfig.availableTitleAlignments),
  20 + this.addStandardFont('page-title-font')
  21 + ];
  22 +
  23 + var marginItems = [
  24 + this.addStandardFloat('page-margin-x', 'Horizontal', 0, 100),
  25 + this.addStandardFloat('page-margin-y', 'Vertical', 0, 100)
  26 + ];
  27 +
  28 + return [
  29 + this.addStandardCombo('page-mode', 'Mode', amdaPlotObj.PlotObjectConfig.availablePageModes),
  30 + this.addStandardCombo('page-orientation', 'Orientation', amdaPlotObj.PlotObjectConfig.availablePageOrientations),
  31 + this.addStandardCombo('page-dimension', 'Dimension', amdaPlotObj.PlotObjectConfig.availablePageDimensions),
  32 + this.addStandardFieldSet('Title', '', titleItems),
  33 + this.addStandardFieldSet('Margins', 'page-margins-activated', marginItems),
  34 + this.addStandardFont('page-font')
  35 + ];
  36 + }
  37 +});
0 38 \ No newline at end of file
... ...
js/app/views/PlotComponents/PlotStandardForm.js 0 → 100644
... ... @@ -0,0 +1,245 @@
  1 +/**
  2 + * Project  : AMDA-NG
  3 + * Name : PlotStandardForm.js
  4 + * @class amdaPlotComp.PlotStandardForm
  5 + * @extends Ext.form.Panel
  6 + * @brief Standard Form used to define some options for a plot element
  7 + * @author Benjamin Renard
  8 + * @version $Id: PlotStandardForm.js benjamin $
  9 + */
  10 +
  11 +Ext.define('amdaPlotComp.PlotStandardForm', {
  12 + extend: 'Ext.form.Panel',
  13 +
  14 + requires : [
  15 + 'amdaPlotObj.PlotObjectConfig'
  16 + ],
  17 +
  18 + //Object associated to this form
  19 + object: null,
  20 +
  21 + constructor: function(config) {
  22 + this.init(config);
  23 + this.callParent(arguments);
  24 + },
  25 +
  26 + setObject : function(object) {
  27 + this.object = object;
  28 + this.loadRecord(this.object);
  29 + },
  30 +
  31 + //To override to add form components
  32 + getFormItems: function() {
  33 + return [];
  34 + },
  35 +
  36 + addStandardText: function(name, label) {
  37 + return {
  38 + xtype: 'textfield',
  39 + name: name,
  40 + fieldLabel: label,
  41 + listeners: {
  42 + change: function(field, newValue, oldValue, eOpts) {
  43 + this.object.set(name, newValue);
  44 + },
  45 + scope: this
  46 + }
  47 + };
  48 + },
  49 +
  50 + addStandardFloat: function(name, label, min, max) {
  51 + return {
  52 + xtype: 'numberfield',
  53 + name: name,
  54 + fieldLabel: label,
  55 + decimalPrecision : 3,
  56 + minValue : min,
  57 + maxValue : max,
  58 + listeners: {
  59 + change: function(field, newValue, oldValue, eOpts) {
  60 + this.object.set(name, newValue);
  61 + },
  62 + scope: this
  63 + }
  64 + };
  65 + },
  66 +
  67 + addStandardCombo: function(name, label, availableData, onChange) {
  68 + var comboStore = Ext.create('Ext.data.Store', {
  69 + fields: ['key', 'value'],
  70 + data : availableData
  71 + });
  72 +
  73 + return {
  74 + xtype: 'combo',
  75 + name: name,
  76 + fieldLabel: label,
  77 + store: comboStore,
  78 + queryMode: 'local',
  79 + displayField: 'value',
  80 + valueField: 'key',
  81 + listeners: {
  82 + change: function(combo, newValue, oldValue, eOpts) {
  83 + this.object.set(name, newValue);
  84 + if (onChange != null)
  85 + onChange(name, newValue);
  86 + },
  87 + scope: this
  88 + }
  89 + };
  90 + },
  91 +
  92 + addStandardCheck: function(name, label) {
  93 + return {
  94 + xtype: 'checkbox',
  95 + name: name,
  96 + boxLabel: label,
  97 + listeners: {
  98 + change: function(combo, newValue, oldValue, eOpts) {
  99 + this.object.set(name, newValue);
  100 + },
  101 + scope: this
  102 + }
  103 + };
  104 + },
  105 +
  106 + addStandardFieldSet: function(title, checkboxName, items) {
  107 + return {
  108 + xtype: 'fieldset',
  109 + title: title,
  110 + collapsible: true,
  111 + collapsed: true,
  112 + checkboxName: checkboxName,
  113 + checkboxToggle: checkboxName != '',
  114 + layout: {
  115 + type: 'vbox',
  116 + pack: 'start',
  117 + align: 'stretch'
  118 + },
  119 + items: items,
  120 + listeners: {
  121 + expand: function(fieldset, eOpts) {
  122 + if (checkboxName != '')
  123 + this.object.set(checkboxName, true);
  124 + },
  125 + collapse: function(fieldset, eOpts) {
  126 + if (checkboxName != '')
  127 + this.object.set(checkboxName, false);
  128 + },
  129 + scope: this
  130 + }
  131 + };
  132 + },
  133 +
  134 + addStandardFont: function(namePrefix) {
  135 + var fontItems = [
  136 + this.addStandardCombo(namePrefix+'-name', 'Name', amdaPlotObj.PlotObjectConfig.availableFontNames),
  137 + {
  138 + xtype : 'toolbar',
  139 + bodyStyle: { background : '#dfe8f6' },
  140 + border: false,
  141 + items : [
  142 + {
  143 + xtype: 'numberfield',
  144 + name: namePrefix+'-size',
  145 + fieldLabel: 'Size',
  146 + labelWidth: 60,
  147 + width: 150,
  148 + maxValue: 32,
  149 + minValue: 6,
  150 + value: 12,
  151 + listeners: {
  152 + change: function(field, newValue, oldValue, eOpts) {
  153 + this.object.set(namePrefix+'-size', newValue);
  154 + },
  155 + scope: this
  156 + }
  157 + },
  158 + ' ',
  159 + {
  160 + xtype: 'checkbox',
  161 + name: namePrefix+'-bold',
  162 + boxLabel: '<b>B</b>',
  163 + width: 30,
  164 + listeners: {
  165 + change: function(combo, newValue, oldValue, eOpts) {
  166 + this.object.set(namePrefix+'-bold', newValue);
  167 + },
  168 + scope: this
  169 + }
  170 + },
  171 + {
  172 + xtype: 'checkbox',
  173 + name: namePrefix+'-italic',
  174 + boxLabel: '<i>I</i>',
  175 + width: 30,
  176 + listeners: {
  177 + change: function(combo, newValue, oldValue, eOpts) {
  178 + this.object.set(namePrefix+'-italic', newValue);
  179 + },
  180 + scope: this
  181 + }
  182 + }
  183 + ]
  184 + }
  185 + ];
  186 +
  187 + return this.addStandardFieldSet('Font', namePrefix+'-activated', fontItems);
  188 + },
  189 +
  190 + addStandardColor: function(name, label, availableData, onChange) {
  191 + var comboStore = Ext.create('Ext.data.Store', {
  192 + fields: ['color', 'value'],
  193 + data : availableData
  194 + });
  195 +
  196 + return {
  197 + xtype: 'combo',
  198 + name: name,
  199 + fieldLabel: label,
  200 + store: comboStore,
  201 + queryMode: 'local',
  202 + displayField: 'value',
  203 + valueField: 'color',
  204 + tpl: Ext.create('Ext.XTemplate',
  205 + '<ul class="x-list-plain"><tpl for=".">',
  206 + '<li role="option" class="x-boundlist-item" style="color: {color};">{value}</li>',
  207 + '</tpl></ul>'
  208 + ),
  209 + // template for the content inside text field
  210 + displayTpl: Ext.create('Ext.XTemplate',
  211 + '<tpl for=".">',
  212 + '{value}',
  213 + '</tpl>'
  214 + ),
  215 +
  216 +
  217 + listeners: {
  218 + change: function(combo, newValue, oldValue, eOpts) {
  219 + this.object.set(name, newValue);
  220 + if (onChange != null)
  221 + onChange(name, newValue);
  222 + },
  223 + scope: this
  224 + }
  225 + };
  226 + },
  227 +
  228 + init : function(config) {
  229 + var me = this;
  230 +
  231 + var myConf = {
  232 + bodyPadding: 5,
  233 + bodyStyle: { background : '#dfe8f6' },
  234 + border: false,
  235 + layout: {
  236 + type: 'vbox',
  237 + pack: 'start',
  238 + align: 'stretch'
  239 + },
  240 + items: this.getFormItems()
  241 + };
  242 +
  243 + Ext.apply (this , Ext.apply (arguments, myConf));
  244 + }
  245 +});
0 246 \ No newline at end of file
... ...
js/app/views/PlotComponents/PlotTabContent.js 0 → 100644
... ... @@ -0,0 +1,65 @@
  1 +/**
  2 + * Project  : AMDA-NG
  3 + * Name : PlotTab.js
  4 + * @class amdaPlotComp.PlotTab
  5 + * @extends Ext.form.Panel
  6 + * @brief Tab content to define a plot
  7 + * @author Benjamin Renard
  8 + * @version $Id: PlotTab.js benjamin $
  9 + */
  10 +
  11 +Ext.define('amdaPlotComp.PlotTabContent', {
  12 + extend: 'Ext.form.Panel',
  13 +
  14 + requires: [
  15 + 'amdaUI.TimeSelectorUI',
  16 + 'amdaPlotComp.PlotTree'
  17 + ],
  18 +
  19 + treePlot: null,
  20 +
  21 + //Link to the Plot Element Panel
  22 + plotElementPanel: null,
  23 +
  24 + //Tab Object
  25 + object: null,
  26 +
  27 + constructor: function(config) {
  28 + this.init(config);
  29 + this.callParent(arguments);
  30 + },
  31 +
  32 + setTabObject : function(object) {
  33 + this.object = object;
  34 + this.treePlot.buildTree(this.object);
  35 + },
  36 +
  37 + init : function(config) {
  38 + var me = this;
  39 +
  40 + this.plotElementPanel = config.plotElementPanel;
  41 +
  42 + var timeSelector = new amdaUI.TimeSelectorUI( { id: 'plotTimeSelector' + config.tabNumber, flex: 2} );
  43 + this.treePlot = new amdaPlotComp.PlotTree({flex: 3, plotElementPanel: this.plotElementPanel});
  44 +
  45 + var myConf = {
  46 + bodyStyle: { background : '#dfe8f6' },
  47 + defaults: {
  48 + border: false
  49 + },
  50 + layout: {
  51 + type: 'vbox',
  52 + pack: 'start',
  53 + align: 'stretch'
  54 + },
  55 + items: [
  56 + this.treePlot,
  57 + timeSelector
  58 + ]
  59 + };
  60 +
  61 + Ext.apply (this , Ext.apply (arguments, myConf));
  62 +
  63 +
  64 + }
  65 +});
0 66 \ No newline at end of file
... ...
js/app/views/PlotComponents/PlotTabPanel.js 0 → 100644
... ... @@ -0,0 +1,105 @@
  1 +/**
  2 + * Project  : AMDA-NG
  3 + * Name : PlotTabPanel.js
  4 + * @class amdaPlotComp.PlotTabPanel
  5 + * @extends Ext.tab.Panel
  6 + * @brief Component use to show Plot tabs definition
  7 + * @author Benjamin Renard
  8 + * @version $Id: PlotTabPanel.js benjamin $
  9 + */
  10 +
  11 +Ext.define('amdaPlotComp.PlotTabPanel', {
  12 + extend: 'Ext.tab.Panel',
  13 +
  14 + requires: [
  15 + 'amdaPlotComp.PlotTabContent'
  16 + ],
  17 +
  18 + //Link to the Plot Element Panel
  19 + plotElementPanel: null,
  20 +
  21 + //Request object
  22 + object: null,
  23 +
  24 + constructor: function(config) {
  25 + this.init(config);
  26 + this.callParent(arguments);
  27 + },
  28 +
  29 + setRequestObject: function(object)
  30 + {
  31 + this.object = object;
  32 + this.object.tabs().each(function (rec) {
  33 + var tabContent = this.addPlotTab();
  34 + tabContent.setTabObject(rec);
  35 + }, this);
  36 + },
  37 +
  38 + addPlotTab: function()
  39 + {
  40 + var addIndex = this.items.length;
  41 + var tabContent = new amdaPlotComp.PlotTabContent({tabNumber: addIndex+1, plotElementPanel: this.plotElementPanel});
  42 + this.add({
  43 + title: 'Plot '+(addIndex+1),
  44 + closable: true,
  45 + layout: 'fit',
  46 + bodyStyle: 'background: none',
  47 + defaults: {
  48 + border: false
  49 + },
  50 + items: [
  51 + tabContent
  52 + ]
  53 + }).show();
  54 +
  55 + return tabContent;
  56 + },
  57 +
  58 + getTreeFromPlotTab: function(plotTab)
  59 + {
  60 + return plotTab.child().treePlot;
  61 + },
  62 +
  63 + init : function(config) {
  64 + var me = this;
  65 +
  66 + this.plotElementPanel = config.plotElementPanel;
  67 +
  68 + var myConf = {
  69 + plain: true,
  70 + bodyStyle: { background : '#dfe8f6' },
  71 + defaults: {
  72 + border: false
  73 + },
  74 +
  75 + tabBar:{
  76 + items:[
  77 + {
  78 + text:'+',
  79 + closable: false,
  80 + handler:function(btn,e){
  81 + var tabContent = me.addPlotTab();
  82 + console.log(me.object.tabs());
  83 + var recs = me.object.tabs().add({id : me.object.tabs().length+1});
  84 +
  85 + recs[0].setDefaultValues();
  86 + tabContent.setTabObject(recs[0]);
  87 + }
  88 + }]
  89 + },
  90 +
  91 + listeners: {
  92 + tabchange: function(tabPanel, newCard, oldCard, eOpts ) {
  93 + var selectedNode = this.getTreeFromPlotTab(newCard).getSelectedNode();
  94 + if (selectedNode == null)
  95 + me.plotElementPanel.resetElement();
  96 + else
  97 + me.plotElementPanel.setElement(selectedNode.type,selectedNode.object);
  98 + },
  99 + scope: me
  100 + }
  101 + };
  102 +
  103 + Ext.apply (this , Ext.apply (arguments, myConf));
  104 + }
  105 +});
0 106 \ No newline at end of file
... ...
js/app/views/PlotComponents/PlotTree.js 0 → 100644
... ... @@ -0,0 +1,84 @@
  1 +/**
  2 + * Project  : AMDA-NG
  3 + * Name : PlotTree.js
  4 + * @class amdaPlotComp.PlotTree
  5 + * @extends Ext.tree.Panel
  6 + * @brief Tree to define all elements of a plot
  7 + * @author Benjamin Renard
  8 + * @version $Id: PlotTree.js benjamin $
  9 + */
  10 +
  11 +Ext.define('amdaPlotComp.PlotTree', {
  12 + extend: 'Ext.tree.Panel',
  13 +
  14 + requires: [
  15 + 'amdaPlotObj.PlotTreeNode'
  16 + ],
  17 +
  18 + //Link to the Plot Element Panel
  19 + plotElementPanel: null,
  20 +
  21 + //Tab object
  22 + object: null,
  23 +
  24 + constructor: function(config) {
  25 + this.init(config);
  26 + this.callParent(arguments);
  27 + },
  28 +
  29 + buildTree: function(tabObject) {
  30 + this.object = tabObject;
  31 +
  32 + //Page Node
  33 + var pageNode = this.store.getRootNode().appendChild(new amdaPlotObj.PlotPageTreeNode({object : tabObject}));
  34 +
  35 + //Layout node
  36 + pageNode.appendChild(new amdaPlotObj.PlotLayoutTreeNode());
  37 +
  38 + //Panels node
  39 + var panelsNode = pageNode.appendChild(new amdaPlotObj.PlotPanelsTreeNode());
  40 +
  41 + //Panel for test
  42 + var panelNode = panelsNode.appendChild(new amdaPlotObj.PlotPanelTreeNode());
  43 + var axisNode = panelNode.appendChild(new amdaPlotObj.PlotAxisTreeNode());
  44 + axisNode.appendChild(new amdaPlotObj.PlotTimeAxisTreeNode());
  45 + panelNode.appendChild(new amdaPlotObj.PlotLegendsTreeNode());
  46 + },
  47 +
  48 + onNodeSelect: function(tree,record, index, eOpts) {
  49 + if (this.plotElementPanel != null)
  50 + this.plotElementPanel.setElement(record.type, record.object);
  51 + },
  52 +
  53 + getSelectedNode: function() {
  54 + var selection = this.getSelectionModel().getSelection();
  55 + if ((selection == null) || (selection.length == 0))
  56 + return null;
  57 + return selection[0];
  58 + },
  59 +
  60 + init : function(config) {
  61 + var me = this;
  62 +
  63 + this.plotElementPanel = config.plotElementPanel;
  64 +
  65 + var store = Ext.create('Ext.data.TreeStore', {
  66 + root: {
  67 + expanded: true
  68 + }
  69 + });
  70 +
  71 + this.plotElementPanel = config.plotElementPanel;
  72 +
  73 + var myConf = {
  74 + store: store,
  75 + rootVisible: false,
  76 + listeners: {
  77 + select: me.onNodeSelect,
  78 + scope: me
  79 + }
  80 + };
  81 +
  82 + Ext.apply (this , Ext.apply (arguments, myConf));
  83 + }
  84 +});
0 85 \ No newline at end of file
... ...
js/app/views/TimeSelectorUI.js
... ... @@ -20,7 +20,7 @@ Ext.define(&#39;amdaUI.TimeSelectorUI&#39;,
20 20  
21 21 setTTTab: function(arrayTT)
22 22 {
23   - var arrayRec = new Array();
  23 + /*var arrayRec = new Array();
24 24 var index = 1;
25 25 if (arrayTT)
26 26 {
... ... @@ -47,7 +47,7 @@ Ext.define(&#39;amdaUI.TimeSelectorUI&#39;,
47 47 obj['timesrc_' + this.id] = this.activeTab;
48 48 this.timeSrc.setValue(obj);
49 49  
50   - if (index === 0) this.TTGrid.getStore().loadData(arrayRec);
  50 + if (index === 0) this.TTGrid.getStore().loadData(arrayRec); */
51 51 },
52 52  
53 53 addTT : function(newTTName,newTTid)
... ... @@ -79,9 +79,8 @@ Ext.define(&#39;amdaUI.TimeSelectorUI&#39;,
79 79  
80 80 this.TTGrid = Ext.create('Ext.grid.Panel',
81 81 {
82   - height: 100,
83 82 itemId: 1,
84   - store : store,
  83 + store : store,
85 84 columns:
86 85 [
87 86 Ext.create('Ext.grid.RowNumberer', { width: 20 } ),
... ... @@ -217,13 +216,34 @@ Ext.define(&#39;amdaUI.TimeSelectorUI&#39;,
217 216 }
218 217 };
219 218  
220   - this.timeSrc = new Ext.form.RadioGroup(
  219 + this.timeSrc = new Ext.tab.Panel(
221 220 {
222   - height: 15,
223   - columns: 2,
224   - items:
  221 + layout: 'fit',
  222 + plain: true,
  223 + bodyStyle: 'background: none',
  224 + items:
225 225 [
226   - {
  226 + {
  227 + title: 'Interval',
  228 + layout: 'fit',
  229 + bodyStyle: 'background: none',
  230 + items: [
  231 + this.intervalSel
  232 + ]
  233 + },
  234 + {
  235 + title: 'Time Table',
  236 + layout: 'fit',
  237 + items: [
  238 + this.TTGrid
  239 + ]
  240 + },
  241 + {
  242 + title: 'Catalog',
  243 + items: [
  244 + ]
  245 + }
  246 + /*{
227 247 boxLabel: 'Time Table',
228 248 name: 'timesrc_'+this.id,
229 249 inputValue: amdaModel.AmdaTimeObject.inputTimeSrc[0]//'TimeTable',
... ... @@ -233,8 +253,13 @@ Ext.define(&#39;amdaUI.TimeSelectorUI&#39;,
233 253 name: 'timesrc_'+this.id,
234 254 inputValue: amdaModel.AmdaTimeObject.inputTimeSrc[1],//'Interval',
235 255 checked: true
236   - }
237   - ],
  256 + },
  257 + {
  258 + boxLabel: 'Catalog',
  259 + name: 'timesrc_'+this.id,
  260 + inputValue: amdaModel.AmdaTimeObject.inputTimeSrc[2],//'Catalog'
  261 + }*/
  262 + ]/*,
238 263 listeners:
239 264 {
240 265 scope: this,
... ... @@ -250,17 +275,18 @@ Ext.define(&#39;amdaUI.TimeSelectorUI&#39;,
250 275 this.cardContainer.activeItem = ttIndex;
251 276 }
252 277 }
253   - }
  278 + } */
254 279 });
255 280  
256 281 var config =
257 282 {
258   - style: { borderColor: '#98c0f4', borderWidth: '2px' },
  283 + //style: { borderColor: '#98c0f4', borderWidth: '2px' },
259 284 title: 'Time Selection',
  285 + layout: 'fit',
260 286 items:
261 287 [
262   - this.timeSrc,
263   - this.cardContainer
  288 + this.timeSrc/*,
  289 + this.cardContainer*/
264 290 ]
265 291 };
266 292  
... ...
js/resources/css/amda.css
... ... @@ -385,3 +385,32 @@ p + p {
385 385 font-style: italic !important;
386 386 font-weight: bold !important;
387 387 }
  388 +
  389 +
  390 +.icon-plot-page {
  391 + background-image:url( ../images/16x16/plot_page.png ) !important;
  392 +}
  393 +
  394 +.icon-plot-layout {
  395 + background-image:url( ../images/16x16/plot_layout.png ) !important;
  396 +}
  397 +
  398 +.icon-plot-panels {
  399 + background-image:url( ../images/16x16/plot_panels.png ) !important;
  400 +}
  401 +
  402 +.icon-plot-panel {
  403 + background-image:url( ../images/16x16/plot_panel.png ) !important;
  404 +}
  405 +
  406 +.icon-plot-axis {
  407 + background-image:url( ../images/16x16/plot_axis.png ) !important;
  408 +}
  409 +
  410 +.icon-plot-legends {
  411 + background-image:url( ../images/16x16/plot_legends.png ) !important;
  412 +}
  413 +
  414 +.icon-plot-axis-t {
  415 + background-image:url( ../images/16x16/plot_axis_t.png ) !important;
  416 +}
388 417 \ No newline at end of file
... ...
js/resources/images/16x16/plot_axis.png 0 → 100644

149 Bytes

js/resources/images/16x16/plot_axis_t.png 0 → 100644

180 Bytes

js/resources/images/16x16/plot_layout.png 0 → 100644

174 Bytes

js/resources/images/16x16/plot_legends.png 0 → 100644

155 Bytes

js/resources/images/16x16/plot_page.png 0 → 100644

158 Bytes

js/resources/images/16x16/plot_panel.png 0 → 100644

216 Bytes

js/resources/images/16x16/plot_panels.png 0 → 100644

126 Bytes