Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 74 Rev 77
Line 67... Line 67...
67
	private String numeroNom = null;
67
	private String numeroNom = null;
68
	private String numeroOrdre = null;
68
	private String numeroOrdre = null;
Line 69... Line 69...
69
 
69
 
70
 
70
 
Line 71... Line 71...
71
	private Button boutonOK = new Button("Créer");
71
	private Button boutonOK = new Button("Créer");
72
	private Button boutonAnnuler = new Button("Annuler");
72
	private Button boutonAnnuler = new Button("Réinitialiser");
Line 73... Line 73...
73
 
73
 
Line 438... Line 438...
438
				
438
				
Line 439... Line 439...
439
				
439
				
440
			}
440
			}
441
			
-
 
442
		});
441
			
443
 
-
 
444
		// on ajoute un écouteur
-
 
Line 445... Line 442...
445
		/*validerInfo.addListener(new ButtonListenerAdapter() {
442
		});
Line -... Line 443...
-
 
443
		
-
 
444
		boutonAnnuler.addListener(new ButtonListenerAdapter() {
446
 
445
			
-
 
446
			public void onClick(Button button, EventObject e) {
-
 
447
				
-
 
448
				if(modification)
447
			// gestion du clic
449
				{
-
 
450
					supprimerObservation() ;
-
 
451
				}
Line 448... Line 452...
448
			
452
				else
-
 
453
				{
449
			public void onClick(Button button, EventObject e) {
454
					viderChampsObservation();
450
				
-
 
Line 451... Line 455...
451
				// lors du clic sur le bouton valider on met à jour les commentaires et la date
455
				}
Line 452... Line 456...
452
		//	getIMediateur().mettreAJourInfo(commentaireGeneral.getText(), dateImage.getRawValue(), noteVue.getNote()) ;
456
				
Line 562... Line 566...
562
			if(nouvelleDonnees instanceof Observation)
566
			if(nouvelleDonnees instanceof Observation)
563
			{
567
			{
564
				Observation obs = (Observation)nouvelleDonnees ;
568
				Observation obs = (Observation)nouvelleDonnees ;
565
				afficherDetailsObservation(obs) ;
569
				afficherDetailsObservation(obs) ;
566
			}
570
			}
-
 
571
			
-
 
572
			if(nouvelleDonnees instanceof String)
-
 
573
			{
-
 
574
				String str = (String)nouvelleDonnees ;
-
 
575
				observationMediateur.obtenirListeObservation() ;
-
 
576
			}
Line 567... Line 577...
567
 
577
 
Line 568... Line 578...
568
	}
578
	}
Line 587... Line 597...
587
	}
597
	}
Line 588... Line 598...
588
   
598
   
Line 589... Line 599...
589
 
599
 
590
	public void ajouterObservation() {
600
	public void ajouterObservation() {
591
 
601
 
Line 592... Line 602...
592
		Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getText());	
602
		Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getRawValue());	
Line 593... Line 603...
593
		observationMediateur.ajouterObservation(obs);
603
		observationMediateur.ajouterObservation(obs);
594
	}
604
	}
Line 595... Line 605...
595
	
605
	
-
 
606
	private void modifierObservation() {
-
 
607
		
-
 
608
		Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getRawValue());	
-
 
609
		observationMediateur.modifierObservation(obs,numeroOrdre);
-
 
610
		
Line 596... Line 611...
596
	private void modifierObservation() {
611
	}
597
		
612
	
598
		Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getText());	
613
	private void supprimerObservation() {
Line 599... Line 614...
599
		observationMediateur.modifierObservation(obs,numeroOrdre);
614
		
600
		
615
			observationMediateur.supprimerObservation(this, numeroOrdre);
601
	}
616
	}
602
 
617
 
603
	
618
	
604
	public void afficherDetailsObservation(Observation obs)
619
	public void afficherDetailsObservation(Observation obs)
605
	{
620
	{
606
		viderChampsObservation() ;
621
		viderChampsObservation() ;
Line 659... Line 674...
659
	{
674
	{
660
		if(mode.equals("true")) {
675
		if(mode.equals("true")) {
Line 661... Line 676...
661
 
676
 
662
			boutonOK.setText("Modifier") ;
677
			boutonOK.setText("Modifier") ;
-
 
678
			setTitle("Modification") ;
663
			setTitle("Modification") ;
679
			boutonAnnuler.setText("Supprimer") ;
664
			modification = true ;
680
			modification = true ;
665
		}
681
		}
666
		else
682
		else
Line 667... Line 683...
667
		{
683
		{
668
 
684
 
-
 
685
			boutonOK.setText("Créer") ;
669
			boutonOK.setText("Créer") ;
686
			setTitle("Saisir") ;
670
			setTitle("Saisir") ;
687
			boutonAnnuler.setText("Réinitialiser") ;
Line 671... Line 688...
671
			modification = false ;
688
			modification = false ;