Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 268 Rev 276
Line 46... Line 46...
46
import com.gwtext.client.widgets.ToolTip;
46
import com.gwtext.client.widgets.ToolTip;
47
import com.gwtext.client.widgets.Toolbar;
47
import com.gwtext.client.widgets.Toolbar;
48
import com.gwtext.client.widgets.Viewport;
48
import com.gwtext.client.widgets.Viewport;
49
import com.gwtext.client.widgets.event.BoxComponentListenerAdapter;
49
import com.gwtext.client.widgets.event.BoxComponentListenerAdapter;
50
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
50
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-
 
51
import com.gwtext.client.widgets.event.ContainerListener;
51
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
52
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
52
import com.gwtext.client.widgets.event.DatePickerListener;
53
import com.gwtext.client.widgets.event.DatePickerListener;
53
import com.gwtext.client.widgets.event.DatePickerListenerAdapter;
54
import com.gwtext.client.widgets.event.DatePickerListenerAdapter;
-
 
55
import com.gwtext.client.widgets.event.PanelListener;
54
import com.gwtext.client.widgets.event.PanelListenerAdapter;
56
import com.gwtext.client.widgets.event.PanelListenerAdapter;
55
import com.gwtext.client.widgets.form.ComboBox;
57
import com.gwtext.client.widgets.form.ComboBox;
56
import com.gwtext.client.widgets.form.DateField;
58
import com.gwtext.client.widgets.form.DateField;
57
import com.gwtext.client.widgets.form.Field;
59
import com.gwtext.client.widgets.form.Field;
58
import com.gwtext.client.widgets.form.FormPanel;
60
import com.gwtext.client.widgets.form.FormPanel;
Line 261... Line 263...
261
			panneauIntermediaire.setLayout(new RowLayout()); 
263
			panneauIntermediaire.setLayout(new RowLayout()); 
262
		}
264
		}
Line 263... Line 265...
263
		
265
		
Line 264... Line -...
264
		panneauIntermediaire.setBorder(false);
-
 
265
 
-
 
266
		if (Ext.isIE6()) {
-
 
267
			panneauIntermediaire.setWidth(800);
-
 
268
		}
266
		panneauIntermediaire.setBorder(false);
269
		
267
 
270
		//create first panel and add fields to it  
268
		//create first panel and add fields to it  
271
		panneauPremierColonne = new Panel();  
269
		panneauPremierColonne = new Panel();  
Line 272... Line 270...
272
		panneauPremierColonne.setLayout(new FormLayout());  
270
		panneauPremierColonne.setLayout(new FormLayout());  
273
		panneauPremierColonne.setBorder(false);
271
		panneauPremierColonne.setBorder(false);
274
 
272
 
275
		//create second panel and add fields to it  
273
		//create second panel and add fields to it  
276
	    panneauSecondeColonne = new Panel();  
274
	    panneauSecondeColonne = new Panel();  
277
		panneauSecondeColonne.setLayout(new FormLayout());  
275
		panneauSecondeColonne.setLayout(new FormLayout());  
Line 278... Line 276...
278
		panneauSecondeColonne.setBorder(false);
276
		panneauSecondeColonne.setBorder(false);
Line 279... Line 277...
279
		
277
				
Line 293... Line 291...
293
		  
291
		  
294
		commune.setHideTrigger(true);
292
		commune.setHideTrigger(true);
Line 295... Line 293...
295
		//commune.setTabIndex(1);
293
		//commune.setTabIndex(1);
296
		
-
 
297
		  //création du lien "Accès carto" dans le formulaire	
294
		
298
		basculerverscarto = new HTML("");
295
		  //création du lien "Accès carto" dans le formulaire	
Line 299... Line 296...
299
		basculerverscarto = new HTML(" <a id=\"lien_carto\" href=\"#\" tabindex=\"2\">Localiser</a>");
296
		basculerverscarto = new HTML(" <a id=\"lien_carto\" href=\"#\" tabindex=\"2\">Localiser</a>");
300
		basculerverscarto.addStyleName("lien_actif");
297
		basculerverscarto.addStyleName("lien_actif");
301
		
298
		
302
		//création info bulle sur le lien "accès carto"
299
		//création info bulle sur le lien "accès carto"
Line 303... Line 300...
303
		ToolTip tip2 = new ToolTip();  
300
		ToolTip tip2 = new ToolTip();  
304
		tip2.setHtml("Via une carte, obtenez les coordonnées (longitude/latitude) de votre observation ");  
301
		tip2.setHtml("Via une carte, obtenez les coordonnées (longitude/latitude) de votre observation ");  
-
 
