Blame view

js/app/controllers/AstroImagesModule.js 2.49 KB
16035364   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
  * Project      :  AMDA-NG
  * Name         : AstroImagesModule.js
  * @plugin 	  amdaDesktop.AstroImagesModule.js
  * @extends 	  amdaDesktop.AmdaModule
  * @brief		 AstroImages controller
  * @author Benjamin
  * @version $Id: AstroImagesModule.js 1664 2013-07-03 11:37:37Z benjamin $
  ********************************************************************************
  *    FT Id     :   Date   : Name - Description
  *******************************************************************************
  *  :          
  */

Ext.define('amdaDesktop.AstroImagesModule', {
		
    extend: 'amdaDesktop.AmdaModule',
    
    requires : [
      'amdaUI.HstUI',
      'amdaUI.APISImagesUI'
    ],
    
	contentId : 'astroimagesUI',
    
	createWindow : function(startDate,stopDate){
	    var desktop = this.app.getDesktop();
	    var win = desktop.getWindow(this.id);
	    
	    if(!win){
	        win = desktop.createWindow({		  
	            id: this.id,
	            title:this.title, 
		        layout: 'fit',
b7796276   Benjamin Renard   Migration to supp...
35
		        width:650,
e72f367a   Benjamin Renard   Fix some bugs wit...
36
37
	            height:600,
		    minHeight: 600,  
16035364   Benjamin Renard   First commit
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
	            modal: true,
	            iconCls: this.icon,
	            animCollapse:false,
	            constrainHeader:true,
	            bodyPadding : 5,
                stateful : true,
                stateId  : this.id,
                stateEvents: ['move','show','resize'],
	            items : [
	              {
	            	  xtype : 'tabpanel',
	            	  id    : 'astrotabs',
	            	  items : [
	            	           {
	            	        	   title: 'APIS Archive',
	            	        	   xtype: 'panelAPIS',
	            	        	   id   : 'apisPanel'
	            	           },
	            	           {
	            	        	   title: 'MAST Archive',
	            	        	   xtype: 'panelHst',
	            	        	   id   : 'hstPanel'
	            	           }
	            	          ]
	              }
	            ]
	        });
	    } 
	    
	    var hstPanel = win.queryById('hstPanel');
		var apisPanel = win.queryById('apisPanel');

		
		hstPanel.setInterval(startDate,stopDate);
		apisPanel.setInterval(startDate,stopDate);
	    
	    win.on({
        	show : 
        	{
        		fn : function(o)
        		{
e72f367a   Benjamin Renard   Fix some bugs wit...
79
			win.doLayout();
16035364   Benjamin Renard   First commit
80
81
82
83
84
85
86
87
88
89
90
91
	    			var astrotabsUI = win.queryById('astrotabs');
	    	        astrotabsUI.setActiveTab(apisPanel);
	    	        hstPanel.forceRefresh();
	    			apisPanel.forceRefresh();
        		},
        		scope : this
        	}
        });
	    
	    win.show();
	    return win;
	}
e72f367a   Benjamin Renard   Fix some bugs wit...
92
});