Subversion Repositories eFlore/Archives.cel-v1

Rev

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

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