302
		tip2.applyTo(basculerverscarto.getElement());
305
		tip2.applyTo(basculerverscarto.getElement());
303
		
306
		
304
		//Sur une meme ligne, ajout de plusieurs champs
-
 
305
		final MultiFieldPanel htmlCommunePanel = new MultiFieldPanel(); 
307
		//Sur une meme ligne, ajout de plusieurs champs
306
		
308
		final MultiFieldPanel htmlCommunePanel = new MultiFieldPanel();  
307
		htmlCommunePanel.addToRow(commune,new ColumnLayoutData(0.7)); 
Line 309... Line 308...
309
		htmlCommunePanel.addToRow(commune,new ColumnLayoutData(0.5)); 
308
		htmlCommunePanel.addToRow(basculerverscarto,new ColumnLayoutData(0.3)); 
Line 310... Line 309...
310
		htmlCommunePanel.addToRow(basculerverscarto,100); 
309
 
311
		htmlCommunePanel.setBorder(false);
310
		htmlCommunePanel.setBorder(false);
Line 312... Line 311...
312
		htmlCommunePanel.setId("x-commune-panel"); 
311
		htmlCommunePanel.setId("x-commune-panel"); 
Line 313... Line 312...
313
 
312
 
-
 
313
		panneauPremierColonne.add(htmlCommunePanel);
314
		panneauPremierColonne.add(htmlCommunePanel);
314
 
Line 315... Line 315...
315
 
315
	    station = new TextField("Station", "station");  
-
 
316
	    station.setAllowBlank(true);
316
	    station = new TextField("Station", "station");  
317
 
-
 
318
	    panneauPremierColonne.add(station, new AnchorLayoutData("95%"));  
-
 
319
	    
-
 
320
		latitude = new TextField("X", "x");
Line 317... Line -...
317
	    station.setAllowBlank(true);
-
 
318
 
321
		latitude.setGrowMax(200);
319
	    panneauPremierColonne.add(station, new AnchorLayoutData("95%"));  
322
		latitude.setAllowBlank(true);
-
 
323
	    
Line 320... Line 324...
320
	    
324
	    longitude = new TextField("Y", "y");
321
		latitude = new TextField("X", "x", 100);
325
	    longitude.setGrowMax(200);
-
 
326
		longitude.setAllowBlank(true);
-
 
327
				
-
 
328
		lienSelectionCommune = new Label("");
-
 
329
		
322
		latitude.setAllowBlank(true);
330
		
-
 
331
		lienSelectionCommune.setId("conteneur_selection_commune");
-
 
332
		lienSelectionCommune.setStyleName("conteneur_selection_commune");
-
 
333
		lienSelectionCommune.addStyleName("lien_actif");
-
 
334
			
-
 
335
		// Panneau de type plusieurs champs de formulaire sur une meme ligne, où seront renseignés X/Y
-
 
336
		coordPanel = new MultiFieldPanel(); 
-
 
337
		//FormLayout coordFormLayout = new FormLayout();
-
 
338
		//coordFormLayout.setLabelWidth(5);
-
 
339
		//coordPanel.setLayout(coordFormLayout);
-
 
340
		coordPanel.setPaddings(0);
-
 
341
		coordPanel.setVisible(false);
323
	    
342
		
324
	    longitude = new TextField("Y", "y", 100);
343
		final double largeur ;
325
		longitude.setAllowBlank(true);
344
		
326
		
345
		if(Ext.isIE()) {
Line 327... Line 346...
327
		lienSelectionCommune = new Label();
346
			largeur = 50;
328
		lienSelectionCommune.setId("conteneur_selection_commune");
347
			coordPanel.setPaddings(0, 0, 0, 30);
Line 329... Line 348...
329
		lienSelectionCommune.setStyleName("conteneur_selection_commune");
348
			lienSelectionCommune.addClass("lien_decale");
330
			
349
		} else {
331
		// Panneau de type plusieurs champs de formulaire sur une meme ligne, où seront renseignés X/Y
350
			largeur = 0.34;
332
		coordPanel = new MultiFieldPanel(); 
351
		}
Line 333... Line 352...
333
		coordPanel.setVisible(false);
352
				
334
		coordPanel.addToRow(latitude, new ColumnLayoutData(0.3)); 
-
 
335
		coordPanel.addToRow(longitude, new ColumnLayoutData(0.3));  
353
		coordPanel.addToRow(latitude, new ColumnLayoutData(largeur)); 
-
 
354
		coordPanel.addToRow(longitude, new ColumnLayoutData(largeur));  
336
		coordPanel.addToRow(lienSelectionCommune, new ColumnLayoutData(0.4));  
