Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 276 Rev 282
Line 263... Line 263...
263
			panneauIntermediaire.setLayout(new RowLayout()); 
263
			panneauIntermediaire.setLayout(new RowLayout()); 
264
		}
264
		}
Line 265... Line 265...
265
		
265
		
Line 266... Line 266...
266
		panneauIntermediaire.setBorder(false);
266
		panneauIntermediaire.setBorder(false);
267
 
267
 
268
		//create first panel and add fields to it  
268
		//création du panneau formulaire de gauche auquels on ajoute les champs
269
		panneauPremierColonne = new Panel();  
269
		panneauPremierColonne = new Panel();  
Line 270... Line 270...
270
		panneauPremierColonne.setLayout(new FormLayout());  
270
		panneauPremierColonne.setLayout(new FormLayout());  
271
		panneauPremierColonne.setBorder(false);
271
		panneauPremierColonne.setBorder(false);
272
 
272
 
273
		//create second panel and add fields to it  
273
		//création du panneau formulaire de droite
Line 274... Line 274...
274
	    panneauSecondeColonne = new Panel();  
274
	    panneauSecondeColonne = new Panel();  
Line 275... Line 275...
275
		panneauSecondeColonne.setLayout(new FormLayout());  
275
		panneauSecondeColonne.setLayout(new FormLayout());  
276
		panneauSecondeColonne.setBorder(false);
-
 
277
				
276
		panneauSecondeColonne.setBorder(false);
Line 278... Line 277...
278
		this.setPaddings(5) ;
277
				
279
	
278
		this.setPaddings(5) ;
280
		// Accesskey pour debugging
279
	
Line 316... Line 315...
316
	    station.setAllowBlank(true);
315
	    station.setAllowBlank(true);
Line 317... Line 316...
317
 
316
 
Line 318... Line 317...
318
	    panneauPremierColonne.add(station, new AnchorLayoutData("95%"));  
317
	    panneauPremierColonne.add(station, new AnchorLayoutData("95%"));  
319
	    
318
	    
320
		latitude = new TextField("X", "x");
319
		latitude = new TextField("X", "x");
Line 321... Line 320...
321
		latitude.setGrowMax(200);
320
		latitude.setGrowMax(70);
322
		latitude.setAllowBlank(true);
321
		latitude.setAllowBlank(true);
323
	    
322
	    
Line 324... Line 323...
324
	    longitude = new TextField("Y", "y");
323
	    longitude = new TextField("Y", "y");
Line 332... Line 331...
332
		lienSelectionCommune.setStyleName("conteneur_selection_commune");
331
		lienSelectionCommune.setStyleName("conteneur_selection_commune");
333
		lienSelectionCommune.addStyleName("lien_actif");
332
		lienSelectionCommune.addStyleName("lien_actif");
Line 334... Line 333...
334
			
333
			
335
		// Panneau de type plusieurs champs de formulaire sur une meme ligne, où seront renseignés X/Y
334
		// 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);
335
		coordPanel = new MultiFieldPanel(); 
340
		coordPanel.setPaddings(0);
336
		coordPanel.setPaddings(0, 0, 0, 10);
Line 341... Line 337...
341
		coordPanel.setVisible(false);
337
		coordPanel.setVisible(false);
342
		
-
 
343
		final double largeur ;
-
 
344
		
338
		
345
		if(Ext.isIE()) {
-
 
346
			largeur = 50;
-
 
347
			coordPanel.setPaddings(0, 0, 0, 30);
-
 
348
			lienSelectionCommune.addClass("lien_decale");
-
 
349
		} else {
-
 
Line 350... Line 339...
350
			largeur = 0.34;
339
		final double largeur ;
351
		}
340
		largeur = 120;
352
				
341
				
-
 
342
		coordPanel.addToRow(latitude, new ColumnLayoutData(largeur)); 
353
		coordPanel.addToRow(latitude, new ColumnLayoutData(largeur)); 
343
		coordPanel.addToRow(longitude, new ColumnLayoutData(largeur));  
Line 354... Line 344...
354
		coordPanel.addToRow(longitude, new ColumnLayoutData(largeur));  
344
		coordPanel.addToRow(lienSelectionCommune, new ColumnLayoutData(largeur)); 
355
		coordPanel.addToRow(lienSelectionCommune, new ColumnLayoutData(150));  
345
		lienSelectionCommune.addClass("lien_decale");
