Subversion Repositories eFlore/Applications.cel

Rev

Rev 118 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 118 Rev 120
Line 9... Line 9...
9
import org.tela_botanica.client.modeles.ListeReferentielNom;
9
import org.tela_botanica.client.modeles.ListeReferentielNom;
10
import org.tela_botanica.client.modeles.Observation;
10
import org.tela_botanica.client.modeles.Observation;
11
import org.tela_botanica.client.modeles.ReferentielCommune;
11
import org.tela_botanica.client.modeles.ReferentielCommune;
12
import org.tela_botanica.client.modeles.ReferentielNom;
12
import org.tela_botanica.client.modeles.ReferentielNom;
13
import org.tela_botanica.client.observation.ObservationMediateur;
13
import org.tela_botanica.client.observation.ObservationMediateur;
14
import com.google.gwt.user.client.Window;
-
 
15
import com.gwtext.client.core.EventCallback;
14
import com.gwtext.client.core.EventCallback;
16
import com.gwtext.client.core.EventObject;
15
import com.gwtext.client.core.EventObject;
17
import com.gwtext.client.core.ListenerConfig;
16
import com.gwtext.client.core.ListenerConfig;
18
import com.gwtext.client.core.Position;
17
import com.gwtext.client.core.Position;
19
import com.gwtext.client.core.Template;
-
 
20
import com.gwtext.client.data.ArrayReader;
18
import com.gwtext.client.data.ArrayReader;
21
import com.gwtext.client.data.FieldDef;
19
import com.gwtext.client.data.FieldDef;
22
import com.gwtext.client.data.MemoryProxy;
20
import com.gwtext.client.data.MemoryProxy;
23
import com.gwtext.client.data.RecordDef;
21
import com.gwtext.client.data.RecordDef;
24
import com.gwtext.client.data.SimpleStore;
22
import com.gwtext.client.data.SimpleStore;
Line 29... Line 27...
29
import com.gwtext.client.widgets.Toolbar;
27
import com.gwtext.client.widgets.Toolbar;
30
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
28
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
31
import com.gwtext.client.widgets.form.ComboBox;
29
import com.gwtext.client.widgets.form.ComboBox;
32
import com.gwtext.client.widgets.form.DateField;
30
import com.gwtext.client.widgets.form.DateField;
33
import com.gwtext.client.widgets.form.FormPanel;
31
import com.gwtext.client.widgets.form.FormPanel;
34
import com.gwtext.client.widgets.form.Hidden;
-
 
35
import com.gwtext.client.widgets.form.TextArea;
-
 
36
import com.gwtext.client.widgets.form.TextField;
32
import com.gwtext.client.widgets.form.TextField;
37
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
33
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
38
import com.gwtext.client.widgets.layout.ColumnLayout;
34
import com.gwtext.client.widgets.layout.ColumnLayout;
39
import com.gwtext.client.widgets.layout.ColumnLayoutData;
35
import com.gwtext.client.widgets.layout.ColumnLayoutData;
40
import com.gwtext.client.widgets.layout.FormLayout;
36
import com.gwtext.client.widgets.layout.FormLayout;
Line 63... Line 59...
63
	private ComboBox  commune = null;
59
	private ComboBox  commune = null;
64
	private String departement = null;
60
	private String departement = null;
65
	private ComboBox  espece = null;
61
	private ComboBox  espece = null;
66
	private String numeroNom = null;
62
	private String numeroNom = null;
67
	private String numeroOrdre = null;
63
	private String numeroOrdre = null;
68
	private TextArea motsCles = null;
-
 
Line 69... Line -...
69
 
-
 
70
<<<<<<< .mine
64
 
Line 71... Line 65...
71
	// Pour remise a zero partielle lors d'une validation
65
	// Pour remise a zero partielle lors d'une validation
72
	
66
	
73
	private  enum Champs {
67
	private  enum Champs {
Line 74... Line -...
74
	    DATE, LIEUDIT, STATION, MILIEU, COMMENT, COMMUNE, ESPECE, TOUT 
-
 
75
	};
68
	    DATE, LIEUDIT, STATION, MILIEU, COMMENT, COMMUNE, ESPECE, TOUT 
76
	
-
 
77
	
-
 
78
 
69
	};
79
=======
70
	
