Subversion Repositories eFlore/Archives.cel-v1

Rev

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

Rev 10 Rev 11
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.Window;
4
import com.google.gwt.user.client.Window;
5
import com.google.gwt.user.client.ui.DockPanel;
5
import com.google.gwt.user.client.ui.DockPanel;
6
import com.google.gwt.user.client.ui.RootPanel;
6
import com.google.gwt.user.client.ui.RootPanel;
7
 
-
 
8
import org.tela_botanica.client.TopPanel;
-
 
9
import org.tela_botanica.client.CenterPanel;
-
 
10
import org.tela_botanica.client.LeftPanel;
-
 
11
 
7
 
12
 
8
 
13
 
9
 
14
/**
10
/**
15
 * Entry point classes define <code>onModuleLoad()</code>.
11
 * Entry point classes define <code>onModuleLoad()</code>.
16
 */
12
 */
17
public class Cel implements EntryPoint {
13
public class Cel implements EntryPoint {
18
 
-
 
19
 
14
 
20
  
15
  
21
  private TopPanel topPanel = null;
16
  private TopPanel topPanel = null;
22
  private CenterPanel centerPanel = null;
17
  private CenterPanel centerPanel = null;
23
  private LeftPanel leftPanel = null;
18
  private LeftPanel leftPanel = null;
24
 
19
  
25
  private Mediator mediator = null;
20
  private Mediator mediator = null;
26
 
21
  
27
 
22
 
28
  /**
23
  /**
29
   * This is the entry point method.
24
   * This is the entry point method.
30
   */
25
   */
31
  public void onModuleLoad() {
26
  public void onModuleLoad() {
32
 
27
 
33
 
28
 
34
	 mediator= new Mediator();
29
	 mediator= new Mediator();
35
	 mediator.registerCel(this);
30
	 mediator.registerCel(this);
36
	 mediator.initUser();
31
	 mediator.initUser(); // Appelle initAsync suivant
37
		
32
		
38
		
33
		
39
  }
34
  }
40
  
35
  
41
  public void initAsync() {
36
  public void initAsync() {
42
	  
37
	  
43
 
-
 
44
	  topPanel = new TopPanel();
38
 
-
 
39
	  centerPanel = new CenterPanel(mediator);
45
	  centerPanel = new CenterPanel(mediator);
40
	  topPanel = new TopPanel(mediator);
46
	  leftPanel = new LeftPanel(mediator);
41
	  leftPanel = new LeftPanel(mediator);
47
 
42
 
48
	  
43
	  
49
	  // Information haut de page (nom application, connexion ... etc).
44
	  // Information haut de page (nom application, connexion ... etc).
50
	  // A regler 
45
	  // A regler 
51
	  
46
	  
52
	  topPanel.setWidth("100%");
47
	  topPanel.setWidth("100%");
53
 
48
 
54
	  
49
	  
55
	  // DockPanel permet d'arranger plusieurs panneaux au coins cardinaux, le panneau central remplissant
50
	  // DockPanel permet d'arranger plusieurs panneaux au coins cardinaux, le panneau central remplissant
56
	  // l'espace laissé.
51
	  // l'espace laissé.
57
	  
52
	  
58
	  
53
	  
59
	  DockPanel outer = new DockPanel();
54
	  DockPanel outer = new DockPanel();
60
	  outer.add(topPanel, DockPanel.NORTH);
55
	  outer.add(topPanel, DockPanel.NORTH);
61
	  outer.add(centerPanel, DockPanel.CENTER);
56
	  outer.add(centerPanel, DockPanel.CENTER);
62
	  outer.add(leftPanel, DockPanel.WEST);
57
	  outer.add(leftPanel, DockPanel.WEST);
63
	  
58
	  
64
	  centerPanel.setWidth("100%");
59
	  centerPanel.setWidth("100%");
65
	  // LeftPanel : 
60
	  // LeftPanel : 
66
	  // Pour l'instant : relevés.
61
	  // Pour l'instant : relevés.
67
	  
62
	  
68
	  outer.setWidth("100%");
63
	  outer.setWidth("100%");
69
 
64
 
70
	  outer.setSpacing(4);
65
	  outer.setSpacing(4);
71
	  outer.setCellWidth(centerPanel, "100%");
66
	  outer.setCellWidth(centerPanel, "85%");
72
	 
67
	 
73
//	  Window.enableScrolling(false);
68
//	  Window.enableScrolling(false);
74
	  Window.setMargin("0px");
69
	  Window.setMargin("0px");
75
 
-
 
76
	  // Finally, add the outer panel to the RootPanel, so that it will be
-
 
77
	  // displayed.
70
 
78
	  RootPanel.get().add(outer);
71
	  RootPanel.get().add(outer);
79
 
72
 
80
 
73
 
81
  }
74
  }
82
  
75
  
83
  
-
 
84
  public void onWindowResized(int width, int height) {
-
 
85
	    // Adjust the shortcut panel and detail area to take up the available room
-
 
86
	    // in the window.
-
 
87
	    int shortcutHeight = height - leftPanel.getAbsoluteTop() - 8;
-
 
88
	    if (shortcutHeight < 1)
-
 
89
	      shortcutHeight = 1;
-
 
90
	    leftPanel.setHeight("" + shortcutHeight);
-
 
91
 
-
 
92
  }
-
 
93
  
76
  
94
 
77
 
95
 
78
 
96
}
79
}