Line 384... Line 374...
384
						public void execute(EventObject e) {
374
						public void execute(EventObject e) {
Line 385... Line 375...
385
							
375
							
Line 386... Line 376...
386
							coordPanel.setVisible(!coordPanel.isVisible());
376
							coordPanel.setVisible(!coordPanel.isVisible());
387
							
-
 
388
							if(Ext.isIE()) {
377
							
389
								ObservationMediateur.fireResize();
378
							if(Ext.isIE()) {
-
 
379
								latitude.focus();
-
 
380
							}
390
								latitude.focus();
381
							
391
							}
382
							ObservationMediateur.fireResize();
Line 392... Line 383...
392
						}
383
						}
393
					}) ;
384
					}) ;
Line 405... Line 396...
405
							} else {
396
							} else {
406
								Window.alert("Veuillez renseigner une commune à préciser");
397
								Window.alert("Veuillez renseigner une commune à préciser");
407
							}
398
							}
408
						}
399
						}
409
					});
400
					});
-
 
401
					
-
 
402
					if(!Ext.isIE() && Window.getClientWidth() < 1200) {
-
 
403
						
-
 
404
						latitude.setWidth(largeur+"px");
-
 
405
						longitude.setWidth(largeur+"px");
-
 
406
						lienSelectionCommune.setWidth(largeur+"px");
-
 
407
						
-
 
408
					}
410
				}
409
				}
411
 
-
 
412
			});
410
			});
Line 413... Line 411...
413
						
411
						
414
		//Sur une meme ligne, ajout de plusieurs champs
412
		//Sur une meme ligne, ajout de plusieurs champs
Line 426... Line 424...
426
	    date.setAllowBlank(true);
424
	    date.setAllowBlank(true);
427
	    formatDate = "d/m/Y";
425
	    formatDate = "d/m/Y";
428
	    date.setFormat(formatDate) ;
426
	    date.setFormat(formatDate) ;
429
	    //date.setTabIndex(5);
427
	    //date.setTabIndex(5);
430
	    panneauPremierColonne.add(date, new AnchorLayoutData("60%"));  
428
	    panneauPremierColonne.add(date, new AnchorLayoutData("60%"));  
431
 
-
 
432
	 	
429
 	
433
		espece=new ComboBox("Espèce","nom");  
430
		espece=new ComboBox("Espèce","nom");  
434
		
-
 
435
		
431
			
436
		final String resultTplEspece = "<div class=\"search-item-espece\">{nom}</div>";  
432
		final String resultTplEspece = "<div class=\"search-item-espece\">{nom}</div>";  
Line 437... Line 433...
437
 
433
 
438
		
434
		