Line 80... Line 71...
80
	private String formatDate = null ;
71
	
81
	
72
 
Line 230... Line 221...
230
	
221
	
231
	    milieu = new TextField("Milieu", "milieu", 275);  
222
	    milieu = new TextField("Milieu", "milieu", 275);  
232
	    milieu.setAllowBlank(true);  
223
	    milieu.setAllowBlank(true);  
Line 233... Line -...
233
	    panneauSecondeColonne.add(milieu);
-
 
234
	   
-
 
235
	    motsCles = new TextArea("Mots clés","motscles") ;
-
 
236
	    motsCles.setAllowBlank(true);
-
 
237
	    motsCles.setWidth(275);
-
 
238
	    panneauSecondeColonne.add(motsCles);
224
	    panneauSecondeColonne.add(milieu);
239
	   
225
	   
Line 240... Line 226...
240
		panneauIntermediaire.add(panneauPremierColonne, new ColumnLayoutData(.5));
226
		panneauIntermediaire.add(panneauPremierColonne, new ColumnLayoutData(.5));
Line 278... Line 264...
278
		});
264
		});
Line 279... Line 265...
279
	
265
	
280
		this.add(panneauFormulaire) ;
266
		this.add(panneauFormulaire) ;
Line 281... Line -...
281
		this.setTopToolbar(bt) ;
-
 
-
 
267
		this.setTopToolbar(bt) ;
282
		
268
		
Line 283... Line 269...
283
		
269
		this.setAutoScroll(true);
284
		this.setAutoHeight(true);
270
		//this.setAutoHeight(true);
Line 311... Line 297...
311
			
297
			
Line 312... Line 298...
312
 
298
 
313
		
299
		
314
		    commune.addKeyPressListener(new EventCallback()	{
300
		    commune.addKeyPressListener(new EventCallback()	{
315
		    	
301
		    	
316
		    	    public void execute(EventObject e) {
-
 
317
		    	    	
-
 
318
		    	    		  
-
 
319
		    	    		  switch(e.getKey()) {
-
 
320
		    	    	      	    		  
-
 
321
		    	    		  
-
 
322
		    	    		  case KEY_ALT:
-
 
323
		    	    	      case KEY_CTRL:
-
 
324
		    	    	      case KEY_DOWN:
-
 
325
		    	    	      case KEY_END:
-
 
326
		    	    	      case KEY_ESCAPE:
-
 
327
		    	    	      case KEY_HOME:
-
 
328
		    	    	      case KEY_LEFT:
-
 
329
		    	    	      case KEY_PAGEDOWN:
-
 
330
		    	    	      case KEY_PAGEUP:
-
 
331
		    	    	      case KEY_RIGHT:
-
 
332
		    	    	      case KEY_SHIFT:
-
 
333
		    	    	      case KEY_TAB:
302
	    	    public void execute(EventObject e) {
334
		    	    	      case KEY_UP:
303
	    	    	
335
		    	    	    	
304
	    	    		  
336
		    	    	        break;
305
	    	    		switch(e.getKey()) {
337
		    	    	      
306
	    	    	      
338
		    	    	      case KEY_ENTER:
307
	    	    	    	case KEY_ENTER:
339
		    	    	    	  
308
	    	    	    	  
340
		    	    	    	 if (selectionCommune) {
309
		    	    	    	 if (selectionCommune) {
341
		    	    	    		 selectionCommune=false;
-
 
342
		    	    	    	 }
310
		    	    	    		 selectionCommune=false;
343
		    	    	    	 else {
311
		    	    	    	 }
344
 
312
		    	    	    	else {
345
 
-
 
346
		    	    	    		validerSaisie(Champs.COMMUNE);
-
 
347
		    	    	    		// lancer mise a jour 	    	    	    		 
313
	
348
		    	    	    	 }
314
		    	    	    		validerSaisie(Champs.COMMUNE);
349
		    	    	    	
315
		    	    	    		// lancer mise a jour 	    	    	    		 
Line 350... Line 316...
350
		    	    	    	
316
		    	    	    	 }
351
		    	    	    	  break;
317
		    	    	    break;
Line 352... Line 318...
352
		    	    	       
318
	    	    	       
353
		    	    	      default:
319
		    	    	    default:
354
		    	    	    	  
-
 
355
		    	    	    	  departement="";
-
 
356
		    	    	    	  obtenirListeReferentielCommune();
-
 
357
		    	    	    	  	    	    	        
320
		    	    	    	  
358
		    	    	        break;
-
 
359
		    	    	    }
321
		    	    	    	  departement="";
360
 
-
 
361
		    	    	 
322
		    	    	    	  obtenirListeReferentielCommune();
Line 362... Line 323...
362
		    	    	
323
		    	    	    	  	    	    	        
Line -... Line 324...
-
 
324
		    	    	    break;
-
 
325
	    	    	    }
-
 
326
	     			}
-
 
327
	    		},    listenerConfigCommune
-
 
328
			);
-
 
329
		    
-
 
330
		    date.addKeyPressListener(new EventCallback() {
-
 
331
 
-
 
332
				public void execute(EventObject e) {
-
 
333
					// TODO Auto-generated method stub
-
 
334
					switch(e.getKey()) {
-
 
335
	  	    	      
-
 
336
	  	    	      case KEY_ENTER:	  	    	    	  
-
 
337
	  	    	    		validerSaisie(Champs.DATE); 	    	    		 
-
 
338
	  	    	    	  break;
-
 
339
	  	    	       
-
 
340
	  	    	      default:
-
 
341
					}
-
 
342
				}
-
 
343
		    });
-
 
344
		    
-
 
345
		    station.addKeyPressListener(new EventCallback() {
-
 
346
 
-
 
347
				public void execute(EventObject e) {
-
 
348
					// TODO Auto-generated method stub
-
 
349
					switch(e.getKey()) {
-
 
350
	  	    	      
-
 
351
	  	    	      case KEY_ENTER:	  	    	    	  
-
 
352
	  	    	    		validerSaisie(Champs.STATION); 	    	    		 
Line -... Line 353...
-
 
353
	  	    	    	  break;
363
		     		}
354
	  	    	       
364
		    	 
355
	  	    	      default:
365
		    		},    listenerConfigCommune
356
					}
366
		    	
357
				}
367
			);
358
		    });
