Subversion Repositories eFlore/Archives.cel-v1

Rev

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

Rev 26 Rev 28
1
/**
1
/**
2
 David Delon david.delon@clapas.net 2007
2
 David Delon david.delon@clapas.net 2007
3
 
3
 
4
 */
4
 */
5
 
5
 
6
/*
6
/*
7
 * Cel.java  (Point d'entree de l'application carnet en ligne)
7
 * Cel.java  (Point d'entree de l'application carnet en ligne)
8
 * 
8
 * 
9
 * Cas d'utilisation :
9
 * Cas d'utilisation :
10
 * Initialisation de l'application
10
 * Initialisation de l'application
11
 * 
11
 * 
12
 * 1: Le programme initialise la classe intercesseur (mediator), classe ou sont decrites les actions de l'application.
12
 * 1: Le programme initialise la classe intercesseur (mediator), classe ou sont decrites les actions de l'application.
13
 * 2: Le programme s'enregistre aupres de la classe intercesseur
13
 * 2: Le programme s'enregistre aupres de la classe intercesseur
14
 * 3: Le programme recherche les informations de connections (utilisateur ou anonyme)
14
 * 3: Le programme recherche les informations de connections (utilisateur ou anonyme)
15
 * 4: Le programme initialise les differents panneaux composant l'affichage
15
 * 4: Le programme initialise les differents panneaux composant l'affichage
16
 * 
16
 * 
17
 */
17
 */
18
 
18
 
19
package org.tela_botanica.client;
19
package org.tela_botanica.client;
-
 
20
 
20
 
21
 
21
import com.google.gwt.core.client.EntryPoint;
-
 
22
import com.google.gwt.user.client.Command;
-
 
23
import com.google.gwt.user.client.DeferredCommand;
-
 
24
import com.google.gwt.user.client.Window;
-
 
25
import com.google.gwt.user.client.WindowResizeListener;
-
 
26
import com.google.gwt.user.client.ui.DockPanel;
-
 
27
import com.google.gwt.user.client.ui.RootPanel;
-
 
28
import com.google.gwt.user.client.ui.VerticalPanel;
22
import com.google.gwt.core.client.EntryPoint;
29
 
23
 
30
 
24
 
31
 
25
 
32
/**
26
/**
33
 * Entry point classes define <code>onModuleLoad()</code>.
27
 * Entry point classes define <code>onModuleLoad()</code>.
34
 */
28
 */
