Line 9... |
Line 9... |
9 |
import org.tela_botanica.del.client.composants.observations.ObservationImagesVue;
|
9 |
import org.tela_botanica.del.client.composants.observations.ObservationImagesVue;
|
10 |
import org.tela_botanica.del.client.composants.presenteur.Presenteur;
|
10 |
import org.tela_botanica.del.client.composants.presenteur.Presenteur;
|
11 |
import org.tela_botanica.del.client.modeles.Image;
|
11 |
import org.tela_botanica.del.client.modeles.Image;
|
12 |
import org.tela_botanica.del.client.modeles.ModeRecherche;
|
12 |
import org.tela_botanica.del.client.modeles.ModeRecherche;
|
13 |
import org.tela_botanica.del.client.modeles.Observation;
|
13 |
import org.tela_botanica.del.client.modeles.Observation;
|
- |
|
14 |
import org.tela_botanica.del.client.modeles.PropositionDetermination;
|
14 |
import org.tela_botanica.del.client.navigation.evenement.BusEvenementiel;
|
15 |
import org.tela_botanica.del.client.navigation.evenement.BusEvenementiel;
|
15 |
import org.tela_botanica.del.client.navigation.evenement.validationobservation.EvenementValidation;
|
16 |
import org.tela_botanica.del.client.navigation.evenement.ajoutdetermination.EvenementAjoutDetermination;
|
- |
|
17 |
import org.tela_botanica.del.client.navigation.evenement.ajoutdetermination.GestionnaireEvenementAjoutDetermination;
|
- |
|
18 |
import org.tela_botanica.del.client.composants.fenetereoverlay.FenetreOverlayDefilantePresenteur;
|
- |
|
19 |
import org.tela_botanica.del.client.composants.fenetereoverlay.FenetreOverlayDefilanteVue;
|
- |
|
20 |
import org.tela_botanica.del.client.composants.fenetereoverlay.FenetreOverlaySimplePresenteur;
|
- |
|
21 |
import org.tela_botanica.del.client.composants.formulaires.formulaireproposition.FormulairePropositionPresenteur;
|
- |
|
22 |
import org.tela_botanica.del.client.composants.formulaires.formulaireproposition.FormulairePropositionVue;
|
16 |
import org.tela_botanica.del.client.vues.rechercheobservations.resultats.observationdeterminations.ObservationDeterminationPresenteur;
|
23 |
import org.tela_botanica.del.client.vues.rechercheobservations.resultats.observationdeterminations.ObservationDeterminationPresenteur;
|
17 |
import org.tela_botanica.del.client.vues.rechercheobservations.resultats.observationdeterminations.ObservationDeterminationVue;
|
24 |
import org.tela_botanica.del.client.vues.rechercheobservations.resultats.observationdeterminations.ObservationDeterminationVue;
|
Line 18... |
Line 25... |
18 |
|
25 |
|
19 |
import com.google.gwt.event.dom.client.ClickEvent;
|
26 |
import com.google.gwt.event.dom.client.ClickEvent;
|
Line 22... |
Line 29... |
22 |
import com.google.gwt.user.client.ui.HasWidgets;
|
29 |
import com.google.gwt.user.client.ui.HasWidgets;
|
23 |
import com.google.gwt.user.client.ui.IsWidget;
|
30 |
import com.google.gwt.user.client.ui.IsWidget;
|
Line 24... |
Line 31... |
24 |
|
31 |
|
Line 25... |
Line 32... |
25 |
public class ObservationPresenteur extends Presenteur {
|
32 |
public class ObservationPresenteur extends Presenteur {
|
26 |
|
- |
|
27 |
public abstract interface Vue extends IsWidget {
|
33 |
|
28 |
|
- |
|
29 |
public HasClickHandlers getLienDeterminer();
|
34 |
public interface Vue extends IsWidget {
|
30 |
|
- |
|
31 |
public HasWidgets getDeterminationsPanel();
|
35 |
public HasClickHandlers getBoutonAjoutProposition();
|
32 |
|
- |
|
33 |
public HasWidgets getImagesPanel();
|
36 |
public HasWidgets getDeterminationsPanel();
|
34 |
|
37 |
public HasWidgets getImagesPanel();
|
Line 35... |
Line 38... |
35 |
public HasWidgets getMetadonneesPanel();
|
38 |
public HasWidgets getMetadonneesPanel();
|
Line 36... |
Line 39... |
36 |
}
|
39 |
}
|
- |
|
40 |
|
- |
|
41 |
private Vue vue;
|
Line 37... |
Line 42... |
37 |
|
42 |
|
38 |
private Vue vue;
|
43 |
private Observation observation;
|
39 |
|
44 |
|
40 |
private Observation observation;
|
45 |
private ObservationDeterminationPresenteur observationDeterminationPresenteur;
|
41 |
|
46 |
|
Line 42... |
Line 47... |
42 |
public ObservationPresenteur(Vue vue, Observation observation) {
|
47 |
public ObservationPresenteur(Vue vue, Observation observation) {
|
43 |
this.observation = observation;
|
- |
|
44 |
this.vue = vue;
|
48 |
this.observation = observation;
|
45 |
chargerObservation();
|
49 |
this.vue = vue;
|
46 |
}
|
50 |
chargerObservation();
|
- |
|
51 |
}
|
Line 47... |
Line 52... |
47 |
|
52 |
|
48 |
public void chargerObservation() {
|
- |
|
49 |
|
53 |
public void chargerObservation() {
|
Line 50... |
Line 54... |
50 |
new ObservationImagesPresenteur(new ObservationImagesVue(), observation).go(vue.getImagesPanel());
|
54 |
new ObservationImagesPresenteur(new ObservationImagesVue(), observation).go(vue.getImagesPanel());
|
51 |
new MetadonneesPresenteur(new MetadonneesVue(), observation, ModeRecherche.MODE_OBSERVATION).go(vue.getMetadonneesPanel());
|
55 |
new MetadonneesPresenteur(new MetadonneesVue(), observation, ModeRecherche.MODE_OBSERVATION).go(vue.getMetadonneesPanel());
|
52 |
new ObservationDeterminationPresenteur(new ObservationDeterminationVue(), observation.getPropositionsDetermination()).go(vue.getDeterminationsPanel());
|
56 |
observationDeterminationPresenteur = new ObservationDeterminationPresenteur(new ObservationDeterminationVue(), observation.getPropositionsDetermination());
|
Line 53... |
Line 57... |
53 |
|
57 |
observationDeterminationPresenteur.go(vue.getDeterminationsPanel());
|
- |
|
58 |
|
- |
|
59 |
gererEvenements();
|
- |
|
60 |
}
|
- |
|
61 |
|
- |
|
62 |
public void go(HasWidgets composite) {
|
- |
|
63 |
composite.add(vue.asWidget());
|
- |
|
64 |
}
|
- |
|
65 |
|
- |
|
66 |
protected void gererEvenements() {
|
- |
|
67 |
|
Line 54... |
Line 68... |
54 |
gererEvenements();
|
68 |
BusEvenementiel.getInstance().addHandler(EvenementAjoutDetermination.TYPE, new GestionnaireEvenementAjoutDetermination() {
|
55 |
|
69 |
@Override
|
56 |
}
|
70 |
public void onAjoutDetermination(EvenementAjoutDetermination event) {
|
57 |
|
71 |
if (fenetreModaleEstOuverte()) {
|
58 |
public void go(HasWidgets composite) {
|
72 |
fermerFenetreModale();
|
59 |
composite.add(vue.asWidget());
|
73 |
ajouterPropositionDetermination(event.getPropositionDetermination());
|
60 |
}
|
74 |
}
|
61 |
|
75 |
}
|
62 |
protected void gererEvenements() {
|
76 |
});
|
63 |
|
77 |
|
- |
|
78 |
vue.getBoutonAjoutProposition().addClickHandler(new ClickHandler() {
|
- |
|
79 |
@Override
|
64 |
vue.getLienDeterminer().addClickHandler(new ClickHandler() {
|
80 |
public void onClick(ClickEvent event) {
|
65 |
|
81 |
List<Image> images = observation.getImages();
|
66 |
public void onClick(ClickEvent event) {
|
82 |
if (images.size() > 0) {
|
- |
|
83 |
CacheClient.getInstance().setImageCourante(images.get(0));
|
- |
|
84 |
} else {
|
- |
|
85 |
CacheClient.getInstance().setImageCourante(null);
|
- |
|
86 |
}
|
67 |
List<Image> images = observation.getImages();
|
87 |
CacheClient.getInstance().setObservationCourante(observation);
|