Subversion Repositories eFlore/Archives.cel-v1

Rev

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

Rev 29 Rev 30
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
/*
7
/*
8
 * InventoryListView.java  (Composite de Panel)
8
 * InventoryListView.java  (Composite de Panel)
9
 *
9
 *
10
 * Cas d'utilisation :
10
 * Cas d'utilisation :
11
 * 
11
 * 
12
 * Affichage de releve 
12
 * Affichage de releve 
13
 *
13
 *
14
 * 1 : Recherche du nombre de releves associe au navigateur ou a l'utilisateur est connecte, en fonction des criteres de selection
14
 * 1 : Recherche du nombre de releves associe au navigateur ou a l'utilisateur est connecte, en fonction des criteres de selection
15
 * 2 : Recherche des releves correspondant au critere precedent
15
 * 2 : Recherche des releves correspondant au critere precedent
16
 * 3 : Affichage des releves avec positionnement sur le dernier releve
16
 * 3 : Affichage des releves avec positionnement sur le dernier releve
17
 * 
17
 * 
18
 * Selection de releve
18
 * Selection de releve
19
 * 
19
 * 
20
 * 1 : L'utilisateur selectionne un releve : lancement de l'affichage detaille pour le releve selectionne
20
 * 1 : L'utilisateur selectionne un releve : lancement de l'affichage detaille pour le releve selectionne
21
 * 
21
 * 
22
 * 
22
 * 
23
 * Pagination :
23
 * Pagination :
24
 * 
24
 * 
25
 * 1 : Avancement ou recul d'une page
25
 * 1 : Avancement ou recul d'une page
26
 *
26
 *
27
 *
27
 *
28
 * 
28
 * 
29
 *  Suppression d'une liste d'element 
29
 *  Suppression d'une liste d'element 
30
 */
30
 */
31
 
31
 
32
 
32
 
33
/* Actions declenchees :
33
/* Actions declenchees :
34
 * 
34
 * 
35
 * onInventoryItemSelected(numero d'ordre de la ligne selectionne) : selection d'une ligne
35
 * onInventoryItemSelected(numero d'ordre de la ligne selectionne) : selection d'une ligne
36
 * onInventoryItemUnselected(numero d'ordre de la ligne selectionne) : deselection d'une ligne
36
 * onInventoryItemUnselected(numero d'ordre de la ligne selectionne) : deselection d'une ligne
37
 * onInventoryUpdated(location) : action suite a la modification, suppression, creation d'un element d'inventaire
37
 * onInventoryUpdated(location) : action suite a la modification, suppression, creation d'un element d'inventaire
38
 * 
38
 * 
39
 */
39
 */
40
 
40
 
41
 
41
 
42
package org.tela_botanica.client;
42
package org.tela_botanica.client;
43
 
43
 
44
 
44
 
45
import net.mygwt.ui.client.Events;
45
import net.mygwt.ui.client.Events;
46
import net.mygwt.ui.client.Style;
46
import net.mygwt.ui.client.Style;
47
import net.mygwt.ui.client.event.BaseEvent;
47
import net.mygwt.ui.client.event.BaseEvent;
48
import net.mygwt.ui.client.event.Listener;
48
import net.mygwt.ui.client.event.Listener;
49
import net.mygwt.ui.client.widget.ContentPanel;
49
import net.mygwt.ui.client.widget.ContentPanel;
50
import net.mygwt.ui.client.widget.WidgetContainer;
50
import net.mygwt.ui.client.widget.WidgetContainer;
51
import net.mygwt.ui.client.widget.layout.BorderLayoutData;
51
import net.mygwt.ui.client.widget.layout.BorderLayoutData;
52
import net.mygwt.ui.client.widget.layout.FillLayout;
52
import net.mygwt.ui.client.widget.layout.FillLayout;
53
import net.mygwt.ui.client.widget.table.Table;
53
import net.mygwt.ui.client.widget.table.Table;
54
import net.mygwt.ui.client.widget.table.TableColumn;
54
import net.mygwt.ui.client.widget.table.TableColumn;
55
import net.mygwt.ui.client.widget.table.TableColumnModel;
55
import net.mygwt.ui.client.widget.table.TableColumnModel;
56
import net.mygwt.ui.client.widget.table.TableItem;
56
import net.mygwt.ui.client.widget.table.TableItem;
57
 
57
 
58
import com.google.gwt.http.client.URL;
58
import com.google.gwt.http.client.URL;
59
import com.google.gwt.json.client.JSONArray;
59
import com.google.gwt.json.client.JSONArray;
60
import com.google.gwt.json.client.JSONNumber;
60
import com.google.gwt.json.client.JSONNumber;
61
import com.google.gwt.json.client.JSONParser;
61
import com.google.gwt.json.client.JSONParser;
62
import com.google.gwt.json.client.JSONString;
62
import com.google.gwt.json.client.JSONString;
63
import com.google.gwt.json.client.JSONValue;
63
import com.google.gwt.json.client.JSONValue;
64
import com.google.gwt.user.client.HTTPRequest;
64
import com.google.gwt.user.client.HTTPRequest;
65
import com.google.gwt.user.client.ResponseTextHandler;
65
import com.google.gwt.user.client.ResponseTextHandler;
66
import com.google.gwt.user.client.ui.Composite;
66
import com.google.gwt.user.client.ui.Composite;
67
import com.google.gwt.user.client.ui.DockPanel;
67
import com.google.gwt.user.client.ui.DockPanel;
68
import com.google.gwt.user.client.ui.HTML;
68
import com.google.gwt.user.client.ui.HTML;
69
import com.google.gwt.user.client.ui.HorizontalPanel;
69
import com.google.gwt.user.client.ui.HorizontalPanel;
70
import com.google.gwt.user.client.ui.Image;
70
import com.google.gwt.user.client.ui.Image;
71
import com.google.gwt.user.client.ui.Button;
71
import com.google.gwt.user.client.ui.Button;
72
import com.google.gwt.user.client.ui.Label;
72
import com.google.gwt.user.client.ui.Label;
73
import com.google.gwt.user.client.ui.Widget;
73
import com.google.gwt.user.client.ui.Widget;
74
import com.google.gwt.user.client.ui.ClickListener;
74
import com.google.gwt.user.client.ui.ClickListener;
75
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
75
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
76
import com.google.gwt.user.client.ui.HasVerticalAlignment;
76
import com.google.gwt.user.client.ui.HasVerticalAlignment;
77
 
77
 
78
 
78
 
