15,6 → 15,7 |
import org.tela_botanica.del.client.composants.observations.ObservationImagesPresenteur; |
import org.tela_botanica.del.client.composants.observations.ObservationImagesVue; |
import org.tela_botanica.del.client.composants.presenteur.Presenteur; |
import org.tela_botanica.del.client.modeles.Image; |
import org.tela_botanica.del.client.modeles.ModeRecherche; |
import org.tela_botanica.del.client.modeles.MoyenneVote; |
import org.tela_botanica.del.client.modeles.Observation; |
27,6 → 28,8 |
import org.tela_botanica.del.client.navigation.evenement.ajoutcommentaire.GestionnaireEvenementAjoutCommentaire; |
import org.tela_botanica.del.client.navigation.evenement.ajoutdetermination.EvenementAjoutDetermination; |
import org.tela_botanica.del.client.navigation.evenement.ajoutdetermination.GestionnaireEvenementAjoutDetermination; |
import org.tela_botanica.del.client.navigation.evenement.changementimagevalidation.EvenementChangementImageValidation; |
import org.tela_botanica.del.client.navigation.evenement.changementimagevalidation.GestionnaireEvenementChangementImageValidation; |
import org.tela_botanica.del.client.navigation.evenement.voteDetermination.EvenementVoteDetermination; |
import org.tela_botanica.del.client.navigation.evenement.voteDetermination.GestionnaireEvenementVoteDetermination; |
import org.tela_botanica.del.client.services.CalculVoteDeterminationService; |
57,15 → 60,25 |
* */ |
public interface Vue extends IsWidget { |
public Panel getForum(); |
|
public Panel getDetailImageObservation(); |
|
public Panel getFormulaireRechercheEflore(); |
|
public Panel getVoteProtocole(); |
|
public Button getBoutonAjoutProposition(); |
|
public Button getBoutonAjoutCommentaire(); |
|
public Button getBoutonAjoutPropositionBas(); |
|
public Button getBoutonAjoutCommentaireBas(); |
|
public HasWidgets getMetadonnees(); |
|
public HasWidgets getNouvelleLigneProtocole(); |
|
public void afficherNomTaxonProbable(String nomTaxon); |
} |
|
78,7 → 91,6 |
|
private CacheClient cache = CacheClient.getInstance(); |
|
|
public DeterminationPresenteur(Vue vue, ObservationService observationService, ProtocoleService protocoleService) { |
this.vue = vue; |
this.protocoleService = protocoleService; |
87,18 → 99,25 |
|
public void go(final HasWidgets composite) { |
|
// TODO afficher une icone de chargement si le chargement devient trop long |
// TODO afficher une icone de chargement si le chargement devient trop |
// long |
// car tout l'écran est asynchrone ici |
Observation observationCourante = cache.getObservationCourante(); |
final Observation observationCourante = cache.getObservationCourante(); |
observationService.getObservation(observationCourante.getId(), new ObservationsCallback() { |
|
@Override |
public void surRetour(ObservationServiceResultat objetRetour) { |
cache.setImageCourante(cache.getObservationCourante().getImages().get(0)); |
|
// trouve l'image courante si elle n'est pas deja en cache |
List<Image> listeImages = cache.getObservationCourante().getImages(); |
if (listeImages.size() > 0) { |
CacheClient.getInstance().setImageCourante(listeImages.get(0)); |
} else { |
CacheClient.getInstance().setImageCourante(null); |
} |
|
new MetadonneesPresenteur(new MetadonneesEnLigneVue(), cache.getObservationCourante(), ModeRecherche.MODE_OBSERVATION).go(vue.getMetadonnees()); |
new ObservationImagesPresenteur(new ObservationImagesVue(), cache.getObservationCourante()).go(vue.getDetailImageObservation()); |
|
new ObservationImagesPresenteur(new ObservationImagesVue(), cache.getObservationCourante(), CacheClient.getInstance().getImageCourante()).go(vue.getDetailImageObservation()); |
chargerEtAjouterLignesVotesProtocole(); |
new ForumPresenteur(new ForumVue()).go(vue.getForum()); |
new FormulaireRechercheEflorePresenteur().go(vue.getFormulaireRechercheEflore()); |
200,5 → 219,16 |
} |
} |
}); |
|
BusEvenementiel.getInstance().addHandler(EvenementChangementImageValidation.TYPE, new GestionnaireEvenementChangementImageValidation() { |
|
@Override |
public void onChangementImage(EvenementChangementImageValidation event) { |
vue.getDetailImageObservation().clear(); |
vue.getVoteProtocole().clear(); |
new ObservationImagesPresenteur(new ObservationImagesVue(), cache.getObservationCourante(), CacheClient.getInstance().getImageCourante()).go(vue.getDetailImageObservation()); |
chargerEtAjouterLignesVotesProtocole(); |
} |
}); |
} |
} |