Line 412... Line 403...
412
		    	    	    	  
403
		    	    	    	  
413
		    	    	    	 if (selectionEspece) {
404
		    	    	    	 if (selectionEspece) {
414
		    	    	    		 selectionEspece=false;
405
		    	    	    		 selectionEspece=false;
415
		    	    	    	 }
406
		    	    	    	 }
416
		    	    	    	 else {
407
		    	    	    	 else {
417
		    	    	    		// lancer mise a jour 	    	    	    		 
408
		    	    	    		validerSaisie(Champs.ESPECE); 	    	    		 
Line 418... Line 409...
418
		    	    	    	 }
409
		    	    	    	 }
Line 434... Line 425...
434
		    	 
425
		    	 
Line 435... Line 426...
435
		    		},    listenerConfigEspece
426
		    		},    listenerConfigEspece
Line -... Line 427...
-
 
427
		    	
-
 
428
			);
-
 
429
		    
-
 
430
			lieudit.addKeyPressListener(new EventCallback() {
-
 
431
 
-
 
432
				public void execute(EventObject e) {
-
 
433
					// TODO Auto-generated method stub
-
 
434
					switch(e.getKey()) {
-
 
435
	  	    	      
-
 
436
	  	    	      case KEY_ENTER:	  	    	    	  
-
 
437
	  	    	    		validerSaisie(Champs.LIEUDIT); 	    	    		 
-
 
438
	  	    	    	  break;
-
 
439
	  	    	       
-
 
440
	  	    	      default:
-
 
441
					}
-
 
442
				}
-
 
443
		    });
-
 
444
			
-
 
445
			milieu.addKeyPressListener(new EventCallback() {
-
 
446
 
-
 
447
				public void execute(EventObject e) {
-
 
448
					// TODO Auto-generated method stub
-
 
449
					switch(e.getKey()) {
-
 
450
	  	    	      
-
 
451
	  	    	      case KEY_ENTER:	  	    	    	  
-
 
452
	  	    	    		validerSaisie(Champs.MILIEU); 	    	    		 
-
 
453
	  	    	    	  break;
-
 
454
	  	    	       
-
 
455
	  	    	      default:
-
 
456
					}
-
 
457
				}
-
 
458
		    });
