Subversion Repositories eFlore/Archives.cel-v1

Rev

Rev 28 | Rev 30 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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