Subversion Repositories eFlore/Applications.del

Rev

Rev 87 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 87 Rev 148
Line 1... Line 1...
1
package org.tela_botanica.del.client.vues.comparaisoneflore;
1
package org.tela_botanica.del.client.vues.comparaisoneflore;
Line 2... Line 2...
2
 
2
 
3
import java.util.Date;
3
import java.util.Date;
Line 4... Line 4...
4
import java.util.List;
4
import java.util.List;
5
 
-
 
Line 6... Line 5...
6
import org.tela_botanica.del.client.modeles.Observation;
5
 
7
import org.tela_botanica.del.client.modeles.ObservationValidation;
6
import org.tela_botanica.del.client.modeles.VoteProtocole;
8
 
7
 
9
import com.google.gwt.core.client.GWT;
8
import com.google.gwt.core.client.GWT;
Line 45... Line 44...
45
 
44
 
46
	public ComparaisonEfloreVue() {
45
	public ComparaisonEfloreVue() {
47
		initWidget(uiBinder.createAndBindUi(this));
46
		initWidget(uiBinder.createAndBindUi(this));
Line 48... Line 47...
48
	}
47
	}
Line 49... Line 48...
49
 
48
 
50
	protected void chargerImagePrincipale(Observation observationPrincipale) {
49
	protected void chargerImagePrincipale(org.tela_botanica.del.client.modeles.Image image) {
51
 
50
 
52
		// mots clefs
51
		// mots clefs
53
		String motsClefsConcatenes = "";
52
		String motsClefsConcatenes = "";
54
		for (String motClef : observationPrincipale.getMotsClefs()) {
53
		for (String motClef : image.getObservation().getMotsClefs()) {
Line 55... Line 54...
55
			motsClefsConcatenes += motClef + ",";
54
			motsClefsConcatenes += motClef + ",";
56
		}
55
		}
57
		motsClefsConcatenes = motsClefsConcatenes.subSequence(0, motsClefsConcatenes.lastIndexOf(",")).toString();
56
		motsClefsConcatenes = motsClefsConcatenes.subSequence(0, motsClefsConcatenes.lastIndexOf(",")).toString();
58
 
57
 
59
		// validateurs
58
		// validateurs
60
		String validateursConcatenes = "";
59
		String validateursConcatenes = "";
Line 61... Line 60...
61
		for (ObservationValidation observationValidation : observationPrincipale.getImageCelValidationDatas()) {
60
		for (VoteProtocole observationValidation : image.getVoteProtocoles()) {
62
			validateursConcatenes += observationValidation.getContributeur() + ", ";
61
			validateursConcatenes += observationValidation.getContributeur() + ", ";
63
		}
62
		}
64
		validateursConcatenes = validateursConcatenes.subSequence(0, validateursConcatenes.lastIndexOf(",")).toString();
63
		validateursConcatenes = validateursConcatenes.subSequence(0, validateursConcatenes.lastIndexOf(",")).toString();
65
 
64
 
66
		// date derniere validation
65
		// date derniere validation
67
		Date dateDerniereValidation = null;
66
		Date dateDerniereValidation = null;
68
		for (ObservationValidation observationValidation : observationPrincipale.getImageCelValidationDatas()) {
67
		for (VoteProtocole observationValidation : image.getVoteProtocoles()) {
69
			if (dateDerniereValidation == null) {
68
			if (dateDerniereValidation == null) {
Line 70... Line 69...
70
				dateDerniereValidation = observationValidation.getDate();
69
				dateDerniereValidation = observationValidation.getDate();
71
			} else if (dateDerniereValidation.before(observationValidation.getDate())) {
70
			} else if (dateDerniereValidation.before(observationValidation.getDate())) {
72
				dateDerniereValidation = observationValidation.getDate();
71
				dateDerniereValidation = observationValidation.getDate();
73
			}
72
			}
74
		}
73
		}
75
 
74
 
76
		motsClefs.setText(motsClefsConcatenes);
75
		motsClefs.setText(motsClefsConcatenes);
Line 77... Line 76...
77
		nomAuteur.setText(observationPrincipale.getAuteur());
76
		nomAuteur.setText(image.getObservation().getAuteur());
Line 78... Line 77...
78
		imagePrincipale.setUrl(observationPrincipale.getUrl());
77
		imagePrincipale.setUrl(image.getUrl());
Line 79... Line 78...
79
		dateObservation.setText(observationPrincipale.getDate());
78
		dateObservation.setText(image.getObservation().getDate());
80
		famille.setText(observationPrincipale.getFamille());
79
		famille.setText(image.getObservation().getFamille());
81
		validateurs.setText(validateursConcatenes);
80
		validateurs.setText(validateursConcatenes);
Line 82... Line 81...
82
		dateValidation.setText(DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT).format(dateDerniereValidation));
81
		dateValidation.setText(DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT).format(dateDerniereValidation));
Line 83... Line 82...
83
 
82
 
84
	}
83
	}
85
 
84
 
86
	protected void chargerImagesEflore(List<Observation> observationsEflore, int indexImage) {
85
	protected void chargerImagesEflore(List<org.tela_botanica.del.client.modeles.Image> observationsEflore, int indexImage) {
87
 
86
 
Line 88... Line 87...
88
		if (indexImage >= 0 && indexImage < observationsEflore.size()) {
87
		if (indexImage >= 0 && indexImage < observationsEflore.size()) {
Line 89... Line 88...
89
			currentIndexImages = indexImage;
88
			currentIndexImages = indexImage;
90
		}
89
		}