Subversion Repositories eFlore/Applications.del

Rev

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

Rev 73 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
 
Line 3... Line 3...
3
import java.util.List;
3
import java.util.List;
4
 
4
 
5
import org.tela_botanica.del.client.cache.CacheClient;
5
import org.tela_botanica.del.client.cache.CacheClient;
6
import org.tela_botanica.del.client.modeles.Observation;
6
import org.tela_botanica.del.client.modeles.Image;
Line 7... Line 7...
7
import org.tela_botanica.del.client.modeles.ObservationValidation;
7
import org.tela_botanica.del.client.modeles.VoteProtocole;
8
import org.tela_botanica.del.client.utils.MockDatasource;
8
import org.tela_botanica.del.client.utils.MockDatasource;
9
 
9
 
Line 17... Line 17...
17
 
17
 
Line 18... Line 18...
18
	private final MockDatasource observationService = MockDatasource.getInstance();
18
	private final MockDatasource observationService = MockDatasource.getInstance();
Line 19... Line 19...
19
 
19
 
Line 20... Line 20...
20
	private final MockDatasource validationService = MockDatasource.getInstance();
20
	private final MockDatasource validationService = MockDatasource.getInstance();
Line 21... Line 21...
21
 
21
 
Line 22... Line 22...
22
	private Observation observationPrincipale;
22
	private Image imagePrincipale;
23
 
23
 
24
	private String nomTaxonComparaison;
24
	private String nomTaxonComparaison;
25
 
25
 
Line 26... Line 26...
26
	private List<Observation> observationsEflore;
26
	private List<org.tela_botanica.del.client.modeles.Image> imagesEflore;
27
 
27
 
28
	public ComparaisonEflorePresenteur() {
28
	public ComparaisonEflorePresenteur() {
29
		this.observationPrincipale = CacheClient.getInstance().getCurrentObservation();
29
		this.imagePrincipale = CacheClient.getInstance().getImageCourante();
30
		this.nomTaxonComparaison = CacheClient.getInstance().getTaxonPourRechercheEflore();
30
		this.nomTaxonComparaison = CacheClient.getInstance().getTaxonPourRechercheEflore();
31
	}
31
	}
32
 
32
 
Line 33... Line 33...
33
	public void go(HasWidgets composite) {
33
	public void go(HasWidgets composite) {
34
		composite.add(vue);
34
		composite.add(vue);
35
		chargerValidationObservationPrincipale();
35
		chargerValidationObservationPrincipale();
36
		vue.chargerImagePrincipale(observationPrincipale);
36
		vue.chargerImagePrincipale(imagePrincipale);
Line 37... Line 37...
37
		chargerObservationsEflore();
37
		chargerObservationsEflore();
38
		gererEvenements();
38
		gererEvenements();
39
	}
39
	}
40
 
40
 
Line 41... Line 41...
41
	private void chargerValidationObservationPrincipale() {
41
	private void chargerValidationObservationPrincipale() {
42
		List<ObservationValidation> observationValidations = validationService.getValidationData(observationPrincipale.getIdImage());
42
		List<VoteProtocole> observationValidations = validationService.getValidationData(imagePrincipale.getIdImage());
Line 43... Line 43...
43
		observationPrincipale.setImageCelValidationDatas(observationValidations);
43
		imagePrincipale.setVoteProtocoles(observationValidations);
44
	}
44
	}
45
 
45
 
46
	private void chargerObservationsEflore() {
46
	private void chargerObservationsEflore() {
47
		observationsEflore = observationService.getObservationsEfloreParTaxon(nomTaxonComparaison);
47
		imagesEflore = observationService.getImagesEfloreParTaxon(nomTaxonComparaison);
Line 48... Line 48...
48
		vue.chargerImagesEflore(observationsEflore, 0);
48
		vue.chargerImagesEflore(imagesEflore, 0);
Line 49... Line 49...
49
	}
49
	}
50
 
50
 
51
	private void gererEvenements() {
51
	private void gererEvenements() {
52
		vue.getScrollLeftImage().addClickHandler(new ClickHandler() {
52
		vue.getScrollLeftImage().addClickHandler(new ClickHandler() {
53
 
53
 
54
			@Override
54
			@Override
Line 55... Line 55...
55
			public void onClick(ClickEvent event) {
55
			public void onClick(ClickEvent event) {