79
public class InventoryListView 
79
public class InventoryListView 
80
		 {
80
		 {
81
 
81
 
82
	// Debut Barre de navigation
82
	// Debut Barre de navigation
83
 
83
 
84
	private class NavBar extends Composite implements ClickListener {
84
	private class NavBar extends Composite implements ClickListener {
85
 
85
 
86
		
86
		
87
		public final DockPanel bar = new DockPanel();
87
		public final DockPanel bar = new DockPanel();
88
		
88
		
89
 
89
 
90
		public final Button gotoFirst = new Button("<<", this);
90
		public final Button gotoFirst = new Button("<<", this);
91
		public final Button gotoNext = new Button(">", this);
91
		public final Button gotoNext = new Button(">", this);
92
		public final Button gotoPrev = new Button("<", this);
92
		public final Button gotoPrev = new Button("<", this);
93
		public final Button gotoEnd = new Button(">>", this);
93
		public final Button gotoEnd = new Button(">>", this);
94
		public final Label status = new Label();
94
		public final Label status = new Label();
95
		
95
		
96
 
96
 
97
		public NavBar() {
97
		public NavBar() {
98
			
98
			
99
			initWidget(bar);
99
			initWidget(bar);
100
			
100
			
101
			status.setWordWrap(false);
101
			status.setWordWrap(false);
102
 
102
 
103
			HorizontalPanel buttons = new HorizontalPanel();
103
			HorizontalPanel buttons = new HorizontalPanel();
104
			
104
			
105
			buttons.add(status);
105
			buttons.add(status);
106
			buttons.setCellHorizontalAlignment(status, HasHorizontalAlignment.ALIGN_RIGHT);
106
			buttons.setCellHorizontalAlignment(status, HasHorizontalAlignment.ALIGN_RIGHT);
107
			buttons.setCellVerticalAlignment(status, HasVerticalAlignment.ALIGN_MIDDLE);
107
			buttons.setCellVerticalAlignment(status, HasVerticalAlignment.ALIGN_MIDDLE);
108
 
108
 
109
 
109
 
110
			buttons.add(gotoFirst);
110
			buttons.add(gotoFirst);
111
			buttons.add(gotoPrev);
111
			buttons.add(gotoPrev);
112
			buttons.add(gotoNext);
112
			buttons.add(gotoNext);
113
			buttons.add(gotoEnd);
113
			buttons.add(gotoEnd);
114
			
114
			
115
			bar.add(buttons, DockPanel.EAST);
115
			bar.add(buttons, DockPanel.EAST);
116
 
116
 
117
			
117
			
118
		}
118
		}
119
		
119
		
120
 
120
 
121
		public void onClick(Widget sender) {
121
		public void onClick(Widget sender) {
122
			if (sender == gotoNext) {
122
			if (sender == gotoNext) {
123
				// Move forward a page.
123
				// Move forward a page.
124
				startIndex += VISIBLE_TAXON_COUNT;
124
				startIndex += VISIBLE_TAXON_COUNT;
125
				if (startIndex >= count)
125
				if (startIndex >= count)
126
					startIndex -= VISIBLE_TAXON_COUNT;
126
					startIndex -= VISIBLE_TAXON_COUNT;
127
			} else {
127
			} else {
128
				if (sender == gotoPrev) {
128
				if (sender == gotoPrev) {
129
					// Move back a page.
129
					// Move back a page.
130
					startIndex -= VISIBLE_TAXON_COUNT;
130
					startIndex -= VISIBLE_TAXON_COUNT;
131
					if (startIndex < 0)
131
					if (startIndex < 0)
132
						startIndex = 0;
132
						startIndex = 0;
133
				} else {
133
				} else {
134
					if (sender == gotoEnd) {
134
					if (sender == gotoEnd) {
135
						gotoEnd();
135
						gotoEnd();
136
					} else {
136
					} else {
137
						if (sender == gotoFirst) {
137
						if (sender == gotoFirst) {
138
							startIndex = 0;
138
							startIndex = 0;
139
						}
139
						}
140
					}
140
					}
141
				}
141
				}
142
			}
142
			}
143
			update();
143
			update();
144
		}
144
		}
145
 
145
 
146
	}
146
	}
147
 
147
 
148
	// Fin Barre de navigation
148
	// Fin Barre de navigation
149
 
149
 
150
	// Conteneur (header et table sont dans panel)
150
	// Conteneur (header et table sont dans panel)
151
	private ContentPanel panel =null;
151
	private ContentPanel panel =null;
152
	private Table table = null;
152
	private Table table = null;
153
	
153
	
154
	// Services 
154
	// Services 
155
	private String serviceBaseUrl = null;
155
	private String serviceBaseUrl = null;
156
	private String user;
156
	private String user;
157
	private Mediator mediator = null;
157
	private Mediator mediator = null;
158
 
158
 
159
	// Navigation
159
	// Navigation
160
	private int startIndex = 0;
160
	private int startIndex = 0;
161
	private int count = 0;
161
	private int count = 0;
162
	private static final int VISIBLE_TAXON_COUNT = 15;
162
	private static final int VISIBLE_TAXON_COUNT = 15;
163
	private NavBar navBar=null;
163
	private NavBar navBar=null;
164
 
164
 
165
	// Filtre par defaut :
165
	// Filtre par defaut :
166
	
166
	
167
	private String id_location = "all";
167
	private String id_location = "all";
168
	private String location = "all";
168
	private String location = "all";
169
	private String year = "all";
169
	private String year = "all";
170
	private String month = "all";
170
	private String month = "all";
171
	private String day = "all";
171
	private String day = "all";
172
	private String search = "all";
172
	private String search = "all";
173
	private String lieudit = "all";
173
	private String lieudit = "all";
174
	private String ordre= null;
174
	private String ordre= null;
175
	
175
	
176
	
176
	
177
 
177
 
178
 
178
 
179
	public InventoryListView(Mediator med) {
179
	public InventoryListView(Mediator med) {
180
		
180
		
181
		
181
		
182
		// Traitement contexte utilisateur et service
182
		// Traitement contexte utilisateur et service
183
 
183
 
184
		mediator=med;
184
		mediator=med;
185
 
185
 
186
		user=mediator.getUser();
186
		user=mediator.getUser();
187
	    serviceBaseUrl = mediator.getServiceBaseUrl();
187
	    serviceBaseUrl = mediator.getServiceBaseUrl();
188
	
188
	
189
	    
189
	    
190
	    panel= new ContentPanel(Style.HEADER);
190
	    panel= new ContentPanel(Style.HEADER);
191
	    panel.setLayout(new FillLayout());
191
	    panel.setLayout(new FillLayout());
192
	    
192
	    
193
	    
193
	    
194
	    // Barre navigation integree au header 
194
	    // Barre navigation integree au header 
195
	    
195
	    
196
		navBar = new NavBar();
196
		navBar = new NavBar();
197
		panel.getHeader().addWidget(navBar);
197
		panel.getHeader().addWidget(navBar);
198
 
198
 
199
		
199
		
200
		//  Contenu :
200
		//  Contenu :
201
		
201
		
202
		
202
		
203
		//  Colonnes :
203
		//  Colonnes :
204
		
204
		
205
		TableColumn[] columns = new TableColumn[5]; 
205
		TableColumn[] columns = new TableColumn[6]; 
206
		
206
		
207
		// TODO : renderer date, alignement etc
207
		// TODO : renderer date, alignement etc
208
		
208
		
209
		columns[0] = new TableColumn("etat","Transmis", 50);  
-
 
210
		columns[0].setSortable(false);
209
		columns[0] = new TableColumn("etat","Aransmis", 50);  
211
 
-
 
212
		columns[1] = new TableColumn("nom","Nom saisi", 200);  
210
 
213
		columns[1].setSortable(false);
-
 
214
		
211
		columns[1] = new TableColumn("nom","Nom saisi", 250);  
215
		columns[2] = new TableColumn("observation","Observation", 650);  
-
 
216
		columns[2].setSortable(false);
212
		
-
 
213
		columns[2] = new TableColumn("nomr","Nom retenu", 250);  
217
 
214
 
218
		columns[3] = new TableColumn("date","Date", 75);  
215
		columns[3] = new TableColumn("lieu","Lieu", 350);  
219
		columns[3].setSortable(false);
216
 
220
 
217
		columns[4] = new TableColumn("date","Date", 75);  
221
		columns[4] = new TableColumn("ordre","Ordre", 50);  
218
 
222
		columns[4].setSortable(false);
219
		columns[5] = new TableColumn("ordre","Ordre", 50);  
223
		
220
		
224
	
221
	
225
		TableColumnModel cm = new TableColumnModel(columns);  
222
		TableColumnModel cm = new TableColumnModel(columns);  
226
		
223
		
227
		// Table : 
224
		// Table : 
228
		
225
		
229
		table = new Table(Style.MULTI | Style.HORIZONTAL, cm);  
226
		table = new Table(Style.MULTI | Style.HORIZONTAL, cm);  
230
		table.setBorders(false);  
227
		table.setBorders(false);  
231
		
228
		
232
		
229
		
233
		panel.add(table);
230
		panel.add(table);
234
		
231
		
235
		WidgetContainer center=mediator.getCenterContainer();
232
		WidgetContainer center=mediator.getCenterContainer();
236
		BorderLayoutData centerData = new BorderLayoutData(Style.CENTER, .75f, 100, 1000);
233
		BorderLayoutData centerData = new BorderLayoutData(Style.CENTER, .75f, 100, 1000);
237
		center.add(panel,centerData);
234
		center.add(panel,centerData);
238
 
235
 
239
		
236
		
240
 
237
 
241
		// Selection d'une ligne 
238
		// Selection d'une ligne 
242
		table.addListener(Events.RowClick, new Listener() {
239
		table.addListener(Events.RowClick, new Listener() {
243
 
240
 
244
		      public void handleEvent(BaseEvent be) {
241
		      public void handleEvent(BaseEvent be) {
245
		        TableItem item=(TableItem) be.item;
242
		        TableItem item=(TableItem) be.item;
246
		        if (item!=null) {
243
		        if (item!=null) {
247
		        	if (ordre==null) { // Affichage de la ligne selectionne
244
		        	if (ordre==null) { // Affichage de la ligne selectionne
248
		        		ordre= (String) item.getValue(4);
245
		        		ordre= (String) item.getValue(5);
249
		        		mediator.onInventoryItemSelected(ordre);
246
		        		mediator.onInventoryItemSelected(ordre);
250
		        	}
247
		        	}
251
		        	else { 
248
		        	else { 
252
		        		// Si une ligne etait deja selectionne 
249
		        		// Si une ligne etait deja selectionne 
253
		        		if (ordre.compareTo((String) item.getValue(4))==0) { // C'est la meme, on la deselectionne
250
		        		if (ordre.compareTo((String) item.getValue(5))==0) { // C'est la meme, on la deselectionne
254
		        			ordre=null;
251
		        			ordre=null;
255
		        			table.deselect(be.rowIndex);
252
		        			table.deselect(be.rowIndex);
256
		        			mediator.onInventoryItemUnselected();
253
		        			mediator.onInventoryItemUnselected();
257
		        		}
254
		        		}
258
		        		else {
255
		        		else {
259
			        		ordre= (String) item.getValue(4); // C'est une autre, on la selectionne
256
			        		ordre= (String) item.getValue(5); // C'est une autre, on la selectionne
260
		        			mediator.onInventoryItemSelected(ordre);
257
		        			mediator.onInventoryItemSelected(ordre);
261
		        		}
258
		        		}
262
		        		
259
		        		
263
		        	}
260
		        	}
264
		        }
261
		        }
265
		      }
262
		      }
266
		});
263
		});
267
		
264
		
268
	
265
	
269
	
266
	
270
 
267
 
271
 
268
 
272
	}
269
	}
273
	
270
	
274
	
271
	
275
	/**
272
	/**
276
	 * Suppression d'un ensemble d'element de la liste d'inventaire, on garde ici car s'applique a plusieurs elements
273
	 * Suppression d'un ensemble d'element de la liste d'inventaire, on garde ici car s'applique a plusieurs elements
277
	 * 
274
	 * 
278
	 */
275
	 */
279
 
276
 
280
	public void deleteElement() {
277
	public void deleteElement() {
281
 
278
 
282
		setStatusDisabled();
279
		setStatusDisabled();
283
		TableItem[] selection=table.getSelection();
280
		TableItem[] selection=table.getSelection();
284
 
281
 
285
		StringBuffer ids=new StringBuffer();
282
		StringBuffer ids=new StringBuffer();
286
		for (int i = 0; i < selection.length; i++) {
283
		for (int i = 0; i < selection.length; i++) {
287
			ids.append((String)(((TableItem) selection[i]).getValue(4)));
284
			ids.append((String)(((TableItem) selection[i]).getValue(5)));
288
			if (i<(selection.length-1)) ids.append(",");
285
			if (i<(selection.length-1)) ids.append(",");
289
		} 
286
		} 
290
		
287
		
291
		if (ids.length()>0) {
288
		if (ids.length()>0) {
292
			
289
			
293
			HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user
290
			HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user
294
							+ "/" + ids.toString(), "action=DELETE",
291
							+ "/" + ids.toString(), "action=DELETE",
295
							
292
							
296
							new ResponseTextHandler() {
293
							new ResponseTextHandler() {
297
								public void onCompletion(String str) {
294
								public void onCompletion(String str) {
298
											mediator.onInventoryUpdated(id_location,"all","all");
295
											mediator.onInventoryUpdated(id_location,"all","all");
-
 
296
											mediator.getEntryView().clear();
299
								}
297
								}
300
							});
298
							});
301
		}
299
		}
302
	
300
	
303
		setStatusEnabled();
301
		setStatusEnabled();
304
 
302
 
305
	}
303
	}