355
		coordPanel.addToRow(lienSelectionCommune, new ColumnLayoutData(150));  
Line 337... Line 356...
337
		coordPanel.setBorder(false);
356
		coordPanel.setBorder(false);
338
		
357
		
339
		  //création du champs coordonnées	
358
		  //création du champs coordonnées	
Line 361... Line 380...
361
				public void onAfterLayout(Container c) {
380
				public void onAfterLayout(Container c) {
362
					ExtElement lienCoord = Ext.get("lien_coord");
381
					ExtElement lienCoord = Ext.get("lien_coord");
363
					lienCoord.removeAllListeners();
382
					lienCoord.removeAllListeners();
364
					lienCoord.addListener("click", new EventCallback() {
383
					lienCoord.addListener("click", new EventCallback() {
365
						public void execute(EventObject e) {
384
						public void execute(EventObject e) {
-
 
385
							
366
							coordPanel.setVisible(!coordPanel.isVisible());
386
							coordPanel.setVisible(!coordPanel.isVisible());
-
 
387
							
-
 
388
							if(Ext.isIE()) {
-
 
389
								ObservationMediateur.fireResize();
-
 
390
								latitude.focus();
-
 
391
							}
367
						}
392
						}
368
					}) ;
393
					}) ;
Line 369... Line 394...
369
				
394
				
370
					ExtElement lienCarto = Ext.get("lien_carto");
395
					ExtElement lienCarto = Ext.get("lien_carto");
Line 384... Line 409...
384
					});
409
					});
385
				}
410
				}
Line 386... Line 411...
386
 
411
 
Line 387... Line 412...
387
			});
412
			});
388
						
413
						
-
 
414
		//Sur une meme ligne, ajout de plusieurs champs
389
			//Sur une meme ligne, ajout de plusieurs champs
415
		final MultiFieldPanel htmlPanel = new MultiFieldPanel();  
390
			final MultiFieldPanel htmlPanel = new MultiFieldPanel();  
416
		
391
			htmlPanel.addToRow(coordonnees, 100); 
417
		htmlPanel.addToRow(coordonnees, 100); 
392
			htmlPanel.addToRow(accesformulaire, new ColumnLayoutData(0.5)); 
418
		htmlPanel.addToRow(accesformulaire, new ColumnLayoutData(0.5)); 
Line 393... Line 419...
393
			htmlPanel.setBorder(false);
419
		htmlPanel.setBorder(false);
394
			htmlPanel.setId("x-coord-panel");
420
		htmlPanel.setId("x-coord-panel");
Line 395... Line 421...
395
			
421
			
Line 437... Line 463...
437
	    comment.setAllowBlank(true);
463
	    comment.setAllowBlank(true);
438
	    comment.setHeight(50);
464
	    comment.setHeight(50);
439
	    //comment.setTabIndex(7);
465
	    //comment.setTabIndex(7);
440
	    panneauSecondeColonne.add(comment, new AnchorLayoutData("95%") );
466
	    panneauSecondeColonne.add(comment, new AnchorLayoutData("95%") );
Line 441... Line 467...
441
	    
467
	    
442
	    if (Window.getClientWidth()> Window.getClientHeight()) {
468
	    if (Window.getClientWidth() > Window.getClientHeight() || Window.getClientWidth() < 800) {
443
			panneauIntermediaire.add(panneauPremierColonne, new ColumnLayoutData(.5));
469
			panneauIntermediaire.add(panneauPremierColonne, new ColumnLayoutData(.5));
444
			panneauIntermediaire.add(panneauSecondeColonne, new ColumnLayoutData(.5));
470
			panneauIntermediaire.add(panneauSecondeColonne, new ColumnLayoutData(.5));
445
	    }
471
	    }
