Subversion Repositories eFlore/Applications.cel

Rev

Rev 989 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 989 Rev 1292
Line 4... Line 4...
4
import org.tela_botanica.client.modeles.objets.Configuration;
4
import org.tela_botanica.client.modeles.objets.Configuration;
5
import org.tela_botanica.client.modeles.objets.EntiteGeographiqueObservation;
5
import org.tela_botanica.client.modeles.objets.EntiteGeographiqueObservation;
6
import org.tela_botanica.client.observation.ObservationMediateur;
6
import org.tela_botanica.client.observation.ObservationMediateur;
7
import org.tela_botanica.client.util.Util;
7
import org.tela_botanica.client.util.Util;
Line 8... Line -...
8
 
-
 
9
import com.google.gwt.core.client.JavaScriptObject;
8
 
10
import com.google.gwt.maps.client.InfoWindow;
9
import com.google.gwt.maps.client.InfoWindow;
11
import com.google.gwt.maps.client.InfoWindowContent;
10
import com.google.gwt.maps.client.InfoWindowContent;
12
import com.google.gwt.maps.client.MapType;
11
import com.google.gwt.maps.client.MapType;
13
import com.google.gwt.maps.client.MapWidget;
12
import com.google.gwt.maps.client.MapWidget;
Line 25... Line 24...
25
import com.google.gwt.user.client.Window;
24
import com.google.gwt.user.client.Window;
26
import com.gwtext.client.core.EventCallback;
25
import com.gwtext.client.core.EventCallback;
27
import com.gwtext.client.core.EventObject;
26
import com.gwtext.client.core.EventObject;
28
import com.gwtext.client.core.Ext;
27
import com.gwtext.client.core.Ext;
29
import com.gwtext.client.core.ExtElement;
28
import com.gwtext.client.core.ExtElement;
30
import com.gwtext.client.widgets.BoxComponent;
-
 
31
import com.gwtext.client.widgets.Component;
-
 
32
import com.gwtext.client.widgets.Container;
29
import com.gwtext.client.widgets.Container;
33
import com.gwtext.client.widgets.Panel;
30
import com.gwtext.client.widgets.Panel;
34
import com.gwtext.client.widgets.event.ContainerListener;
-
 
35
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
31
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
36
import com.gwtext.client.widgets.form.Label;
32
import com.gwtext.client.widgets.form.Label;
37
import com.gwtext.client.widgets.layout.FitLayout;
33
import com.gwtext.client.widgets.layout.FitLayout;
38
import com.gwtext.client.widgets.layout.RowLayout;
34
import com.gwtext.client.widgets.layout.RowLayout;
39
import com.gwtext.client.widgets.layout.RowLayoutData;
35
import com.gwtext.client.widgets.layout.RowLayoutData;
Line 82... Line 78...
82
		add(panneauCarto, new RowLayoutData());
78
		add(panneauCarto, new RowLayoutData());
Line 83... Line 79...
83
		
79
		
Line 84... Line 80...
84
		if(!carteAjoutee) {
80
		if(!carteAjoutee) {
-
 
81
			
85
			
82
			Maps.loadMapsApi(Configuration.getCleGoogleMaps(), "2", false, new Runnable() {
86
			Maps.loadMapsApi(Configuration.getCleGoogleMaps(), "2", false, new Runnable() {
83
				@Override
87
				public void run() {
84
				public void run() {
88
					initialiserCarte(false);
85
					initialiserCarte(false);
89
				}
86
				}
Line 90... Line 87...
90
			});
87
			});
Line -... Line 88...
-
 
88
		}
91
		}
89
				
Line 92... Line 90...
92
				
