Subversion Repositories eFlore/Archives.cel-v1

Rev

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

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