306
	
304
	
307
	
305
	
308
	
306
	
309
	
307
	
310
	/**
308
	/**
311
	 * Transmission de releve a Tela, on garde ici car s'applique a plusieurs elements
309
	 * Transmission de releve a Tela, on garde ici car s'applique a plusieurs elements
312
	 */
310
	 */
313
 
311
 
314
	
312
	
315
	public void transmitElement() {
313
	public void transmitElement() {
316
	
314
	
317
		setStatusDisabled();
315
		setStatusDisabled();
318
		
316
		
319
		TableItem[] selection=table.getSelection();
317
		TableItem[] selection=table.getSelection();
320
 
318
 
321
		StringBuffer ids=new StringBuffer();
319
		StringBuffer ids=new StringBuffer();
322
		for (int i = 0; i < selection.length; i++) {
320
		for (int i = 0; i < selection.length; i++) {
323
			ids.append((String)(((TableItem) selection[i]).getValue(4)));
321
			ids.append((String)(((TableItem) selection[i]).getValue(5)));
324
			if (i<(selection.length-1)) ids.append(",");
322
			if (i<(selection.length-1)) ids.append(",");
325
		} 
323
		} 
326
		
324
		
327
		if (ids.length()>0) {
325
		if (ids.length()>0) {
328
		
326
		
329
			HTTPRequest.asyncPost(serviceBaseUrl + "/InventoryTransmit/" + user
327
			HTTPRequest.asyncPost(serviceBaseUrl + "/InventoryTransmit/" + user
330
							+ "/" + ids.toString(), "transmission=1",
328
							+ "/" + ids.toString(), "transmission=1",
331
							
329
							
332
							new ResponseTextHandler() {
330
							new ResponseTextHandler() {
333
								public void onCompletion(String str) {
331
								public void onCompletion(String str) {
334
											update(); // Pour affichage logo 
332
											update(); // Pour affichage logo 
335
								}
333
								}
336
							});
334
							});
337
		}
335
		}
338
	
336
	
339
		setStatusEnabled();
337
		setStatusEnabled();
340
 
338
 
341
		
339
		
342
	}
340
	}