-
 
459
			
-
 
460
			comment.addKeyPressListener(new EventCallback() {
-
 
461
 
-
 
462
				public void execute(EventObject e) {
-
 
463
					// TODO Auto-generated method stub
-
 
464
					switch(e.getKey()) {
-
 
465
	  	    	      
-
 
466
	  	    	      case KEY_ENTER:	  	    	    	  
-
 
467
	  	    	    		validerSaisie(Champs.COMMENT); 	    	    		 
-
 
468
	  	    	    	  break;
-
 
469
	  	    	       
-
 
470
	  	    	      default:
Line 436... Line 471...
436
		    	
471
					}
Line 470... Line 505...
470
				
505
				
Line 471... Line 506...
471
				
506
				
472
			}
-
 
473
			
-
 
474
		});
507
			}
Line 475... Line 508...
475
	
508
			
476
	
509
		});
477
	}
510
	}
Line 632... Line 665...
632
	}
665
	}
Line 633... Line 666...
633
   
666
   
Line 634... Line 667...
634
 
667
 
635
	public void ajouterObservation() {
668
	public void ajouterObservation() {
636
 
669
 
Line 637... Line 670...
637
		Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getRawValue(),motsCles.getValueAsString());	
670
		Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getRawValue());	
Line 638... Line 671...
638
		observationMediateur.ajouterObservation(obs);
671
		observationMediateur.ajouterObservation(obs);
639
	}
672
	}
640
	
673
	
Line 641... Line 674...
641
	private void modifierObservation() {
674
	private void modifierObservation() {
Line 691... Line 724...
691
			numeroNom = obs.getNumeroNomenclaturalSaisi() ;
724
			numeroNom = obs.getNumeroNomenclaturalSaisi() ;
692
		}
725
		}
693
		if(!obs.getNumeroOrdre().equals("null") && !obs.getNumeroOrdre().equals("000nu2ll")) {
726
		if(!obs.getNumeroOrdre().equals("null") && !obs.getNumeroOrdre().equals("000nu2ll")) {
694
			numeroOrdre = obs.getNumeroOrdre() ;
727
			numeroOrdre = obs.getNumeroOrdre() ;
695
		}
728
		}
696
		if(!obs.getMotsCles().equals("null") && !obs.getMotsCles().equals("000null")) {
-
 
697
			motsCles.setValue(obs.getMotsCles());
-
 
698
		}
-
 
Line 699... Line 729...
699
		
729
		
Line 700... Line 730...
700
	}
730
	}
Line 724... Line 754...
724
		
754
		
725
			case MILIEU:
755
			case MILIEU:
726
				milieu.reset() ;
756
				milieu.reset() ;
Line 727... Line -...
727
				break;
-
 
728
		
-
 
729
 
757
				break;
730
<<<<<<< .mine
758
		
731
			case COMMENT:
759
			case COMMENT:
Line 756... Line 784...
756
				numeroNom = "" ;
784
				numeroNom = "" ;
757
				numeroOrdre = "";
785
				numeroOrdre = "";
758
				break;
786
				break;
Line 759... Line 787...
759
 
787
 
760
		}
-
 
761
 
-
 
762
=======
-
 
763
		date.reset() ;
-
 
764
		lieudit.reset() ;
-
 
765
		station.reset() ;
-
 
766
		milieu.reset();
-
 
767
		comment.reset();
-
 
768
		commune.reset();
-
 
769
		motsCles.reset();
-
 
770
		departement = "";
-
 
771
		espece.reset();
-
 
772
		numeroNom = "" ;
-
 
773
		numeroOrdre = "";
-
 
Line 774... Line 788...
774
>>>>>>> .r117
788
		}
Line 775... Line 789...
775
		
789
		
776
	}
790
	}
Line 788... Line 802...
788
			
802
			
789
		}
803
		}
790
		else
804
		else
Line 791... Line 805...
791
		{
805
		{
792
 
806
 
793
			boutonOK.setText("Créer") ;
807
			boutonOK.setText("Ajouter") ;
794
			setTitle("Saisir") ;
808
			setTitle("Saisir") ;
795
			boutonAnnuler.setText("Réinitialiser") ;
809
			boutonAnnuler.setText("Réinitialiser") ;
796
			modification = false ;
810
			modification = false ;