Subversion Repositories eFlore/Archives.cel-v1

Rev

Rev 23 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23 Rev 25
1
package org.tela_botanica.client;
1
package org.tela_botanica.client;
2
 
2
 
3
import com.google.gwt.core.client.EntryPoint;
3
import com.google.gwt.core.client.EntryPoint;
4
import com.google.gwt.user.client.Command;
4
import com.google.gwt.user.client.Command;
5
import com.google.gwt.user.client.DeferredCommand;
5
import com.google.gwt.user.client.DeferredCommand;
6
import com.google.gwt.user.client.Window;
6
import com.google.gwt.user.client.Window;
7
import com.google.gwt.user.client.WindowResizeListener;
7
import com.google.gwt.user.client.WindowResizeListener;
8
import com.google.gwt.user.client.ui.DockPanel;
8
import com.google.gwt.user.client.ui.DockPanel;
9
import com.google.gwt.user.client.ui.RootPanel;
9
import com.google.gwt.user.client.ui.RootPanel;
10
import com.google.gwt.user.client.ui.VerticalPanel;
10
import com.google.gwt.user.client.ui.VerticalPanel;
11
 
11
 
12
 
12
 
13
 
13
 
14
/**
14
/**
15
 * Entry point classes define <code>onModuleLoad()</code>.
15
 * Entry point classes define <code>onModuleLoad()</code>.
16
 */
16
 */