343
	
341
	
344
	
342
	
345
	/**
343
	/**
346
	 * Recherche nombre d'enregistrement pour l'utilisateur et la localite en cours
344
	 * Recherche nombre d'enregistrement pour l'utilisateur et la localite en cours
347
	 * 
345
	 * 
348
	 */
346
	 */
349
	
347
	
350
	public void updateCount	() {
348
	public void updateCount	() {
351
		
349
		
352
		setStatusDisabled();
350
		setStatusDisabled();
353
 
351
 
354
		
352
		
355
		// Transformation de la date selectionne vers date time stamp
353
		// Transformation de la date selectionne vers date time stamp
356
		
354
		
357
 
355
 
358
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + id_location + "/" + URL.encodeComponent(location) + "/" + year  + "/"  + month  + "/"  + day  + "/" + URL.encodeComponent(search) +  "/" + URL.encodeComponent(lieudit), 
356
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + id_location + "/" + URL.encodeComponent(location) + "/" + year  + "/"  + month  + "/"  + day  + "/" + URL.encodeComponent(search) +  "/" + URL.encodeComponent(lieudit), 
359
				new ResponseTextHandler() {
357
				new ResponseTextHandler() {
360
 
358
 
361
					public void onCompletion(String str) {
359
					public void onCompletion(String str) {
362
 
360
 
363
						JSONValue jsonValue = JSONParser.parse(str);
361
						JSONValue jsonValue = JSONParser.parse(str);
364
						JSONNumber jsonNumber;
362
						JSONNumber jsonNumber;
365
						if ((jsonNumber = jsonValue.isNumber()) != null) {
363
						if ((jsonNumber = jsonValue.isNumber()) != null) {
366
							count = (int) jsonNumber.getValue();
364
							count = (int) jsonNumber.getValue();
367
						//	if (location.compareTo("")==0) location="000null";
365
						//	if (location.compareTo("")==0) location="000null";
368
							gotoEnd(); // Derniere page
366
							gotoEnd(); // Derniere page
369
							update();
367
							update();
370
						}
368
						}
371
					}
369
					}
372
				});
370
				});
373
 
371
 
374
	}
372
	}
375
	
373
	
376
	/**
374
	/**
377
	 * Mise a jour de l'affichage, a partir des donnaes d'inventaire deja
375
	 * Mise a jour de l'affichage, a partir des donnaes d'inventaire deja
378
	 * saisies. La valeur de this.startIndex permet de determiner quelles
376
	 * saisies. La valeur de this.startIndex permet de determiner quelles
379
	 * donnaes seront affichees
377
	 * donnaes seront affichees
380
	 * 
378
	 * 
381
	 */
379
	 */
382
 
380
 