35
public class Cel implements EntryPoint,  WindowResizeListener {
29
public class Cel implements EntryPoint {
36
 
-
 
37
		
-
 
38
	
-
 
39
  private TopPanel topPanel = null;   // Identifiant de connexion et titre
-
 
40
  private CenterPanel centerPanel = null;  // Liste de releves
-
 
41
  private LeftPanel leftPanel = null; // Filtres sur liste de releves
-
 
42
  private EntryPanel entryPanel = null; // Saisie d'un releve
-
 
43
  private ActionPanel actionPanel = null; // Action sur les relevés saisis
-
 
44
  private SearchPanel searchPanel = null; // Recherche dans les relevés saisis
-
 
45
  
-
 
46
  private VerticalPanel rightPanel = null; // Container panneau précedents (sauf left et popup)
-
 
47
  
-
 
48
  private Mediator mediator = null; // Intermediaire entre les differents classes
-
 
49
 
-
 
50
 
-
 
51
  /**
-
 
52
   * Point d'entree : recherche du pres-requis : information de connection.
-
 
53
   */
30
 
54
  
31
  
55
  public void onModuleLoad() {
32
  public void onModuleLoad() {
56
 
33
 
57
	 mediator= new Mediator();
-
 
58
	 mediator.registerCel(this); // Declaration point d'entree aupres de la classe intercesseur
-
 
59
	 mediator.initUser(); // Initialisation environnement utilisateur (Cette methode appelle la methode initAsync() suivante)
-
 
60
	 
-
 
61
  }
-
 
62
  
-
 
63
  
-
 
64
  /**
-
 
65
   *  Fin de l'initialisation
-
 
66
   * 
-
 
67
   */
-
 
68
  
-
 
69
  public void initAsync() {
-
 
70
	  
-
 
71
 
-
 
72
	  centerPanel = new CenterPanel(mediator); // Liste de releves 
-
 
73
	 
-
 
74
	  topPanel = new TopPanel(mediator); // Identifiant de connection
-
 
75
	  
-
 
76
	  leftPanel = new LeftPanel(mediator); // Filte de liste de releves
-
 
77
	  
-
 
78
 
-
 
79
	  entryPanel = new EntryPanel(mediator); // Formulaire de saisie
-
 
80
	  
-
 
81
	  actionPanel = new ActionPanel(mediator); // Action sur releves saisis
-
 
82
	  searchPanel = new SearchPanel(mediator); // Recherche dans releves
-
 
83
	  
-
 
84
	  rightPanel = new VerticalPanel();  // Container des panneaux precedents
-
 
85
	  
-
 
86
	  entryPanel.setStyleName("item-Input");
-
 
87
 
-
 
88
	  
-
 
89
	  // Assemblage des differents panneaux 
-
 
90
	  
-
 
91
	  rightPanel.add(searchPanel);
-
 
92
	  rightPanel.add(entryPanel);
-
 
93
	  rightPanel.add(centerPanel);
-
 
94
	  rightPanel.add(actionPanel);
-
 
95
	  
-
 
96
	  
-
 
97
	  rightPanel.setWidth("100%");
-
 
98
	  centerPanel.setWidth("100%");
-
 
99
	  entryPanel.setWidth("100%");
-
 
100
	  topPanel.setWidth("100%");
-
 
101
 
-
 
102
	  rightPanel.setSpacing(2);
-
 
103
	  
-
 
104
	 // Disposition générale :
-
 
105
	  
-
 
106
	  DockPanel outer = new DockPanel();
-
 
107
	  outer.add(topPanel, DockPanel.NORTH);
-
 
108
	  outer.add(rightPanel, DockPanel.CENTER);
-
 
109
	  outer.add(leftPanel, DockPanel.WEST);
-
 
110
	  
-
 
111
	  outer.setWidth("100%");
-
 
112
 
-
 
113
	  outer.setSpacing(2);
-
 
114
	  outer.setCellWidth(rightPanel, "100%");
-
 
115
	 
-
 
116
//	  Window.enableScrolling(false);
-
 
117
	  Window.setMargin("0px");
-
 
118
 
-
 
119
//    Initialisation des differents contenus ...	  
-
 
120
	  
-
 
121
	  mediator.onInit();
-
 
122
	  
-
 
123
	  RootPanel.get().add(outer);
-
 
124
 
-
 
125
	  
-
 
126
	    // Call the window resized handler to get the initial sizes setup. Doing
-
 
127
	    // this in a deferred command causes it to occur after all widgets' sizes
-
 
128
	    // have been computed by the browser.
-
 
129
	    DeferredCommand.add(new Command() {
-
 
130
	      public void execute() {
-
 
131
	        onWindowResized(Window.getClientWidth(), Window.getClientHeight());
-
 
132
	      }
-
 
133
	    });
-
 
134
 
34
	 new Mediator();
135
 
35
 
136
  }
36
  }
137
  
-
 
138
  
-
 
139
  public void onWindowResized(int width, int height) {
-
 
140
	    // Adjust the shortcut panel and detail area to take up the available room
-
 
141
	    // in the window.
-
 
142
	    int shortcutHeight = height - leftPanel.getAbsoluteTop() - 8;
-
 
143
	    if (shortcutHeight < 1)
-
 
144
	      shortcutHeight = 1;
-
 
145
	    leftPanel.setHeight("" + shortcutHeight);
-
 
146
 
-
 
147
	    
-
 
148
	  }
-
 
149
 
-
 
150
 
-
 
151
  
37
  
152
 
38
 
153
}
39
}
154
 
40
 
155
/* +--Fin du code ---------------------------------------------------------------------------------------+
41
/* +--Fin du code ---------------------------------------------------------------------------------------+
156
* $Log$
42
* $Log$
-
 
43
* Revision 1.10  2007-09-17 19:25:34  ddelon
-
 
44
* Documentation
-
 
45
*
157
* 
46
* 
158
*/
47
*/