1,6 → 1,7 |
package org.tela_botanica.del.client.gestionhistorique; |
|
import org.tela_botanica.del.client.cache.CacheClient; |
import org.tela_botanica.del.client.config.Config; |
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; |
17,8 → 18,10 |
import org.tela_botanica.del.client.vues.pictoflora.plateformedetermination.PictofloraDeterminationPresenteur; |
import org.tela_botanica.del.client.vues.pictoflora.plateformedetermination.PictofloraDeterminationVue; |
|
import com.google.gwt.core.shared.GWT; |
import com.google.gwt.event.logical.shared.ValueChangeEvent; |
import com.google.gwt.event.logical.shared.ValueChangeHandler; |
import com.google.gwt.user.client.Window; |
import com.google.gwt.user.client.ui.HTML; |
import com.google.gwt.user.client.ui.Panel; |
import com.google.gwt.user.client.ui.RootPanel; |
34,12 → 37,11 |
* page d'accueil. |
* */ |
public void onValueChange(ValueChangeEvent<String> event) { |
|
|
//1. définition des variables |
String eventValue = event.getValue(); |
GWT.log("Historique -> eventValue:"+eventValue); |
Panel contenu = RootPanel.get("contenu"); |
Panel zoneEntete = RootPanel.get("zoneEntete"); |
Panel zoneEntete = RootPanel.get("zoneEnteteContenu"); |
CacheClient cache = CacheClient.getInstance(); |
cache.setPageCourante(eventValue); |
|
47,78 → 49,52 |
contenu.clear(); |
zoneEntete.clear(); |
|
|
//3. Gérer le titre |
String titre = "IdentiPlante"; |
if (eventValue.startsWith(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) { |
titre = "PictoFlora"; |
} |
|
if (eventValue.startsWith(ConstantesNavigation.HOME)) { |
String home = cache.getHome(); |
if (home.startsWith(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) { |
titre = "PictoFlora"; |
} |
} |
|
if (eventValue.startsWith(ConstantesNavigation.PAGE_VALIDATION_PICTOFLORA)) { |
titre = "PictoFlora"; |
} |
|
//3. gérer l'entete |
EntetePresenteur entetePresenteur = new EntetePresenteur(new EnteteVue(titre)); |
EntetePresenteur entetePresenteur = new EntetePresenteur(new EnteteVue()); |
entetePresenteur.go(zoneEntete); |
|
//Actions en fonction de la valeur de l'évènement |
if (eventValue.startsWith(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) { |
cache.setHome(ConstantesNavigation.PAGE_RECHERCHE_IMAGES); |
lancerMoteurRechercheImages(contenu); |
} else if (eventValue.startsWith(ConstantesNavigation.PAGE_VALIDATION)) { |
IdentiplanteDeterminationPresenteur presenteur = new IdentiplanteDeterminationPresenteur(new IdentiplanteDeterminationVue(), new ObservationServiceConcret()); |
presenteur.go(contenu); |
} else if (eventValue.startsWith(ConstantesNavigation.PAGE_VALIDATION_PICTOFLORA)) { |
PictofloraDeterminationPresenteur presenteur = new PictofloraDeterminationPresenteur(new PictofloraDeterminationVue(), new ObservationServiceConcret(), new ProtocoleServiceConcret()); |
presenteur.go(contenu); |
} else if (eventValue.startsWith(ConstantesNavigation.PAGE_COMPARAISON_EFLORE)) { |
ComparaisonEflorePresenteur presenteur = new ComparaisonEflorePresenteur(new ComparaisonEfloreVue(), new ImageServiceConcret()); |
presenteur.go(contenu); |
} else if (eventValue.startsWith(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS)) { |
cache.setHome(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS); |
lancerMoteurRechercheObservation(contenu); |
} else if (eventValue.startsWith(ConstantesNavigation.HOME)) { |
String home = cache.getHome(); |
if (home.startsWith(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) { |
//Actions en fonction de la valeur de l'évènement et de l'url |
String urlCourante = Window.Location.getHref(); |
Config config = new Config(); |
String urlAppliObs = config.getUrl("identiplante"); |
String urlAppliImg = config.getUrl("pictoflora"); |
|
if (urlCourante.contains(urlAppliImg)) { |
if (eventValue.startsWith(ConstantesNavigation.PAGE_DETAIL_IMG)) { |
PictofloraDeterminationPresenteur presenteur = new PictofloraDeterminationPresenteur( |
new PictofloraDeterminationVue(), |
new ObservationServiceConcret(), |
new ProtocoleServiceConcret() |
); |
presenteur.go(contenu); |
} else { |
lancerMoteurRechercheImages(contenu); |
} |
} else if (urlCourante.contains(urlAppliObs)) { |
if (eventValue.startsWith(ConstantesNavigation.PAGE_DETAIL_OBS)) { |
IdentiplanteDeterminationPresenteur presenteur = new IdentiplanteDeterminationPresenteur( |
new IdentiplanteDeterminationVue(), |
new ObservationServiceConcret() |
); |
presenteur.go(contenu); |
} else if (eventValue.startsWith(ConstantesNavigation.PAGE_COMPARAISON_EFLORE)) { |
ComparaisonEflorePresenteur presenteur = new ComparaisonEflorePresenteur( |
new ComparaisonEfloreVue(), |
new ImageServiceConcret() |
); |
presenteur.go(contenu); |
} else { |
lancerMoteurRechercheObservation(contenu); |
} |
} |
else{ |
} else { |
lancerMoteurRechercheObservation(contenu); |
} |
|
|
// Mise à jour de l'url courante (re-écriture) |
CacheClient.getInstance().mettreAjourUrlCourante(); |
} |
|
/** |
* Afficher ler titre Identiplance |
* */ |
public void afficherTitreIdp(Panel titre) { |
titre.clear(); |
HTML html = new HTML("<h1>IdentiPlante</h1>"); |
titre.add(html); |
} |
|
/** |
* Afficher ler titre Identiplance |
* */ |
public void afficherTitrePictoFlora(Panel titre) { |
titre.clear(); |
HTML html = new HTML("<h1>PictoFlora</h1>"); |
titre.add(html); |
} |
|
/** |
* Générer la page de recherche observation et l'afficher dans panneau |
* @param Panel panneau le panneau pour afficher le résultat |
* */ |