383
	public void update() {
381
	public void update() {
384
 
382
 
385
		
383
		
386
		
384
		
387
//   TODO : optimisation	 (ne pas supprimer mais remplacer)
385
//   TODO : optimisation	 (ne pas supprimer mais remplacer)
388
		
386
		
389
 
387
 
390
		
388
		
391
//      Ligne d'information 
389
//      Ligne d'information 
392
 
390
 
393
		// Toutes date par defaut
391
		// Toutes date par defaut
394
		
392
		
395
 
393
 
396
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + id_location + "/" + URL.encodeComponent(location) +"/" + year  + "/"  + month  + "/"  + day   + "/" + URL.encodeComponent(search) + "/" + URL.encodeComponent(lieudit) + "/"
394
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + id_location + "/" + URL.encodeComponent(location) +"/" + year  + "/"  + month  + "/"  + day   + "/" + URL.encodeComponent(search) + "/" + URL.encodeComponent(lieudit) + "/"
397
				+ startIndex + "/" + VISIBLE_TAXON_COUNT,
395
				+ startIndex + "/" + VISIBLE_TAXON_COUNT,
398
 
396
 
399
		new ResponseTextHandler() {
397
		new ResponseTextHandler() {
400
 
398
 
401
			public void onCompletion(String str) {
399
			public void onCompletion(String str) {
402
 
400
 
403
				JSONValue jsonValue = JSONParser.parse(str);
401
				JSONValue jsonValue = JSONParser.parse(str);
404
				JSONArray jsonArray;
402
				JSONArray jsonArray;
405
				JSONArray jsonArrayNested;
403
				JSONArray jsonArrayNested;
406
				
404
				
407
				int i=0;
405
				int i=0;
408
 
406
 
409
				if ((jsonArray = jsonValue.isArray()) != null) {
407
				if ((jsonArray = jsonValue.isArray()) != null) {
410
					
408
					
411
					StringBuffer observationText=null;
409
					StringBuffer lieu=null;
412
 
410
 
413
					int arraySize = jsonArray.size();
411
					int arraySize = jsonArray.size();
414
					
412
					
415
					for (i = 0; i < arraySize; ++i) {
413
					for (i = 0; i < arraySize; ++i) {
416
						if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) {
414
						if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) {
417
							
415
							
418
 
416
 
419
							Object[] values = new Object[5];
-
 
420
							
417
							Object[] values = new Object[6];
421
							observationText=new StringBuffer();
418
							
422
													
419
													
423
							// Statut Observation transmise ?
420
							// Statut Observation transmise ?
424
							
-
 
425
							
421
							
426
							String atransmit=((JSONString) jsonArrayNested .get(12)).stringValue();
422
							String atransmit=((JSONString) jsonArrayNested .get(13)).stringValue();
427
							
423
							
428
							if (atransmit.compareTo("1")==0) {
424
							if (atransmit.compareTo("1")==0) {
429
								values[0] = new Image("tela.gif");
425
								values[0] = new Image("tela.gif");
430
							}
426
							}
431
							else {
427
							else {
432
								values[0] = new HTML("&nbsp;");
428
								values[0] = new HTML("&nbsp;");
433
							}
429
							}
434
							
430
							
435
						
431
						
436
							// Nom saisi
432
							// Nom saisi
437
							
433
							
438
							values[1] = new HTML("<b>"+Util.toCelString(((JSONString) jsonArrayNested .get(0)).toString())+"</b>");
434
							values[1] = new HTML("<b>"+Util.toCelString(((JSONString) jsonArrayNested .get(0)).toString())+"</b>");
439
							
435
							
440
							
436
							
441
							
-
 
442
						    // Texte decrivant l'observation
-
 
443
							
437
 
444
							// Nom retenu
438
							// Nom retenu
445
							String aname=Util.toCelString(((JSONString) jsonArrayNested .get(2)).toString());
439
							String aname=Util.toCelString(((JSONString) jsonArrayNested .get(2)).toString());
446
							
440
							
447
							if (aname.compareTo("null")==0) {
441
							if (aname.compareTo("null")==0) {
-
 
442
								values[2] = new HTML("&nbsp;");
448
							}
443
							}
449
							else {
444
							else {
450
								observationText.append(aname+", ");
445
								values[2] = new HTML(aname);
451
							}
446
							}
452
							
447
							
453
							// Num nomenclatural
448
							// Num nomenclatural
-
 
449
							/*
454
							String ann=((JSONString) jsonArrayNested .get(3)).stringValue();
450
							String ann=((JSONString) jsonArrayNested .get(3)).stringValue();
455
							
451
							
456
							if (ann.compareTo("0")!=0) {
452
							if (ann.compareTo("0")!=0) {
457
								observationText.append(""+ann+"-");
453
								observationText.append(""+ann+"-");
458
							}
454
							}
459
							else {
455
							else {
460
								observationText.append("0-");
456
								observationText.append("0-");
461
							}
457
							}
-
 
458
							*/
462
 
459
 
463
							
460
							
464
							// Num Taxonomique
461
							// Num Taxonomique
-
 
462
							
465
							
463
							/*
466
							String ant=((JSONString) jsonArrayNested .get(4)).stringValue();
464
							String ant=((JSONString) jsonArrayNested .get(4)).stringValue();
467
							
465
							
468
							if (ant.compareTo("0")!=0) {
466
							if (ant.compareTo("0")!=0) {
469
								observationText.append(ant+", ");
467
								observationText.append(ant+", ");
470
							}
468
							}
471
							else {
469
							else {
472
								observationText.append("0, ");
470
								observationText.append("0, ");
473
							}
471
							}
-
 
472
							*/
474
 
473
 
-
 
474
							// Famille
-
 
475
							
475
							// Famille
476
							/*
476
							String afamily=Util.toCelString(((JSONString) jsonArrayNested .get(5)).toString());
477
							String afamily=Util.toCelString(((JSONString) jsonArrayNested .get(5)).toString());
477
							
478
							
478
							if (afamily.compareTo("null")==0) {
479
							if (afamily.compareTo("null")==0) {
479
								//
480
								//
480
							}
481
							}
481
							else {
482
							else {
482
								observationText.append(afamily+", ");
483
								observationText.append(afamily+", ");
483
							}
484
							}
-
 
485
							*/
-
 
486
 
-
 
487
//							Localisation - Lieu
-
 
488
 
-
 
489
							lieu=new StringBuffer();
484
 
-
 
485
							
490
 
486
							String aloc=Util.toCelString(((JSONString) jsonArrayNested .get(6)).toString());
-
 
487
//								Localisation - Lieu
491
							String aloc=Util.toCelString(((JSONString) jsonArrayNested .get(6)).toString());
488
								
492
								
489
								if (aloc.compareTo("000null")==0) {
493
								if (aloc.compareTo("000null")==0) {
490
									if (observationText.length()==0) {
494
									if (lieu.length()==0) {
491
										observationText.append("Commune absente");
495
										lieu.append("Commune absente");
492
									}
496
									}
493
									else {
497
									else {
494
										observationText.append("commune absente");
498
										lieu.append("commune absente");
495
									}
499
									}
496
								}
500
								}
497
								else {
501
								else {
498
									if (observationText.length()==0) {
502
									if (lieu.length()==0) {
499
										observationText.append("Commune de "+aloc);
503
										lieu.append("Commune de "+aloc);
500
									}
504
									}
501
									else {
505
									else {
502
										observationText.append("commune de "+aloc);
506
										lieu.append("commune de "+aloc);
503
									}
507
									}
504
										
508
										
505
								}
509
								}
506
							
510
							
507
								
511
								
508
								String alieudit=Util.toCelString(((JSONString) jsonArrayNested .get(9)).toString());
512
								String alieudit=Util.toCelString(((JSONString) jsonArrayNested .get(9)).toString());
509
							
513
							
510
//								Localisation - Lieu dit
514
//								Localisation - Lieu dit
511
								
515
								
512
								if (alieudit.compareTo("000null")!=0) {
516
								if (alieudit.compareTo("000null")!=0) {
513
									observationText.append(", "+alieudit);
517
									lieu.append(", "+alieudit);
514
								}
518
								}
515
								
519
								
516
								
520
								
517
//								Station -
521
//								Station -
518
								
522
								
519
								String astation=Util.toCelString(((JSONString) jsonArrayNested .get(10)).toString());
523
								String astation=Util.toCelString(((JSONString) jsonArrayNested .get(10)).toString());
520
 
524
 
521
								
525
								
522
								if (astation.compareTo("000null")!=0) {
526
								if (astation.compareTo("000null")!=0) {
523
									observationText.append(", "+astation);
527
									lieu.append(", "+astation);
524
								}
528
								}
-
 
529
 
-
 
530
								
-
 
531
//								Milieu
-
 
532
								
-
 
533
								String amilieu=Util.toCelString(((JSONString) jsonArrayNested .get(11)).toString());
-
 
534
 
-
 
535
								
-
 
536
								if (amilieu.compareTo("000null")!=0) {
-
 
537
									lieu.append(", "+amilieu);
525
 
538
								}								
526
							
539
							
527
								String acomment=Util.toCelString(((JSONString) jsonArrayNested .get(11)).toString());
540
								String acomment=Util.toCelString(((JSONString) jsonArrayNested .get(12)).toString());
528
//								Commentaire
541
//								Commentaire
529
								
542
								
530
								if (acomment.compareTo("null")!=0) {
543
								if (acomment.compareTo("null")!=0) {
531
									observationText.append(", "+acomment);
544
									lieu.append(", "+acomment);
-
 
545
								}
-
 
546
 
-
 
547
								
-
 
548
								if (lieu.toString().compareTo("")==0) {
-
 
549
									values[3] = new HTML("&nbsp;");
-
 
550
								}
-
 
551
								else {
-
 
552
									values[3] = new HTML(lieu.toString());
532
								}
553
								}
533
 
554
 
534
								
555
								
535
								String adate=((JSONString) jsonArrayNested .get(8)).stringValue();
556
								String adate=((JSONString) jsonArrayNested .get(8)).stringValue();
536
								
557
								
537
//								Date 
558
//								Date 
538
								if (adate.compareTo("0000-00-00 00:00:00")!=0) {
559
								if (adate.compareTo("0000-00-00 00:00:00")!=0) {
539
									values[3]=new HTML("<b>"+adate+"</b>"); 
560
									values[4]=new HTML("<b>"+adate+"</b>"); 
540
								}
561
								}
541
								else { 
562
								else { 
542
									values[3] = new HTML("&nbsp;");
563
									values[4] = new HTML("&nbsp;");
543
								}
564
								}
544
									
565
									
545
 
-
 
546
 
-
 
547
							values[2] = observationText;
566
 
548
							
567
							
549
							String aordre=((JSONString) jsonArrayNested.get(7)).stringValue();
568
							String aordre=((JSONString) jsonArrayNested.get(7)).stringValue();
550
						
569
						
551
							// Numero d'ordre (cache)
570
							// Numero d'ordre (cache)
552
							
571
							
553
							values[4] = aordre;
572
							values[5] = aordre;
554
							
573
							
555
							
574
							
556
						
575
						
557
							
576
							
558
					    	if (i>=table.getItemCount()) {
577
					    	if (i>=table.getItemCount()) {
559
					    		TableItem item = new TableItem(values);
578
					    		TableItem item = new TableItem(values);
560
					    		table.add(item);
579
					    		table.add(item);
561
							}
580
							}
562
							else {
581
							else {
563
								TableItem item=table.getItem(i);
582
								TableItem item=table.getItem(i);
564
								item.setValue(0,values[0]);
583
								item.setValue(0,values[0]);
565
								item.setValue(1,values[1]);
584
								item.setValue(1,values[1]);
566
								item.setValue(2,values[2]);
585
								item.setValue(2,values[2]);
567
								item.setValue(3,values[3]);
586
								item.setValue(3,values[3]);
568
								item.setValue(4,values[4]);
587
								item.setValue(4,values[4]);
-
 
588
								item.setValue(5,values[5]);
569
							}
589
							}
570
					    	
590
					    	
571
					    	// Spagetti
591
					    	// Spagetti
572
							if (ordre!=null) {
592
							if (ordre!=null) {
573
								if (aordre.compareTo(ordre)==0) {
593
								if (aordre.compareTo(ordre)==0) {
574
									table.select(i);
594
									table.select(i);
575
								}
595
								}
576
								else {
596
								else {
577
									table.deselect(i);
597
									table.deselect(i);
578
								}
598
								}
579
							}
599
							}
580
							
600
							
581
						}
601
						}
582
 
602
 
583
					}
603
					}
584
				}
604
				}
585
 
605
 
586
				// Suppression fin ancien affichage
606
				// Suppression fin ancien affichage
587
				if (i<table.getItemCount()) {
607
				if (i<table.getItemCount()) {
588
					 for (int j = table.getItemCount() -1 ; j >= i; j--) {
608
					 for (int j = table.getItemCount() -1 ; j >= i; j--) {
589
						 TableItem item=table.getItem(j);
609
						 TableItem item=table.getItem(j);
590
						 table.remove(item);
610
						 table.remove(item);
591
					 }
611
					 }
592
				}
612
				}
593
				
613
				
594
				setStatusEnabled();
614
				setStatusEnabled();
595
				
615
				
596
				
616
				
597
			}
617
			}
598
		});