17
public class Cel implements EntryPoint,  WindowResizeListener {
17
public class Cel implements EntryPoint,  WindowResizeListener {
18
 
18
 
19
  
19
  
20
  private TopPanel topPanel = null;
20
  private TopPanel topPanel = null;
21
  private CenterPanel centerPanel = null;
21
  private CenterPanel centerPanel = null;
22
  private LeftPanel leftPanel = null;
22
  private LeftPanel leftPanel = null;
23
  private EntryPanel entryPanel = null;
23
  private EntryPanel entryPanel = null;
24
  private ActionPanel actionPanel = null;
24
  private ActionPanel actionPanel = null;
25
  private SearchPanel searchPanel = null;
25
  private SearchPanel searchPanel = null;
-
 
26
  private InfoPopup infoPopup = null;
26
  
27
  
27
  private VerticalPanel rightPanel = null;
28
  private VerticalPanel rightPanel = null;
28
  private Mediator mediator = null;
29
  private Mediator mediator = null;
29
 
30
 
30
 
31
 
31
  /**
32
  /**
32
   * This is the entry point method.
33
   * This is the entry point method.
33
   */
34
   */
34
  public void onModuleLoad() {
35
  public void onModuleLoad() {
35
 
36
 
36
 
37
 
37
	 mediator= new Mediator();
38
	 mediator= new Mediator();
38
	 mediator.registerCel(this);
39
	 mediator.registerCel(this);
39
	 mediator.initUser(); // Appelle initAsync suivant
40
	 mediator.initUser(); // Appelle initAsync suivant
40
		
41
		
41
	 
42
	 
42
  }
43
  }
43
  
44
  
44
  public void initAsync() {
45
  public void initAsync() {
45
	  
46
	  
46
 
47
 
47
	  centerPanel = new CenterPanel(mediator);
48
	  centerPanel = new CenterPanel(mediator);
-
 
49
	 
48
	 
50
 
49
	  
51
	  
50
	  topPanel = new TopPanel(mediator);
52
	  topPanel = new TopPanel(mediator);
51
	  leftPanel = new LeftPanel(mediator);
53
	  leftPanel = new LeftPanel(mediator);
52
	  
54
	  
53
 
55
 
54
	  entryPanel = new EntryPanel(mediator);
56
	  entryPanel = new EntryPanel(mediator);
55
	  actionPanel = new ActionPanel(mediator);
57
	  actionPanel = new ActionPanel(mediator);
56
	  searchPanel = new SearchPanel(mediator);
58
	  searchPanel = new SearchPanel(mediator);
57
	  rightPanel = new VerticalPanel();
59
	  rightPanel = new VerticalPanel();
-
 
60
	  infoPopup = new InfoPopup(mediator);
-
 
61
 
58
	  
62
	  
59
	  // Information haut de page (nom application, connexion ... etc).
63
	  // Information haut de page (nom application, connexion ... etc).
60
	  // A regler 
64
	  // A regler 
61
	  
65
	  
62
	  entryPanel.setStyleName("item-Input");
66
	  entryPanel.setStyleName("item-Input");
63
	 
67
	 
64
	  rightPanel.add(searchPanel);
68
	  rightPanel.add(searchPanel);
65
	  rightPanel.add(entryPanel);
69
	  rightPanel.add(entryPanel);
66
	  rightPanel.add(centerPanel);
70
	  rightPanel.add(centerPanel);
67
	  rightPanel.add(actionPanel);
71
	  rightPanel.add(actionPanel);
68
	  
72
	  
69
	  
73
	  
70
	  rightPanel.setWidth("100%");
74
	  rightPanel.setWidth("100%");
71
	  centerPanel.setWidth("100%");
75
	  centerPanel.setWidth("100%");
72
	  
76
	  
73
	  entryPanel.setWidth("100%");
77
	  entryPanel.setWidth("100%");
74
	  topPanel.setWidth("100%");
78
	  topPanel.setWidth("100%");
75
 
79
 
76
 
80
 
77
	  rightPanel.setSpacing(2);
81
	  rightPanel.setSpacing(2);
78
	  
82
	  
79
	  
83
	  
80
	  // DockPanel permet d'arranger plusieurs panneaux au coins cardinaux, le panneau central remplissant
84
	  // DockPanel permet d'arranger plusieurs panneaux au coins cardinaux, le panneau central remplissant
81
	  // l'espace laissé.
85
	  // l'espace laissé.
82
	  
86
	  
83
	  
87
	  
84
	  DockPanel outer = new DockPanel();
88
	  DockPanel outer = new DockPanel();
85
	  outer.add(topPanel, DockPanel.NORTH);
89
	  outer.add(topPanel, DockPanel.NORTH);
86
	  outer.add(rightPanel, DockPanel.CENTER);
90
	  outer.add(rightPanel, DockPanel.CENTER);
87
	  outer.add(leftPanel, DockPanel.WEST);
91
	  outer.add(leftPanel, DockPanel.WEST);
88
//	  outer.add(bottomPanel, DockPanel.SOUTH);
92
//	  outer.add(bottomPanel, DockPanel.SOUTH);
89
	  
93
	  
90
	  // LeftPanel : 
94
	  // LeftPanel : 
91
	  // Pour l'instant : relevés.
95
	  // Pour l'instant : relevés.
92
	  
96
	  
93
	  outer.setWidth("100%");
97
	  outer.setWidth("100%");
94
 
98
 
95
	  outer.setSpacing(2);
99
	  outer.setSpacing(2);
96
	  outer.setCellWidth(rightPanel, "100%");
100
	  outer.setCellWidth(rightPanel, "100%");
97
	 
101
	 
98
//	  Window.enableScrolling(false);
102
//	  Window.enableScrolling(false);
99
	  Window.setMargin("0px");
103
	  Window.setMargin("0px");
100
 
104
 
101
	  mediator.onInit();
105
	  mediator.onInit();
102
	  
-
 
103
	  
106
	  
104
	  RootPanel.get().add(outer);
107
	  RootPanel.get().add(outer);
105
 
108
 
106
 
109
	  
107
	    // Call the window resized handler to get the initial sizes setup. Doing
110
	    // Call the window resized handler to get the initial sizes setup. Doing
108
	    // this in a deferred command causes it to occur after all widgets' sizes
111
	    // this in a deferred command causes it to occur after all widgets' sizes
109
	    // have been computed by the browser.
112
	    // have been computed by the browser.
110
	    DeferredCommand.add(new Command() {
113
	    DeferredCommand.add(new Command() {
111
	      public void execute() {
114
	      public void execute() {
112
	        onWindowResized(Window.getClientWidth(), Window.getClientHeight());
115
	        onWindowResized(Window.getClientWidth(), Window.getClientHeight());
113
	      }
116
	      }
114
	    });
117
	    });
115
 
118
 
116
 
119
 
117
  }
120
  }
118
  
121
  
119
  
122
  
120
  public void onWindowResized(int width, int height) {
123
  public void onWindowResized(int width, int height) {
121
	    // Adjust the shortcut panel and detail area to take up the available room
124
	    // Adjust the shortcut panel and detail area to take up the available room
122
	    // in the window.
125
	    // in the window.
123
	    int shortcutHeight = height - leftPanel.getAbsoluteTop() - 8;
126
	    int shortcutHeight = height - leftPanel.getAbsoluteTop() - 8;
124
	    if (shortcutHeight < 1)
127
	    if (shortcutHeight < 1)
125
	      shortcutHeight = 1;
128
	      shortcutHeight = 1;
126
	    leftPanel.setHeight("" + shortcutHeight);
129
	    leftPanel.setHeight("" + shortcutHeight);
127
 
130
 
128
	    
131
	    
129
	  }
132
	  }
130
 
133
 
131
 
134
 
132
  
135
  
133
 
136
 
134
}
137
}