Subversion Repositories eFlore/Archives.cel-v1

Rev

Rev 4 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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