Subversion Repositories eFlore/Applications.cel

Rev

Rev 2276 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2276 Rev 2553
Line 1... Line 1...
1
package org.tela_botanica.client.vues.observation;
1
package org.tela_botanica.client.vues.observation;
Line -... Line 2...
-
 
2
 
2
 
3
import org.tela_botanica.client.cel2;
3
import org.tela_botanica.client.interfaces.Rafraichissable;
4
import org.tela_botanica.client.interfaces.Rafraichissable;
4
import org.tela_botanica.client.modeles.objets.EntiteGeographiqueObservation;
5
import org.tela_botanica.client.modeles.objets.EntiteGeographiqueObservation;
5
import org.tela_botanica.client.observation.ObservationMediateur;
6
import org.tela_botanica.client.observation.ObservationMediateur;
Line 36... Line 37...
36
	private ObservationMediateur oMediateur = null;
37
	private ObservationMediateur oMediateur = null;
Line 37... Line 38...
37
	
38
	
38
	Panel panneauCarto = null;
39
	Panel panneauCarto = null;
39
	GoogleMap map = null;
40
	GoogleMap map = null;
40
	Marker nmk = null;
41
	Marker nmk = null;
41
	
42
 
42
	private boolean carteAjoutee = false;
43
	private boolean carteAjoutee = false;
43
	private boolean infoOuverte = false;
44
	private boolean infoOuverte = false;
44
	
45
 
45
	String valeurCommune = "Bourges"; // j'aurais préféré Bort-les-Orgues
46
	String valeurCommune = "Bourges"; // j'aurais préféré Bort-les-Orgues
46
	LatLng centreFrance = null;
47
	LatLng centreFrance = null;
47
	LatLng pointCommune = null;
48
	LatLng pointCommune = null;
48
	String codeCommune = "";
49
	String codeCommune = "";
49
	
50
 
Line 50... Line 51...
50
	int niveauZoom = 6;
51
	int niveauZoom = 6;
51
 
52
 
Line 56... Line 57...
56
	private boolean zoomerSurRetour = false;
57
	private boolean zoomerSurRetour = false;
Line 57... Line 58...
57
 
58
 
Line 58... Line 59...
58
	public CartographieObservationVue(ObservationMediateur om) {
59
	public CartographieObservationVue(ObservationMediateur om) {
59
 
60
 
60
		oMediateur = om;
61
		oMediateur = om;
61
		
62
 
62
		setHeader(false);
63
		setHeader(false);
Line 63... Line 64...
63
		setAutoWidth(true);
64
		setAutoWidth(true);
64
		setPaddings(10);
65
		setPaddings(10);
Line 65... Line 66...
65
 
66
 
66
		panneauCarto = new Panel();
67
		panneauCarto = new Panel();
67
		panneauCarto.setLayout(new FitLayout());
68
		panneauCarto.setLayout(new FitLayout());
68
 
69
 
69
		setLayout(new RowLayout());
70
		setLayout(new RowLayout());
70
		
71
 
71
		panneauCarto.setAutoHeight(true);
72
		panneauCarto.setAutoHeight(true);
72
		add(panneauExplication, new RowLayoutData(12));
-
 
73
		add(panneauCarto, new RowLayoutData());
73
		add(panneauExplication, new RowLayoutData(12));
74
								
74
		add(panneauCarto, new RowLayoutData());
75
		addListener(new ContainerListenerAdapter() {
75
 
76
			
76
		addListener(new ContainerListenerAdapter() {
77
			@Override
77
			@Override
78
			public void onAfterLayout(Container c) {
78
			public void onAfterLayout(Container c) {
79
				initialiserCarte(false);
79
				initialiserCarte(false);
80
			}
80
			}
81
		});
81
		});
82
	}
82
	}
83
	
83
 
84
	public void setTailleCarte(int hauteur, int largeur) {
84
	public void setTailleCarte(int hauteur, int largeur) {
Line 85... Line 85...
85
		setSize(largeur, hauteur);
85
		setSize(largeur, hauteur);
86
	}
86
	}
87
	
87
 
Line 218... Line 218...
218
		}
218
		}
219
	}
219
	}
Line 220... Line 220...
220
 
220
 
221
	@Override
221
	@Override
-
 
222
	public void rafraichir(Object nouvelleDonnees, boolean repandreRaffraichissement) {
-
 
223
		// rétablissement du curseur, parfois mis sur "attente" par le processus chargeant la carte
Line 222... Line 224...
222
	public void rafraichir(Object nouvelleDonnees, boolean repandreRaffraichissement) {
224
		Util.curseurParDefaut();
Line 223... Line 225...
223
 
225
 
224
		if (nouvelleDonnees instanceof String) {
226
		if (nouvelleDonnees instanceof String) {
Line 244... Line 246...
244
			LatLng coord = LatLng.create(lat, lon);
246
			LatLng coord = LatLng.create(lat, lon);
245
			// si on a un point, on zoome fort dès le début
247
			// si on a un point, on zoome fort dès le début
246
			if (zoomerSurRetour) {
248
			if (zoomerSurRetour) {
247
				niveauZoom = 16;
249
				niveauZoom = 16;
248
				zoomerSurRetour = false;
250
				zoomerSurRetour = false;
-
 
251
			} else if (infos.getZoom() > 0) {
-
 
252
				niveauZoom = infos.getZoom();
249
			}
253
			}
Line 250... Line 254...
250
 
254
 
251
			String nouvelleValeurCommune = infos.getZoneGeo();
255
			String nouvelleValeurCommune = infos.getZoneGeo();
-
 
256
			valeurCommune = nouvelleValeurCommune;
252
			valeurCommune = nouvelleValeurCommune;
257
			if (infos.getIdZoneGeo() != null) {
-
 
258
				codeCommune = Util.convertirChaineZoneGeoVersDepartement(infos.getIdZoneGeo());
-
 
259
			} else {
-
 
260
				codeCommune = "";
253
			codeCommune = Util.convertirChaineZoneGeoVersDepartement(infos.getIdZoneGeo());
261
			}
Line 254... Line 262...
254
			pointCommune = coord;
262
			pointCommune = coord;
255
			
263