618
		});
599
		
619
		
600
 
620
 
601
	}
621
	}
602
 
622
 
603
 
623
 
604
	/**
624
	/**
605
	 * Affichage message d'attente et desactivation navigation
625
	 * Affichage message d'attente et desactivation navigation
606
	 * 
626
	 * 
607
	 * @param
627
	 * @param
608
	 * @return void
628
	 * @return void
609
	 */
629
	 */
610
 
630
 
611
	private void setStatusDisabled() {
631
	private void setStatusDisabled() {
612
 
632
 
613
		navBar.gotoFirst.setEnabled(false);
633
		navBar.gotoFirst.setEnabled(false);
614
		navBar.gotoPrev.setEnabled(false);
634
		navBar.gotoPrev.setEnabled(false);
615
		navBar.gotoNext.setEnabled(false);
635
		navBar.gotoNext.setEnabled(false);
616
		navBar.gotoEnd.setEnabled(false);
636
		navBar.gotoEnd.setEnabled(false);
617
 
637
 
618
		navBar.status.setText("Patientez ...");
638
		navBar.status.setText("Patientez ...");
619
	}
639
	}
620
 
640
 
621
	/**
641
	/**
622
	 * Affichage numero de page et gestion de la navigation
642
	 * Affichage numero de page et gestion de la navigation
623
	 * 
643
	 * 
624
	 */
644
	 */
625
 
645
 
