Commit d1dd574ba62f4379a5dab4439ad2fda9fff77308

Authored by Furkan
1 parent 1cfbb4ac

Done, in a way

Showing 2 changed files with 158 additions and 127 deletions   Show diff stats
js/app/views/CatalogUI.js
... ... @@ -20,7 +20,7 @@ Ext.define('amdaUI.CatalogUI', {
20 20 'amdaUI.OperationsTT',
21 21 'Ext.grid.plugin.BufferedRenderer',
22 22 'amdaUI.StatisticalPlug',
23   -+ 'amdaDesktop.AmdaStateProvider'
  23 + 'amdaDesktop.AmdaStateProvider'
24 24 ],
25 25  
26 26 isCatalog: true,
... ... @@ -1281,19 +1281,26 @@ Ext.define('amdaUI.CatalogUI', {
1281 1281  
1282 1282 this.formPanel = Ext.create('Ext.form.Panel', {
1283 1283 region: 'center',
  1284 + me:this,
1284 1285 layout: 'hbox',
1285   - overflowY:'auto',
1286 1286 model: 'amdaModel.Catalog',
1287 1287 trackResetOnLoad: true, // reset to the last loaded record
1288 1288 bodyStyle: {background: '#dfe8f6'},
1289 1289 defaults: {border: false, align: 'stretch', bodyStyle: {background: '#dfe8f6'}, padding: '3'},
1290 1290 fieldDefaults: {labelWidth: 80, labelAlign: 'top'},
1291 1291 items: [{
  1292 + xtype:'panel',
  1293 + overflowY:true,
  1294 + height:530,
  1295 + layout:'hbox',
  1296 + defaults: {border: false, align: 'stretch',bodyStyle: {background: '#dfe8f6',padding: '1'}},
  1297 + flex: 1,
  1298 + items:[{
1292 1299 xtype: 'form',
1293 1300 flex: 1,
1294 1301 buttonAlign: 'left',
1295 1302 // title : 'Information',
1296   - layout: {type: 'vbox', pack: 'start', align: 'stretch'},
  1303 + layout: {type: 'vbox', pack:'start',align: 'stretch'},
1297 1304 items: [
1298 1305 this.fieldName,
1299 1306 {
... ... @@ -1322,6 +1329,8 @@ Ext.define('amdaUI.CatalogUI', {
1322 1329 emptyText: 'YYYY/MM/DDThh:mm:ss.fff',
1323 1330 format: 'Y-m-d\\TH:i:s.u',
1324 1331 enforceMaxLength: true,
  1332 + disabled: true,
  1333 + hideTrigger: true,
1325 1334 maxLength: 25,
1326 1335 labelWidth: 60,
1327 1336 labelAlign: 'left',
... ... @@ -1336,12 +1345,12 @@ Ext.define('amdaUI.CatalogUI', {
1336 1345 return value;
1337 1346 }
1338 1347 },
1339   - listeners: {
1340   - change: this.onChangeStartField,
1341   - focus: function(field) {
1342   - this.activeField = 'surveyStart';
1343   - },
1344   - }
  1348 + // listeners: {
  1349 + // change: this.onChangeStartField,
  1350 + // focus: function(field) {
  1351 + // this.activeField = 'surveyStart';
  1352 + // },
  1353 + // }
1345 1354 }, {
1346 1355 fieldLabel: 'Stop Time',
1347 1356 name: 'surveyStop',
... ... @@ -1349,16 +1358,18 @@ Ext.define('amdaUI.CatalogUI', {
1349 1358 format: 'Y-m-d\\TH:i:s.u',
1350 1359 labelAlign: 'left',
1351 1360 enforceMaxLength: true,
  1361 + disabled: true,
  1362 + hideTrigger: true,
1352 1363 maxLength: 25,
1353 1364 labelWidth: 60,
1354 1365 align: 'left',
1355   - listeners: {
1356   - change: this.onChangeStopField,
1357   - focus: function(field) {
1358   - this.activeField = 'surveyStop';
1359   - },
1360   - }
1361   - }]
  1366 + // listeners: {
  1367 + // change: this.onChangeStopField,
  1368 + // focus: function(field) {
  1369 + // this.activeField = 'surveyStop';
  1370 + // },
  1371 + // }
  1372 + }]
1362 1373 },
1363 1374 {
1364 1375 xtype: 'textarea',
... ... @@ -1367,139 +1378,158 @@ Ext.define('amdaUI.CatalogUI', {
1367 1378 height:50
1368 1379 },
1369 1380 {
1370   - xtype: 'textarea',
1371   - name: 'description',
1372   - fieldLabel: 'Description',
1373   - height: 150
  1381 + xtype:'panel',
  1382 + resizable:true,
  1383 + height: 165,
  1384 + bodyStyle: {background: '#dfe8f6',padding: '1'},
  1385 + border:false,
  1386 + layout:'fit',
  1387 + items:[{
  1388 + xtype: 'htmleditor',
  1389 + align:'stretch',
  1390 + enableFont:false,
  1391 + enableAlignments: false,
  1392 + enableColors:false,
  1393 + name: 'description',
  1394 + fieldLabel: 'Description',
  1395 + }],
1374 1396 },
1375 1397 {
1376 1398 xtype: 'operationsTT',
1377 1399 margin:'5 0 0 0',
1378 1400 collapsible: true,
1379   - collapsed:true,
  1401 + collapsed:false,
1380 1402 parent: this,
1381 1403 isCat:true,
1382 1404 id: 'operationCat'
1383   - },],
1384   - dockedItems: [
1385   - {
1386   - xtype: 'toolbar',
1387   - dock: 'bottom',
1388   - ui: 'footer',
1389   - height: 50,
  1405 + },
  1406 + ],
  1407 +
  1408 + }],
1390 1409  
1391   - items: [
1392   - {
1393   - type: 'button',
1394   - text: 'Save',
1395   - width: 50,
1396   - scope: this,
1397   - handler: function ()
1398   - {
1399   - this.saveCatalog();
1400   - }
1401   - }, {
1402   - type: 'button',
1403   - text: 'Reset',
1404   - width: 50,
1405   - scope: this,
1406   - handler: function () {
1407   - var module = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.catalog.id);
1408   - // module.createLinkedNode();
1409   - // module.createObject();
1410   - this.setObject(module.getLinkedNode().get('object'), true);
1411   - }
1412   - },
1413   - {
1414   - type: 'button',
1415   - text: 'Create New Catalog',
1416   - width: 120,
1417   - scope: this,
1418   - handler: function ()
1419   - {
1420   - var module = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.catalog.id);
  1410 + },
  1411 + {
  1412 + xtype: 'form',
  1413 + bodyStyle: {background: '#dfe8f6'},
  1414 + //padding: '3',
  1415 + flex: 2,
  1416 + items: [this.TTGrid]
  1417 + }
  1418 + ],
  1419 + dockedItems: [
  1420 + {
  1421 + xtype: 'toolbar',
  1422 + dock: 'bottom',
  1423 + ui: 'footer',
  1424 + height: 35,
1421 1425  
1422   - if (!module)
1423   - return;
  1426 + items: [
  1427 + {
  1428 + type: 'button',
  1429 + text: 'Save',
  1430 + width: 50,
  1431 + scope: this,
  1432 + handler: function ()
  1433 + {
  1434 + this.saveCatalog();
  1435 + }
  1436 + }, {
  1437 + type: 'button',
  1438 + text: 'Reset',
  1439 + width: 50,
  1440 + scope: this,
  1441 + handler: function () {
  1442 + var module = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.catalog.id);
  1443 + // module.createLinkedNode();
  1444 + // module.createObject();
  1445 + this.setObject(module.getLinkedNode().get('object'), true);
  1446 + }
  1447 + },
  1448 + {
  1449 + type: 'button',
  1450 + text: 'Create New Catalog',
  1451 + width: 120,
  1452 + scope: this,
  1453 + handler: function ()
  1454 + {
  1455 + var module = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.catalog.id);
1424 1456  
1425   - module.createLinkedNode();
1426   - module.createObject();
  1457 + if (!module)
  1458 + return;
1427 1459  
1428   - var obj = module.linkedNode.get('object');
  1460 + module.createLinkedNode();
  1461 + module.createObject();
1429 1462  
1430   - var me = this;
  1463 + var obj = module.linkedNode.get('object');
1431 1464  
1432   - Ext.Msg.prompt('Create catalog', 'Enter the number of columns:', function (btn, text) {
1433   - if (btn == 'ok') {
1434   - module.createLinkedNode();
1435   - module.createObject();
1436   - var obj = module.linkedNode.get('object');
  1465 + var me = this;
1437 1466  
1438   - var nbParam = parseInt(text);
1439   - if ((nbParam <= 0) || (nbParam > 100)) {
1440   - nbParam = 1;
1441   - }
  1467 + Ext.Msg.prompt('Create catalog', 'Enter the number of columns:', function (btn, text) {
  1468 + if (btn == 'ok') {
  1469 + module.createLinkedNode();
  1470 + module.createObject();
  1471 + var obj = module.linkedNode.get('object');
1442 1472  
1443   - obj.set('nbParameters', nbParam);
1444   - me.setObject(obj, true);
1445   - }
1446   - }, this);
  1473 + var nbParam = parseInt(text);
  1474 + if ((nbParam <= 0) || (nbParam > 100)) {
  1475 + nbParam = 1;
  1476 + }
1447 1477  
  1478 + obj.set('nbParameters', nbParam);
  1479 + me.setObject(obj, true);
1448 1480 }
1449   - }]
  1481 + }, this);
  1482 +
  1483 + }
1450 1484 },
1451   - //statistical info
1452   - {
1453   - xtype: 'toolbar',
1454   - dock: 'bottom',
1455   - ui: 'footer',
1456   - items: [{
1457   - xtype: 'button',
1458   - text: 'Statistical info',
1459   - scope: this,
1460   - //dock: 'bottom',
1461   - //ui: 'footer',
1462   - handler: function () {
1463   - this.fireEvent('info', 'catalogUI');
1464   - }
1465   - },
1466   - {
1467   - type: 'button',
1468   - text: 'Visualize',
1469   - scope: this,
1470   - handler: function () {
1471   - var me = this;
1472   - myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.visu.id, true, function (module) {
1473   - module.visualize(me.object);
1474   - });
1475   - }
1476   - },
1477   - ]
  1485 + //statistical info
  1486 + {
  1487 + xtype: 'toolbar',
  1488 + dock: 'bottom',
  1489 + ui: 'footer',
  1490 + items: [{
  1491 + xtype: 'button',
  1492 + text: 'Statistical info',
  1493 + scope: this,
  1494 + //dock: 'bottom',
  1495 + //ui: 'footer',
  1496 + handler: function () {
  1497 + this.fireEvent('info', 'catalogUI');
  1498 + }
1478 1499 },
1479 1500 {
1480   - xtype: 'toolbar',
1481   - dock: 'bottom',
1482   - ui: 'footer',
1483   - items: [{
1484   - xtype: 'button',
1485   - text: 'Generate Time Table',
1486   - scope: this,
1487   - //dock: 'bottom',
1488   - //ui: 'footer',
1489   - handler: function () {
1490   - this.generateTT(this.object.get('id'));
1491   - }
1492   - }]},
1493   - ],
1494   -
  1501 + type: 'button',
  1502 + text: 'Visualize',
  1503 + scope: this,
  1504 + handler: function () {
  1505 + var me = this;
  1506 + myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.visu.id, true, function (module) {
  1507 + module.visualize(me.object);
  1508 + });
  1509 + }
  1510 + },
  1511 + ]
1495 1512 },
1496 1513 {
1497   - xtype: 'form',
1498   - bodyStyle: {background: '#dfe8f6'},
1499   - //padding: '3',
1500   - flex: 2,
1501   - items: [this.TTGrid]
1502   - }]
  1514 + xtype: 'toolbar',
  1515 + dock: 'bottom',
  1516 + ui: 'footer',
  1517 + items: [{
  1518 + xtype: 'button',
  1519 + text: 'Generate Time Table',
  1520 + scope: this,
  1521 + //dock: 'bottom',
  1522 + //ui: 'footer',
  1523 + handler: function () {
  1524 + this.generateTT(this.object.get('id'));
  1525 + }
  1526 + }]
  1527 + },]
  1528 + },
  1529 +
  1530 +
  1531 +
  1532 + ],
1503 1533 });
1504 1534  
1505 1535 this.TTGrid.getSelectionModel().on('selectionchange', function (selModel, selections) {
... ...
js/app/views/OperationsTT.js
... ... @@ -179,7 +179,8 @@ Ext.define(&#39;amdaUI.OperationsTT&#39;, {
179 179  
180 180 var config = {
181 181 title:'Operations on Intervals',
182   - style: { borderWidth: '2px' },
  182 + style: this.isCat ? '' :{ borderWidth: '2px' },
  183 + border: this.isCat ? false:'',
183 184 items: [
184 185 {xtype: 'splitter', width: 5},
185 186 this.formExtend,
... ...