Subversion Repositories eFlore/Archives.cel-v2

Rev

Rev 13 | Details | Compare with Previous | Last modification | View Log | RSS feed

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