626
	private void setStatusEnabled() {
646
	private void setStatusEnabled() {
627
 
647
 
628
		// Il y a forcemment un disabled avant d'arriver ici
648
		// Il y a forcemment un disabled avant d'arriver ici
629
 
649
 
630
		if (count > 0) {
650
		if (count > 0) {
631
 
651
 
632
			if (startIndex >= VISIBLE_TAXON_COUNT) { // Au dela de la
652
			if (startIndex >= VISIBLE_TAXON_COUNT) { // Au dela de la
633
														// premiere page
653
														// premiere page
634
				navBar.gotoPrev.setEnabled(true);
654
				navBar.gotoPrev.setEnabled(true);
635
				navBar.gotoFirst.setEnabled(true);
655
				navBar.gotoFirst.setEnabled(true);
636
				if (startIndex < (count - VISIBLE_TAXON_COUNT)) { // Pas la
656
				if (startIndex < (count - VISIBLE_TAXON_COUNT)) { // Pas la
637
																	// derniere
657
																	// derniere
638
																	// page
658
																	// page
639
					navBar.gotoNext.setEnabled(true);
659
					navBar.gotoNext.setEnabled(true);
640
					navBar.gotoEnd.setEnabled(true);
660
					navBar.gotoEnd.setEnabled(true);
641
					navBar.status.setText((startIndex + 1) + " - "
661
					navBar.status.setText((startIndex + 1) + " - "
642
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count );
662
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count );
643
				} else { // Derniere page
663
				} else { // Derniere page
644
					navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count );
664
					navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count );
645
				}
665
				}
646
			} else { // Premiere page
666
			} else { // Premiere page
647
				if (count > VISIBLE_TAXON_COUNT) { // Des pages derrieres
667
				if (count > VISIBLE_TAXON_COUNT) { // Des pages derrieres
648
					navBar.gotoNext.setEnabled(true);
668
					navBar.gotoNext.setEnabled(true);
649
					navBar.gotoEnd.setEnabled(true);
669
					navBar.gotoEnd.setEnabled(true);
650
					navBar.status.setText((startIndex + 1) + " - "
670
					navBar.status.setText((startIndex + 1) + " - "
651
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count);
671
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count);
652
				} else {
672
				} else {
653
					navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count);
673
					navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count);
654
				}
674
				}
655
			}
675
			}
656
		}
676
		}
657
 
677
 
658
		else { // Pas d'inventaire, pas de navigation
678
		else { // Pas d'inventaire, pas de navigation
659
			navBar.status.setText("0 - 0 sur 0");
679
			navBar.status.setText("0 - 0 sur 0");
660
		}
680
		}
661
	}
681
	}
662
 
682
 
663
	/*
683
	/*
664
	 * Positionnement index de parcours (this.startIndex) pour affichage de la
684
	 * Positionnement index de parcours (this.startIndex) pour affichage de la
665
	 * derniere page
685
	 * derniere page
666
	 * 
686
	 * 
667
	 * @param
687
	 * @param
668
	 * @return void
688
	 * @return void
669
	 */
689
	 */
670
 
690
 
671
	private void gotoEnd() {
691
	private void gotoEnd() {
672
 
692
 
673
		if ((count == 0) || (count % VISIBLE_TAXON_COUNT) > 0) {
693
		if ((count == 0) || (count % VISIBLE_TAXON_COUNT) > 0) {
674
			startIndex = count - (count % VISIBLE_TAXON_COUNT);
694
			startIndex = count - (count % VISIBLE_TAXON_COUNT);
675
		} else {
695
		} else {
676
			startIndex = count - VISIBLE_TAXON_COUNT;
696
			startIndex = count - VISIBLE_TAXON_COUNT;
677
		}
697
		}
678
 
698
 
679
	}
699
	}
680
 
700
 
681
	/*
701
	/*
682
	 * Recherche en cours
702
	 * Recherche en cours
683
	 * 
703
	 * 
684
	 */
704
	 */
685
	
705
	
686
	public void setSearch(String search) {
706
	public void setSearch(String search) {
687
		this.search = search;
707
		this.search = search;
688
	}
708
	}
689
 
709
 
690
 
710
 
691
	
711
	
692
	/*
712
	/*
693
	 * Departement en cours 
713
	 * Departement en cours 
694
	 * 
714
	 * 
695
	 */
715
	 */
696
	
716
	
697
	public void setIdLocation(String id_location) {
717
	public void setIdLocation(String id_location) {
698
		this.id_location = id_location;
718
		this.id_location = id_location;
699
	}
719
	}
700
 
720
 
701
 
721
 
702
	
722
	
703
	/*
723
	/*
704
	 * Localite en cours 
724
	 * Localite en cours 
705
	 * 
725
	 * 
706
	 */
726
	 */
707
	
727
	
708
	public void setLocation(String location) {
728
	public void setLocation(String location) {
709
		this.location = location;
729
		this.location = location;
710
	}
730
	}
711
 
731
 
712
 
732
 
713
	
733
	
714
	/*
734
	/*
715
	 * Station en cours 
735
	 * Lieudit en cours 
716
	 * 
736
	 * 
717
	 */
737
	 */
718
 
738
 
719
	public void setLieudit(String lieudit) {
739
	public void setLieudit(String lieudit) {
720
		this.lieudit = lieudit;
740
		this.lieudit = lieudit;
721
	}
741
	}
722
 
742
 
723
	
743
	
724
	
744
	
725
	/*
745
	/*
726
	 * Date en cours 
746
	 * Date en cours 
727
	 * 
747
	 * 
728
	 */
748
	 */
729
	
749
	
730
 
750
 
731
	public void setYear(String year) {
751
	public void setYear(String year) {
732
		this.year = year;
752
		this.year = year;
733
	}
753
	}
734
 
754
 
735
 
755
 
736
	public void setMonth(String month) {
756
	public void setMonth(String month) {
737
		this.month = month;
757
		this.month = month;
738
	}
758
	}
739
 
759
 
740
	public void setDay(String day) {
760
	public void setDay(String day) {
741
		this.day = day;
761
		this.day = day;
742
	}
762
	}
743
 
763
 
744
	
764
	
745
	/*
765
	/*
746
	 * Utilisateur en cours 
766
	 * Utilisateur en cours 
747
	 * 
767
	 * 
748
	 */
768
	 */
749
	
769
	
750
 
770
 
751
	
771
	
752
	public void setUser(String user) {
772
	public void setUser(String user) {
753
		this.user = user;
773
		this.user = user;
754
	}
774
	}
755
 
775
 
756
 
776
 
