Subversion Repositories eFlore/Archives.cel-v1

Rev

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

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