Line 1... |
Line 1... |
1 |
package org.tela_botanica.del.client.gestionhistorique;
|
1 |
package org.tela_botanica.del.client.gestionhistorique;
|
Line 2... |
Line 2... |
2 |
|
2 |
|
- |
|
3 |
import org.tela_botanica.del.client.cache.CacheClient;
|
- |
|
4 |
import org.tela_botanica.del.client.composants.formulaires.identification.FormulaireIdentificationPresenteur;
|
3 |
import org.tela_botanica.del.client.cache.CacheClient;
|
5 |
import org.tela_botanica.del.client.composants.formulaires.identification.FormulaireIdentificationVue;
|
4 |
import org.tela_botanica.del.client.services.rest.ImageServiceConcret;
|
6 |
import org.tela_botanica.del.client.services.rest.ImageServiceConcret;
|
5 |
import org.tela_botanica.del.client.services.rest.ObservationServiceConcret;
|
7 |
import org.tela_botanica.del.client.services.rest.ObservationServiceConcret;
|
- |
|
8 |
import org.tela_botanica.del.client.services.rest.ProtocoleServiceConcret;
|
6 |
import org.tela_botanica.del.client.services.rest.ProtocoleServiceConcret;
|
9 |
import org.tela_botanica.del.client.services.rest.UtilisateurServiceConcret;
|
7 |
import org.tela_botanica.del.client.vues.comparaisoneflore.ComparaisonEflorePresenteur;
|
10 |
import org.tela_botanica.del.client.vues.comparaisoneflore.ComparaisonEflorePresenteur;
|
8 |
import org.tela_botanica.del.client.vues.comparaisoneflore.ComparaisonEfloreVue;
|
11 |
import org.tela_botanica.del.client.vues.comparaisoneflore.ComparaisonEfloreVue;
|
9 |
import org.tela_botanica.del.client.vues.plateformedetermination.DeterminationPresenteur;
|
12 |
import org.tela_botanica.del.client.vues.plateformedetermination.DeterminationPresenteur;
|
10 |
import org.tela_botanica.del.client.vues.plateformedetermination.DeterminationVue;
|
13 |
import org.tela_botanica.del.client.vues.plateformedetermination.DeterminationVue;
|
11 |
import org.tela_botanica.del.client.vues.rechercheimages.moteur.MoteurRechercheImagePresenteur;
|
14 |
import org.tela_botanica.del.client.vues.rechercheimages.moteur.MoteurRechercheImagePresenteur;
|
12 |
import org.tela_botanica.del.client.vues.rechercheimages.moteur.MoteurRechercheImageVue;
|
15 |
import org.tela_botanica.del.client.vues.rechercheimages.moteur.MoteurRechercheImageVue;
|
13 |
import org.tela_botanica.del.client.vues.rechercheobservations.moteur.MoteurRechercheObservationsPresenteur;
|
16 |
import org.tela_botanica.del.client.vues.rechercheobservations.moteur.MoteurRechercheObservationsPresenteur;
|
14 |
import org.tela_botanica.del.client.vues.rechercheobservations.moteur.MoteurRechercheObservationsVue;
|
- |
|
Line 15... |
Line 17... |
15 |
import org.tela_botanica.del.client.vues.vueinitiale.PresenteurInitial;
|
17 |
import org.tela_botanica.del.client.vues.rechercheobservations.moteur.MoteurRechercheObservationsVue;
|
16 |
|
18 |
|
- |
|
19 |
import com.google.gwt.event.logical.shared.ValueChangeEvent;
|
17 |
import com.google.gwt.event.logical.shared.ValueChangeEvent;
|
20 |
import com.google.gwt.event.logical.shared.ValueChangeHandler;
|
Line 18... |
Line 21... |
18 |
import com.google.gwt.event.logical.shared.ValueChangeHandler;
|
21 |
import com.google.gwt.user.client.ui.Panel;
|
19 |
import com.google.gwt.user.client.ui.RootPanel;
|
22 |
import com.google.gwt.user.client.ui.RootPanel;
|
20 |
|
23 |
|
Line 28... |
Line 31... |
28 |
* Évènement lorsque l'historique change. L'action par défaut affiche la
|
31 |
* Évènement lorsque l'historique change. L'action par défaut affiche la
|
29 |
* page d'accueil.
|
32 |
* page d'accueil.
|
30 |
* */
|
33 |
* */
|
31 |
public void onValueChange(ValueChangeEvent<String> event) {
|
34 |
public void onValueChange(ValueChangeEvent<String> event) {
|
Line -... |
Line 35... |
- |
|
35 |
|
- |
|
36 |
//1. définition des variables
|
- |
|
37 |
String eventValue = event.getValue();
|
- |
|
38 |
Panel contenu = RootPanel.get("contenu");
|
- |
|
39 |
Panel zoneIdentification = RootPanel.get("zoneIdentification");
|
- |
|
40 |
CacheClient cache = CacheClient.getInstance();
|
- |
|
41 |
|
- |
|
42 |
//2. nettoyer le contenu
|
32 |
|
43 |
contenu.clear();
|
- |
|
44 |
zoneIdentification.clear();
|
- |
|
45 |
|
33 |
RootPanel.get("navigation").clear();
|
46 |
FormulaireIdentificationPresenteur presenteurIdentification = new FormulaireIdentificationPresenteur(new FormulaireIdentificationVue(), new UtilisateurServiceConcret());
|
34 |
new PresenteurInitial().go(RootPanel.get("navigation"));
|
47 |
presenteurIdentification.go(zoneIdentification);
|
- |
|
48 |
|
35 |
|
49 |
//Actions en fonction de la valeur de l'évènement
|
36 |
if (event.getValue().equals(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) {
|
50 |
if (eventValue.equals(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) {
|
37 |
CacheClient.getInstance().setHome(ConstantesNavigation.PAGE_RECHERCHE_IMAGES);
|
51 |
cache.setHome(ConstantesNavigation.PAGE_RECHERCHE_IMAGES);
|
38 |
RootPanel.get("contenu").clear();
|
- |
|
39 |
new MoteurRechercheImagePresenteur(new MoteurRechercheImageVue(), new ProtocoleServiceConcret()).go(RootPanel.get("contenu"));
|
52 |
lancerMoteurRechercheImages(contenu);
|
40 |
} else if (event.getValue().contains(ConstantesNavigation.PAGE_VALIDATION)) {
|
- |
|
41 |
RootPanel.get("contenu").clear();
|
53 |
} else if (eventValue.contains(ConstantesNavigation.PAGE_VALIDATION)) {
|
- |
|
54 |
DeterminationPresenteur presenteur = new DeterminationPresenteur(new DeterminationVue(), new ObservationServiceConcret(), new ProtocoleServiceConcret());
|
42 |
new DeterminationPresenteur(new DeterminationVue(), new ObservationServiceConcret(), new ProtocoleServiceConcret()).go(RootPanel.get("contenu"));
|
55 |
presenteur.go(contenu);
|
43 |
} else if (event.getValue().equals(ConstantesNavigation.PAGE_COMPARAISON_EFLORE)) {
|
- |
|
44 |
RootPanel.get("contenu").clear();
|
56 |
} else if (eventValue.equals(ConstantesNavigation.PAGE_COMPARAISON_EFLORE)) {
|
- |
|
57 |
ComparaisonEflorePresenteur presenteur = new ComparaisonEflorePresenteur(new ComparaisonEfloreVue(), new ImageServiceConcret());
|
45 |
new ComparaisonEflorePresenteur(new ComparaisonEfloreVue(), new ImageServiceConcret()).go(RootPanel.get("contenu"));
|
58 |
presenteur.go(contenu);
|
46 |
} else if (event.getValue().equals(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS)) {
|
59 |
} else if (eventValue.equals(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS)) {
|
47 |
CacheClient.getInstance().setHome(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS);
|
- |
|
48 |
RootPanel.get("contenu").clear();
|
- |
|
49 |
MoteurRechercheObservationsPresenteur presenteur = new MoteurRechercheObservationsPresenteur(new ObservationServiceConcret(), new MoteurRechercheObservationsVue());
|
60 |
cache.setHome(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS);
|
50 |
presenteur.go(RootPanel.get("contenu"));
|
61 |
lancerMoteurRechercheObservation(contenu);
|
51 |
} else if (event.getValue().equals(ConstantesNavigation.HOME)) {
|
62 |
} else if (eventValue.equals(ConstantesNavigation.HOME)) {
|
52 |
String home = CacheClient.getInstance().getHome();
|
63 |
String home = cache.getHome();
|
53 |
if (home.equals(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) {
|
64 |
if (home.equals(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) {
|
54 |
RootPanel.get("contenu").clear();
|
- |
|
55 |
new MoteurRechercheImagePresenteur(new MoteurRechercheImageVue(), new ProtocoleServiceConcret()).go(RootPanel.get("contenu"));
|
65 |
lancerMoteurRechercheImages(contenu);
|
56 |
} else {
|
- |
|
57 |
RootPanel.get("contenu").clear();
|
- |
|
58 |
MoteurRechercheObservationsPresenteur presenteur = new MoteurRechercheObservationsPresenteur(new ObservationServiceConcret(), new MoteurRechercheObservationsVue());
|
66 |
} else {
|
59 |
presenteur.go(RootPanel.get("contenu"));
|
67 |
lancerMoteurRechercheObservation(contenu);
|
60 |
}
|
68 |
}
|
61 |
}
|
69 |
}
|
62 |
else{
|
- |
|
63 |
RootPanel.get("contenu").clear();
|
- |
|
64 |
MoteurRechercheObservationsPresenteur presenteur = new MoteurRechercheObservationsPresenteur(new ObservationServiceConcret(), new MoteurRechercheObservationsVue());
|
70 |
else{
|
65 |
presenteur.go(RootPanel.get("contenu"));
|
71 |
lancerMoteurRechercheObservation(contenu);
|
66 |
}
|
72 |
}
|
- |
|
73 |
}
|
- |
|
74 |
|
- |
|
75 |
/**
|
- |
|
76 |
* Générer la page de recherche observation et l'afficher dans panneau
|
- |
|
77 |
* @param Panel panneau le panneau pour afficher le résultat
|
- |
|
78 |
* */
|
- |
|
79 |
public void lancerMoteurRechercheObservation(Panel panneau) {
|
- |
|
80 |
MoteurRechercheObservationsPresenteur presenteur = new MoteurRechercheObservationsPresenteur(new ObservationServiceConcret(), new MoteurRechercheObservationsVue());
|
- |
|
81 |
presenteur.go(panneau);
|
- |
|
82 |
}
|
- |
|
83 |
|
- |
|
84 |
/**
|
- |
|
85 |
* Générer la page de recherche images et l'afficher dans panneau
|
- |
|
86 |
* @param Panel panneau le panneau pour afficher le résultat
|
- |
|
87 |
* */
|
- |
|
88 |
public void lancerMoteurRechercheImages(Panel panneau) {
|
- |
|
89 |
MoteurRechercheImagePresenteur presenteur = new MoteurRechercheImagePresenteur(new MoteurRechercheImageVue(), new ProtocoleServiceConcret());
|
- |
|
90 |
presenteur.go(panneau);
|
67 |
}
|
91 |
}
|
68 |
}
|
92 |
}
|