1,9 → 1,12 |
package org.tela_botanica.del.client.gestionhistorique; |
|
import org.tela_botanica.del.client.cache.CacheClient; |
import org.tela_botanica.del.client.composants.formulaires.identification.FormulaireIdentificationPresenteur; |
import org.tela_botanica.del.client.composants.formulaires.identification.FormulaireIdentificationVue; |
import org.tela_botanica.del.client.services.rest.ImageServiceConcret; |
import org.tela_botanica.del.client.services.rest.ObservationServiceConcret; |
import org.tela_botanica.del.client.services.rest.ProtocoleServiceConcret; |
import org.tela_botanica.del.client.services.rest.UtilisateurServiceConcret; |
import org.tela_botanica.del.client.vues.comparaisoneflore.ComparaisonEflorePresenteur; |
import org.tela_botanica.del.client.vues.comparaisoneflore.ComparaisonEfloreVue; |
import org.tela_botanica.del.client.vues.plateformedetermination.DeterminationPresenteur; |
12,10 → 15,10 |
import org.tela_botanica.del.client.vues.rechercheimages.moteur.MoteurRechercheImageVue; |
import org.tela_botanica.del.client.vues.rechercheobservations.moteur.MoteurRechercheObservationsPresenteur; |
import org.tela_botanica.del.client.vues.rechercheobservations.moteur.MoteurRechercheObservationsVue; |
import org.tela_botanica.del.client.vues.vueinitiale.PresenteurInitial; |
|
import com.google.gwt.event.logical.shared.ValueChangeEvent; |
import com.google.gwt.event.logical.shared.ValueChangeHandler; |
import com.google.gwt.user.client.ui.Panel; |
import com.google.gwt.user.client.ui.RootPanel; |
|
/** |
30,39 → 33,60 |
* */ |
public void onValueChange(ValueChangeEvent<String> event) { |
|
RootPanel.get("navigation").clear(); |
new PresenteurInitial().go(RootPanel.get("navigation")); |
|
if (event.getValue().equals(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) { |
CacheClient.getInstance().setHome(ConstantesNavigation.PAGE_RECHERCHE_IMAGES); |
RootPanel.get("contenu").clear(); |
new MoteurRechercheImagePresenteur(new MoteurRechercheImageVue(), new ProtocoleServiceConcret()).go(RootPanel.get("contenu")); |
} else if (event.getValue().contains(ConstantesNavigation.PAGE_VALIDATION)) { |
RootPanel.get("contenu").clear(); |
new DeterminationPresenteur(new DeterminationVue(), new ObservationServiceConcret(), new ProtocoleServiceConcret()).go(RootPanel.get("contenu")); |
} else if (event.getValue().equals(ConstantesNavigation.PAGE_COMPARAISON_EFLORE)) { |
RootPanel.get("contenu").clear(); |
new ComparaisonEflorePresenteur(new ComparaisonEfloreVue(), new ImageServiceConcret()).go(RootPanel.get("contenu")); |
} else if (event.getValue().equals(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS)) { |
CacheClient.getInstance().setHome(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS); |
RootPanel.get("contenu").clear(); |
MoteurRechercheObservationsPresenteur presenteur = new MoteurRechercheObservationsPresenteur(new ObservationServiceConcret(), new MoteurRechercheObservationsVue()); |
presenteur.go(RootPanel.get("contenu")); |
} else if (event.getValue().equals(ConstantesNavigation.HOME)) { |
String home = CacheClient.getInstance().getHome(); |
//1. définition des variables |
String eventValue = event.getValue(); |
Panel contenu = RootPanel.get("contenu"); |
Panel zoneIdentification = RootPanel.get("zoneIdentification"); |
CacheClient cache = CacheClient.getInstance(); |
|
//2. nettoyer le contenu |
contenu.clear(); |
zoneIdentification.clear(); |
|
FormulaireIdentificationPresenteur presenteurIdentification = new FormulaireIdentificationPresenteur(new FormulaireIdentificationVue(), new UtilisateurServiceConcret()); |
presenteurIdentification.go(zoneIdentification); |
|
//Actions en fonction de la valeur de l'évènement |
if (eventValue.equals(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) { |
cache.setHome(ConstantesNavigation.PAGE_RECHERCHE_IMAGES); |
lancerMoteurRechercheImages(contenu); |
} else if (eventValue.contains(ConstantesNavigation.PAGE_VALIDATION)) { |
DeterminationPresenteur presenteur = new DeterminationPresenteur(new DeterminationVue(), new ObservationServiceConcret(), new ProtocoleServiceConcret()); |
presenteur.go(contenu); |
} else if (eventValue.equals(ConstantesNavigation.PAGE_COMPARAISON_EFLORE)) { |
ComparaisonEflorePresenteur presenteur = new ComparaisonEflorePresenteur(new ComparaisonEfloreVue(), new ImageServiceConcret()); |
presenteur.go(contenu); |
} else if (eventValue.equals(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS)) { |
cache.setHome(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS); |
lancerMoteurRechercheObservation(contenu); |
} else if (eventValue.equals(ConstantesNavigation.HOME)) { |
String home = cache.getHome(); |
if (home.equals(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) { |
RootPanel.get("contenu").clear(); |
new MoteurRechercheImagePresenteur(new MoteurRechercheImageVue(), new ProtocoleServiceConcret()).go(RootPanel.get("contenu")); |
lancerMoteurRechercheImages(contenu); |
} else { |
RootPanel.get("contenu").clear(); |
MoteurRechercheObservationsPresenteur presenteur = new MoteurRechercheObservationsPresenteur(new ObservationServiceConcret(), new MoteurRechercheObservationsVue()); |
presenteur.go(RootPanel.get("contenu")); |
lancerMoteurRechercheObservation(contenu); |
} |
} |
else{ |
RootPanel.get("contenu").clear(); |
MoteurRechercheObservationsPresenteur presenteur = new MoteurRechercheObservationsPresenteur(new ObservationServiceConcret(), new MoteurRechercheObservationsVue()); |
presenteur.go(RootPanel.get("contenu")); |
lancerMoteurRechercheObservation(contenu); |
} |
} |
|
/** |
* Générer la page de recherche observation et l'afficher dans panneau |
* @param Panel panneau le panneau pour afficher le résultat |
* */ |
public void lancerMoteurRechercheObservation(Panel panneau) { |
MoteurRechercheObservationsPresenteur presenteur = new MoteurRechercheObservationsPresenteur(new ObservationServiceConcret(), new MoteurRechercheObservationsVue()); |
presenteur.go(panneau); |
} |
|
/** |
* Générer la page de recherche images et l'afficher dans panneau |
* @param Panel panneau le panneau pour afficher le résultat |
* */ |
public void lancerMoteurRechercheImages(Panel panneau) { |
MoteurRechercheImagePresenteur presenteur = new MoteurRechercheImagePresenteur(new MoteurRechercheImageVue(), new ProtocoleServiceConcret()); |
presenteur.go(panneau); |
} |
} |