757
	public void displayFilter() {
777
	public void displayFilter() {
758
		
778
		
759
		
779
		
760
	
780
	
761
	// Mise a jour boutton export feuille de calcul
781
	// Mise a jour boutton export feuille de calcul
762
	
782
	
763
	mediator.getActionView().getExportButton().setHTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" 
783
	mediator.getActionView().getExportButton().setHTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" 
764
			+  user + "/"
784
			+  user + "/"
765
			+ URL.encodeComponent(id_location) + "/"
785
			+ URL.encodeComponent(id_location) + "/"
766
			+ URL.encodeComponent(location) + "/"
786
			+ URL.encodeComponent(location) + "/"
767
			+ URL.encodeComponent(lieudit)+ "/"
787
			+ URL.encodeComponent(lieudit)+ "/"
768
			+ year + "/"
788
			+ year + "/"
769
			+ month  + "/"
789
			+ month  + "/"
770
			+ day 
790
			+ day 
771
			+ "\">"+"Export&nbsp;tableur</a>");
791
			+ "\">"+"Export&nbsp;tableur</a>");
772
 
792
 
773
	
793
	
774
	// Mise a jour ligne de selection 
794
	// Mise a jour ligne de selection 
775
	
795
	
776
	
796
	
777
	
797
	
778
	String dep;
798
	String dep;
779
	if (id_location.compareTo("all")==0) {
799
	if (id_location.compareTo("all")==0) {
780
		dep="Tous d&eacute;partements";
800
		dep="Tous d&eacute;partements";
781
	}
801
	}
782
	else {
802
	else {
783
		if (id_location.compareTo("000null")==0) {
803
		if (id_location.compareTo("000null")==0) {
784
			dep="D&eacute;partements non renseign&eacute;es ";
804
			dep="D&eacute;partements non renseign&eacute;es ";
785
		}
805
		}
786
		else {
806
		else {
787
		dep="Département "+id_location;
807
		dep="Département "+id_location;
788
		}
808
		}
789
	}
809
	}
790
	
810
	
791
	
811
	
792
	
812
	
793
	String com;
813
	String com;
794
	if (location.compareTo("all")==0) {
814
	if (location.compareTo("all")==0) {
795
		com=", toutes communes";
815
		com=", toutes communes";
796
	}
816
	}
797
	else {
817
	else {
798
		if (location.compareTo("000null")==0) {
818
		if (location.compareTo("000null")==0) {
799
			com=", communes non renseign&eacute;es";
819
			com=", communes non renseign&eacute;es";
800
		}
820
		}
801
		else {
821
		else {
802
		com=", commune de "+location;
822
		com=", commune de "+location;
803
		}
823
		}
804
	}
824
	}
805
 
825
 
806
	
826
	
807
	
827
	
808
	String lieu;
828
	String lieu;
809
	
829
	
810
	if (lieudit.compareTo("all")==0) {
830
	if (lieudit.compareTo("all")==0) {
811
		lieu=", tous lieux dits";
831
		lieu=", tous lieux dits";
812
	}
832
	}
813
	else {
833
	else {
814
		if (lieudit.compareTo("000null")==0) {
834
		if (lieudit.compareTo("000null")==0) {
815
			lieu=", lieu-dit non renseign&eacute;es";
835
			lieu=", lieu-dit non renseign&eacute;es";
816
		}
836
		}
817
		else {
837
		else {
818
			lieu=", lieu-dit "+ lieudit;
838
			lieu=", lieu-dit "+ lieudit;
819
		}
839
		}
820
	}
840
	}
821
	
841
	
822
	String dat;
842
	String dat;
823
	
843
	
824
	if ((year.compareTo("all")==0) && (month.compareTo("all")==0) && (day.compareTo("all")==0)) {
844
	if ((year.compareTo("all")==0) && (month.compareTo("all")==0) && (day.compareTo("all")==0)) {
825
		dat=", toutes periodes";
845
		dat=", toutes periodes";
826
	}
846
	}
827
	
847
	
828
	else {
848
	else {
829
	
849
	
830
    	String yea="";
850
    	String yea="";
831
       	String da="";
851
       	String da="";
832
       	String mont="";
852
       	String mont="";
833
       	
853
       	
834
    	if (year.compareTo("all")==0) {
854
    	if (year.compareTo("all")==0) {
835
    		yea=", toutes ann&eacute;es";
855
    		yea=", toutes ann&eacute;es";
836
    	}
856
    	}
837
    	else {
857
    	else {
838
    		if (year.compareTo("0")==0) {
858
    		if (year.compareTo("0")==0) {
839
    			yea=", periode non renseign&eacute;e";
859
    			yea=", periode non renseign&eacute;e";
840
    		}
860
    		}
841
    		else {
861
    		else {
842
    			yea=", "+ year;
862
    			yea=", "+ year;
843
    
863
    
844
            	if (month.compareTo("all")==0) {
864
            	if (month.compareTo("all")==0) {
845
            		mont=", tous mois";
865
            		mont=", tous mois";
846
            	}
866
            	}
847
            	else {
867
            	else {
848
            			mont="/"+ month;
868
            			mont="/"+ month;
849
            	}
869
            	}
850
            
870
            
851
            
871
            
852
            	if (day.compareTo("all")==0) {
872
            	if (day.compareTo("all")==0) {
853
            		da=", tous jours";
873
            		da=", tous jours";
854
            	}
874
            	}
855
            	else {
875
            	else {
856
            			da="/"+ day;
876
            			da="/"+ day;
857
            	}
877
            	}
858
    		}
878
    		}
859
    	}
879
    	}
860
            	
880
            	
861
        dat=yea + mont + da;
881
        dat=yea + mont + da;
862
    	
882
    	
863
	}
883
	}
864
 
884
 
865
	
885
	
866
	panel.getHeader().setText(dep + com + lieu + dat);
886
	panel.getHeader().setText(dep + com + lieu + dat);
867
 
887
 
868
 
888
 
869
	
889
	
870
}
890
}
871
 
891
 
872
 
892
 
873
}
893
}
874
 
894
 
875
/* +--Fin du code ---------------------------------------------------------------------------------------+
895
/* +--Fin du code ---------------------------------------------------------------------------------------+
876
* $Log$
896
* $Log$
-
 
897
* Revision 1.2  2008-01-30 08:55:40  ddelon
-
 
898
* fin mise en place mygwt
-
 
899
*
877
* Revision 1.1  2008-01-02 21:26:04  ddelon
900
* Revision 1.1  2008-01-02 21:26:04  ddelon
878
* mise en place mygwt
901
* mise en place mygwt
879
*
902
*
880
* Revision 1.8  2007-12-22 14:48:53  ddelon
903
* Revision 1.8  2007-12-22 14:48:53  ddelon
881
* Documentation et refactorisation
904
* Documentation et refactorisation
882
*
905
*
883
* Revision 1.7  2007-09-17 19:25:34  ddelon
906
* Revision 1.7  2007-09-17 19:25:34  ddelon
884
* Documentation
907
* Documentation
885
*
908
*
886
*/
909
*/