Line 1009... Line 1005...
1009
	public void rafraichir(Object nouvelleDonnees, boolean repandreRaffraichissement) {
1005
	public void rafraichir(Object nouvelleDonnees, boolean repandreRaffraichissement) {
Line 1010... Line 1006...
1010
		
1006
		
1011
		// si l'on a reçu une liste du referentiel commune (completion referentiel commune)
1007
		// si l'on a reçu une liste du referentiel commune (completion referentiel commune)
1012
			if(nouvelleDonnees instanceof ListeReferentielCommune)
1008
			if(nouvelleDonnees instanceof ListeReferentielCommune)
1013
			{
-
 
1014
				
1009
			{
1015
					ListeReferentielCommune data = (ListeReferentielCommune) nouvelleDonnees ;
1010
				ListeReferentielCommune data = (ListeReferentielCommune) nouvelleDonnees ;
1016
					Object[][] communeData = new Object[data.size()][2];
1011
				Object[][] communeData = new Object[data.size()][2];
1017
					int i = 0 ;
1012
				int i = 0 ;
1018
				
1013
			
1019
					// on la parse et on récupère les informations quiç nous interessent
1014
				// on la parse et on récupère les informations quiç nous interessent
1020
					for (Iterator it = data.keySet().iterator(); it.hasNext();) 
1015
				for (Iterator it = data.keySet().iterator(); it.hasNext();) 
1021
					{
-
 
1022
						
-
 
1023
						ReferentielCommune ref=(ReferentielCommune) data.get(it.next());
-
 
1024
						
-
 
1025
						communeData[i][0]= ref.getCommune();
-
 
1026
						communeData[i][1]= ref.getDepartement();
-
 
1027
						
-
 
1028
						i++ ;
-
 
1029
					}
-
 
1030
					
-
 
1031
					   //	  creation du store
-
 
1032
					FieldDef defCommune = new StringFieldDef("commune");
-
 
1033
					FieldDef defDepartement = new StringFieldDef("departement");
-
 
1034
					
-
 
1035
					
-
 
Line 1036... Line 1016...
1036
					FieldDef[] defTab = { defCommune, defDepartement};
1016
				{
Line 1037... Line 1017...
1037
					
1017
					
1038
					RecordDef rd = new RecordDef(defTab);
1018
					ReferentielCommune ref=(ReferentielCommune) data.get(it.next());
Line -... Line 1019...
-
 
1019
					
-
 
1020
					communeData[i][0]= ref.getCommune();
-
 
1021
					communeData[i][1]= ref.getDepartement();
-
 
1022
					
-
 
1023
					i++ ;
-
 
1024
				}
-
 
1025
				
-
 
1026
				   //	  creation du store
-
 
1027
				FieldDef defCommune = new StringFieldDef("commune");
-
 
1028
				FieldDef defDepartement = new StringFieldDef("departement");
-
 
1029
				
-
 
1030
				
-
 
1031
				FieldDef[] defTab = { defCommune, defDepartement};
-
 
1032
				
-
 
1033
				RecordDef rd = new RecordDef(defTab);
1039
					
1034
				
1040
					final MemoryProxy dataProxy = new MemoryProxy(communeData);
1035
				final MemoryProxy dataProxy = new MemoryProxy(communeData);
1041
					final ArrayReader reader = new ArrayReader(rd);		
1036
				final ArrayReader reader = new ArrayReader(rd);		
1042
					
1037
				
1043
					Store store=new Store(dataProxy,reader);
1038
				Store store=new Store(dataProxy,reader);
1044
					store.load() ;
1039
				store.load() ;
Line 1045... Line 1040...
1045
		
1040
	
Line 1046... Line 1041...
1046
					commune.setStore(store);
1041
				commune.setStore(store);
1047
					commune.expand();
1042
				commune.expand();
Line 1048... Line 1043...
1048
			}
1043
			}
1049
			
1044
			
1050
			//			 si l'on a reçu une liste du référentiel nom (complétion referentiel nom)
1045
			//			 si l'on a reçu une liste du référentiel nom (complétion referentiel nom)
1051
			
1046
			
1052
			if(nouvelleDonnees instanceof ListeReferentielNom)
1047
			if(nouvelleDonnees instanceof ListeReferentielNom)
1053
			{
1048
			{
1054
				
1049
				
1055
					ListeReferentielNom data = (ListeReferentielNom) nouvelleDonnees ;
-
 
1056
					Object[][] nomData = new Object[data.size()][2];
-
 
1057
					int i = 0 ;
-
 
1058
				
-
 
1059
					// on la parse et on récupère les informations quiç nous interessent
-
 
1060
					for (Iterator it = data.keySet().iterator(); it.hasNext();) 
-
 
1061
					{
-
 
1062
						
-
 
1063
						ReferentielNom ref=(ReferentielNom) data.get(it.next());
-
 
1064
						
-
 
1065
						nomData[i][0]= ref.getNom();
-
 
1066
						nomData[i][1]= ref.getNumeroNom();
-
 
1067
						
-
 
1068
																	
-
 
1069
						i++ ;
-
 
1070
					}
-
 
Line 1071... Line 1050...
1071
					
1050
				ListeReferentielNom data = (ListeReferentielNom) nouvelleDonnees ;
Line 1072... Line 1051...
1072
					   //	  creation du store
1051
				Object[][] nomData = new Object[data.size()][2];
1073
					FieldDef defNom = new StringFieldDef("nom");
1052
				int i = 0 ;
Line -... Line 1053...
-
 
1053
			
-
 
1054
				// on la parse et on récupère les informations quiç nous interessent
-
 
1055
				for (Iterator it = data.keySet().iterator(); it.hasNext();) 
-
 
1056
				{
-
 
1057
					
-
 
1058
					ReferentielNom ref=(ReferentielNom) data.get(it.next());
-
 
1059
					
-
 
1060
					nomData[i][0]= ref.getNom();
-
 
1061
					nomData[i][1]= ref.getNumeroNom();
-
 
1062
					
-
 
1063
																
-
 
1064
					i++ ;
-
 
1065
				}
-
 
1066
				
-
 
1067
				   //	  creation du store
-
 
1068
				FieldDef defNom = new StringFieldDef("nom");
1074
					FieldDef defNumeroNom = new StringFieldDef("numeroNom");
1069
				FieldDef defNumeroNom = new StringFieldDef("numeroNom");
1075
					
1070
				
1076
					
1071
				
1077
					FieldDef[] defTab = { defNom, defNumeroNom};
1072
				FieldDef[] defTab = { defNom, defNumeroNom};
Line 1078... Line 1073...
1078
					
1073
				
Line 1079... Line 1074...
1079
					RecordDef rd = new RecordDef(defTab);
1074
				RecordDef rd = new RecordDef(defTab);