90
		addListener(new ContainerListenerAdapter() {
93
		addListener(new ContainerListenerAdapter() {
91
			
94
			
92
			@Override
Line 162... Line 160...
162
		carteAjoutee = true;
160
		carteAjoutee = true;
163
		panneauCarto.doLayout();
161
		panneauCarto.doLayout();
Line 164... Line 162...
164
		
162
		
Line -... Line 163...
-
 
163
		map.addMapClickHandler(new MapClickHandler() {
165
		map.addMapClickHandler(new MapClickHandler() {
164
 
166
 
165
			@Override
167
			public void onClick(MapClickEvent event) {
166
			public void onClick(MapClickEvent event) {
168
				//TODO : quoi faire du double clic ?
167
				//TODO : quoi faire du double clic ?
Line 169... Line 168...
169
				obtenirInfosCommunes(event.getLatLng());
168
				obtenirInfosCommunes(event.getLatLng());
Line 170... Line 169...
170
			}
169
			}
Line -... Line 170...
-
 
170
			
171
			
171
		});
172
		});
172
		
173
		
173
		map.addMapZoomEndHandler(new MapZoomEndHandler() {
Line 174... Line 174...
174
		map.addMapZoomEndHandler(new MapZoomEndHandler() {
174
 
Line 203... Line 203...
203
		
203
		
Line 204... Line 204...
204
		final ExtElement bouton = Ext.get(idBouton);
204
		final ExtElement bouton = Ext.get(idBouton);
205
		
205
		
-
 
206
		if(bouton == null) {
206
		if(bouton == null) {
207
			Timer t = new Timer() {
207
			Timer t = new Timer() {
208
				@Override
208
				public void run() {
209
				public void run() {
Line 209... Line 210...
209
					ajouterListenerBouton(idBouton);
210
					ajouterListenerBouton(idBouton);
210
				}
211
				}
211
				
212
				
212
			};
213
			};
Line 213... Line 214...
213
			t.schedule(500);
214
			t.schedule(500);
-
 
215
			return;
214
			return;
216
		}
215
		}
217
		
216
		
218
		bouton.addListener("click", new EventCallback() {
217
		bouton.addListener("click", new EventCallback() {
219
			@Override
218
			public void execute(EventObject e) {
220
			public void execute(EventObject e) {
Line 224... Line 226...
224
		});	
226
		});	
Line 225... Line 227...
225
		
227
		
226
		bouton.focus();
228
		bouton.focus();
Line -... Line 229...
-
 
229
	}
227
	}
230
 
228
 
231
	@Override
229
	public void rafraichir(Object nouvelleDonnees,
232
	public void rafraichir(Object nouvelleDonnees,
Line 230... Line 233...
230
			boolean repandreRaffraichissement) {
233
			boolean repandreRaffraichissement) {
Line 268... Line 271...
268
		MarkerOptions options = MarkerOptions.newInstance();
271
		MarkerOptions options = MarkerOptions.newInstance();
269
		options.setDraggable(true);
272
		options.setDraggable(true);
270
		final Marker marker = new Marker(pointMarqueur, options);
273
		final Marker marker = new Marker(pointMarqueur, options);
Line 271... Line 274...
271
		
274
		
-
 
275
		marker.addMarkerDragEndHandler(new MarkerDragEndHandler() {
272
		marker.addMarkerDragEndHandler(new MarkerDragEndHandler() {
276
			@Override
273
			public void onDragEnd(MarkerDragEndEvent event) {
277
			public void onDragEnd(MarkerDragEndEvent event) {
274
				masquerChargement(true);
278
				masquerChargement(true);
275
				obtenirInfosCommunes(marker.getLatLng());
279
				obtenirInfosCommunes(marker.getLatLng());
Line 276... Line 280...
276
			}
280
			}
Line 277... Line 281...
277
 
281
 
-
 
282
		});
278
		});
283
 
279
 
284
		marker.addMarkerDragStartHandler(new MarkerDragStartHandler() {
280
		marker.addMarkerDragStartHandler(new MarkerDragStartHandler() {
285
			@Override
281
			public void onDragStart(MarkerDragStartEvent event) {
286
			public void onDragStart(MarkerDragStartEvent event) {
Line 282... Line 287...
282
				info.setVisible(false);
287
				info.setVisible(false);
Line -... Line 288...
-
 
288
			}
283
			}
289
		});
284
		});
290
		
285
		
291
		marker.addMarkerClickHandler(new MarkerClickHandler() {
286
		marker.addMarkerClickHandler(new MarkerClickHandler() {
292
 
287
 
293
			@Override