Subversion Repositories eFlore/Archives.cel-v1

Rev

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

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