446
	    else {
472
	    else {
Line 467... Line 493...
467
		bt.addSpacer() ;
493
		bt.addSpacer() ;
468
		bt.addText("Mode de saisie ") ;
494
		bt.addText("Mode de saisie ") ;
469
		bt.addField(selecteurMode) ;
495
		bt.addField(selecteurMode) ;
Line 470... Line 496...
470
		
496
		
471
		
497
		
472
		if (Ext.isIE6()) {
498
		if (Ext.isIE()) {
473
			panneauPremierColonne.setButtonAlign(Position.RIGHT);
499
			panneauPremierColonne.setButtonAlign(Position.RIGHT);
474
			panneauPremierColonne.addButton(boutonOK);
500
			panneauPremierColonne.addButton(boutonOK);
475
			panneauSecondeColonne.setButtonAlign(Position.LEFT);
501
			panneauSecondeColonne.setButtonAlign(Position.LEFT);
476
			panneauSecondeColonne.addButton(boutonAnnuler);
502
			panneauPremierColonne.addButton(boutonAnnuler);
Line 477... Line 503...
477
		}
503
		}
478
		else {
504
		else {
Line 496... Line 522...
496
		this.add(panneauFormulaire) ;
522
		this.add(panneauFormulaire) ;
497
		this.setTopToolbar(bt) ;
523
		this.setTopToolbar(bt) ;
Line 498... Line 524...
498
		
524
		
Line 499... Line -...
499
		this.setAutoScroll(true);
-
 
Line 500... Line 525...
500
	
525
		this.setAutoScroll(true);
501
	
526
	
502
		
527
		
503
		panneauFormulaire.addListener(new PanelListenerAdapter() {
528
		panneauFormulaire.addListener(new PanelListenerAdapter() {
-
 
529
	        public void onResize(BoxComponent component, int adjWidth, int adjHeight, int rawWidth, int rawHeight) {
-
 
530
	        	panneauIntermediaire.setWidth(rawWidth);
-
 
531
	        	panneauIntermediaire.setHeight(rawHeight);
-
 
532
	        	
-
 
533
	        	panneauPremierColonne.doLayout();
-
 
534
	        	panneauSecondeColonne.doLayout();
504
	        public void onResize(BoxComponent component, int adjWidth, int adjHeight, int rawWidth, int rawHeight) {
535
	        	
Line 505... Line 536...
505
	        	panneauIntermediaire.setWidth(rawWidth);
536
	        	htmlCommunePanel.doLayout();
Line 933... Line 964...
933
		this.addListener(new ContainerListenerAdapter() {
964
		this.addListener(new ContainerListenerAdapter() {
934
			public void onAfterLayout(Container self) {
965
			public void onAfterLayout(Container self) {
935
				commune.focus();
966
				commune.focus();
936
			}
967
			}
937
		});	
968
		});	
938
		
969
			
939
	}
970
	}
Line 940... Line 971...
940
	
971
	
941
	/**
972
	/**
942
	 * Validation de la saisie 
973
	 * Validation de la saisie 
Line 992... Line 1023...
992
						ReferentielCommune ref=(ReferentielCommune) data.get(it.next());
1023
						ReferentielCommune ref=(ReferentielCommune) data.get(it.next());
Line 993... Line 1024...
993
						
1024
						
994
						communeData[i][0]= ref.getCommune();
1025
						communeData[i][0]= ref.getCommune();
Line 995... Line -...
995
						communeData[i][1]= ref.getDepartement();
-
 
996
						
1026
						communeData[i][1]= ref.getDepartement();
997
																	
1027
						
Line 998... Line 1028...
998
						i++ ;
1028
						i++ ;
999
					}
1029
					}
Line 1108... Line 1138...
1108
			if(!infosCom.getIdLocalite().trim().equals(""))
1138
			if(!infosCom.getIdLocalite().trim().equals(""))
1109
			nCommune += " ("+infosCom.getIdLocalite()+")";
1139
			nCommune += " ("+infosCom.getIdLocalite()+")";
1110
		}
1140
		}
1111
		lienSelectionCommune.setHtml("<a id=\"lien_selection_commune\" tabindex=\"9\">"+nCommune+"</a>");
1141
		lienSelectionCommune.setHtml("<a id=\"lien_selection_commune\" tabindex=\"9\">"+nCommune+"</a>");
1112
		lienSelectionCommune.setStyleName("img-curseur-depl");
1142
		lienSelectionCommune.setStyleName("img-curseur-depl");
-
 
1143
		
1113
		Ext.get("lien_selection_commune").addListener("click",new EventCallback() {
1144
		Ext.get("lien_selection_commune").addListener("click",new EventCallback() {
1114
			public void execute(EventObject e) {
1145
			public void execute(EventObject e) {
1115
				rafraichirCommune(infosCom);
1146
				rafraichirCommune(infosCom);
1116
			}			
1147
			}			
1117
		});
1148
		});
Line 1136... Line 1167...
1136
			}			
1167
			}			
1137
		});
1168
		});
Line 1138... Line 1169...
1138
 
1169
 
1139
		Ext.get(lienSelectionCommune.getElement()).unmask();
1170
		Ext.get(lienSelectionCommune.getElement()).unmask();
1140
		rechercheCommuneEnCours = false;
-
 
1141
		latModifiee = false;
-
 
1142
		longModifiee = false;
1171
		rechercheCommuneEnCours = false;
Line 1143... Line 1172...
1143
	}
1172
	}
1144
	
1173