Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 109 Rev 128
Line 100... Line 100...
100
 
100
 
Line 101... Line 101...
101
		arbreEntitesGeographiques = new TreePanel();
101
		arbreEntitesGeographiques = new TreePanel();
Line 102... Line -...
102
 
-
 
103
		this.setPaddings(5);
102
 
104
 
103
		this.setPaddings(5);
-
 
104
 
-
 
105
		this.setCollapsible(true);
105
		this.setBorder(false);
106
		this.setAutoWidth(true);
-
 
107
		
Line 106... Line 108...
106
		this.setCollapsible(true);
108
		if (GWT.isScript()) {
107
		this.setAutoWidth(true);
109
			setAutoScroll(true);
108
		this.setAutoScroll(true) ;
110
		}
Line 126... Line 128...
126
 
128
 
127
				// on interdit le drag and drop dans l'arbre
129
				// on interdit le drag and drop dans l'arbre
128
				arbreEntitesGeographiques.setEnableDD(false);
130
				arbreEntitesGeographiques.setEnableDD(false);
129
				arbreEntitesGeographiques.setId("x-view-tree-filter-entity");
131
				arbreEntitesGeographiques.setId("x-view-tree-filter-entity");
130
				arbreEntitesGeographiques.setAutoWidth(false);
-
 
131
				
-
 
132
				if (GWT.isScript()) {
-
 
133
					arbreEntitesGeographiques.setAutoScroll(true);
-
 
134
				}
-
 
135
				
-
 
Line 136... Line 132...
136
				arbreEntitesGeographiques.setBorder(false);
132
				arbreEntitesGeographiques.setAutoWidth(false);
137
 
133
 
138
				// on crée une racine pour l'arbre
134
				// on crée une racine pour l'arbre
139
				TreeNode root = new TreeNode("Localités");
135
				TreeNode root = new TreeNode("Localités");
Line 180... Line 176...
180
				switch(node.getDepth()) 
176
				switch(node.getDepth()) 
181
				{
177
				{
182
					case 0:
178
					case 0:
183
						if(!arbreCharge)
179
						if(!arbreCharge)
184
						{
180
						{
185
							ExtElement masked = Ext.get(arbreEntitesGeographiques.getId());
-
 
186
							masked.mask("Chargement");
-
 
187
							observationMediateur.obtenirListeEntiteGeographique() ;
181
							/*observationMediateur.obtenirListeEntiteGeographique() ;
188
							arbreCharge = true ;
182
							arbreCharge = true ;*/
-
 
183
							arbreEntitesGeographiques.getRootNode().expand();
189
						}
184
						}
190
						else 
185
						else 
191
						{
186
						{
192
							observationMediateur.obtenirNombreObservation() ;
187
							observationMediateur.obtenirNombreObservation() ;
193
						}
188
						}
Line 218... Line 213...
218
		arbreEntitesGeographiques.getRootNode().addListener(new TreeNodeListenerAdapter() {
213
		arbreEntitesGeographiques.getRootNode().addListener(new TreeNodeListenerAdapter() {
Line 219... Line 214...
219
			
214
			
220
			public void onExpand(Node node) {
215
			public void onExpand(Node node) {
221
				if(!arbreCharge)
216
				if(!arbreCharge)
222
				{
-
 
223
					ExtElement masked = Ext.get(arbreEntitesGeographiques.getId());
-
 
224
					masked.mask("Chargement");
217
				{
225
					observationMediateur.obtenirListeEntiteGeographique() ;
218
					observationMediateur.obtenirListeEntiteGeographique() ;
226
					arbreCharge = true ;
219
					arbreCharge = true ;
227
				}
220
				}
Line 234... Line 227...
234
	 * Méthode héritée de l'interface rafraichissable
227
	 * Méthode héritée de l'interface rafraichissable
235
	 */
228
	 */
236
	public void rafraichir(Object nouvelleDonnees,
229
	public void rafraichir(Object nouvelleDonnees,
237
			boolean repandreRaffraichissement) {
230
			boolean repandreRaffraichissement) {
Line 238... Line 231...
238
 
231
 
239
 
232
		
Line 240... Line 233...
240
		if (nouvelleDonnees instanceof ListeEntiteGeographiqueObservation) {
233
		if (nouvelleDonnees instanceof ListeEntiteGeographiqueObservation) {
241
		
234
		
242
			String id_location=null;
235
			String id_location=null;
Line 257... Line 250...
257
			for (Iterator<String> it= data.keySet().iterator(); it.hasNext();) {
250
			for (Iterator<String> it= data.keySet().iterator(); it.hasNext();) {
Line 258... Line 251...
258
				
251
				
Line 259... Line 252...
259
				EntiteGeographiqueObservation ent=(EntiteGeographiqueObservation) data.get(it.next());
252
				EntiteGeographiqueObservation ent=(EntiteGeographiqueObservation) data.get(it.next());
-
 
253
				
260
				
254
				id_location=ent.getIdLocation();
261
				id_location=ent.getIdLocation();
255
				id_location = id_location.replaceAll("\"", "");
Line 262... Line 256...
262
				location=ent.getLocation();
256
				location=ent.getLocation();
263
				lieuDit=ent.getLieuDit();
257
				lieuDit=ent.getLieuDit();
264
				
258
				
Line 265... Line 259...
265
				if(id_location.contains("000null")) {
259
				if(id_location.contains("000null") || id_location.equals(null) || (id_location.trim()).equals("")) {
266
					id_location="Inconnue" ;
260
					id_location="Inconnue" ;
267
				}
261
				}
Line 268... Line 262...
268
				
262
				
269
				if(location.contains("000null")) {
263
				if(location.contains("000null") || location.equals(null) || (location.trim().equals(""))) {
270
					location="Inconnue" ;
264
					location="Inconnue" ;
Line 271... Line 265...
271
				}
265
				}
272
				
266
				
Line 368... Line 362...
368
				}
362
				}
Line 369... Line 363...
369
	
363
	
370
				// l'état du filtre est réinitialisé
364
				// l'état du filtre est réinitialisé
Line 371... Line -...
371
				filtreModifie = false;
-
 
372
				
-
 
373
				ExtElement masked = Ext.get(arbreEntitesGeographiques.getId());
-
 
374
				masked.unmask();
365
				filtreModifie = false;
375
				
366
				
Line 376... Line 367...
376
				//show() ;
367
				//show() ;
Line 377... Line 368...
377
				doLayout();
368
				doLayout();
378
 
369
 
-
 
370
			}
-
 
371
		
-
 
372
		if(nouvelleDonnees instanceof Observation)
-
 
373
		{	
-
 
374
			// si l'arbre n'est pas encore chargé, on ne tient pas compte de l'ajout
-
 
375
			// l'arbre complet sera de toute façon renvoyé plus tard lors du premier chargement
-
 
376
			// de l'arbre
379
			}
377
			if(!arbreCharge) {
Line 380... Line 378...
380
		
378
				return;
381
		if(nouvelleDonnees instanceof Observation)
379
			}
382
		{			
380
			
383
			Observation obs = (Observation)nouvelleDonnees ;
381
			Observation obs = (Observation)nouvelleDonnees ;
Line 384... Line 382...
384
			
382
			
Line 385... Line 383...
385
			String id_location= obs.getIdentifiantLocalite();
383
			String id_location= obs.getIdentifiantLocalite();
386
			id_location.replaceAll("\"", "") ;
384
			id_location = id_location.replaceAll("\"", "");
387
			String location=obs.getLocalite();
385
			String location=obs.getLocalite();
Line 388... Line 386...
388
			String lieuDit=obs.getLieudit();
386
			String lieuDit=obs.getLieudit();
389
			
387
			
390
			Node root = arbreEntitesGeographiques.getRootNode() ;
388
			Node root = arbreEntitesGeographiques.getRootNode() ;
Line 391... Line 389...
391
			
389
			
392
			if(id_location.contains("000null") || id_location.equals(null)) {
390
			if(id_location.contains("000null") || id_location.equals(null) || (id_location.trim()).equals("")) {
393
				id_location="Inconnue" ;
391
				id_location="Inconnue" ;
Line 394... Line 392...
394
			}
392
			}
395
			
393
			
Line 579... Line 577...
579
					
577
					
580
					if(l2.length() == 1) {
578
					if(l2.length() == 1) {
581
						l2 = "0"+l2;
579
						l2 = "0"+l2;
Line -... Line 580...
-
 
580
					}
-
 
581
					
-
 
582
					Integer n1 = 0;
-
 
583
					Integer n2 = 0;
582
					}
584
					
583
					
585
					try{
-
 
586
						n1 = Integer.parseInt(l1) ;
-
 
587
						n2 = Integer.parseInt(l2) ;
-
 
588
					} catch(NumberFormatException ne)  {
-
 
589
						n1 = 0;
Line 584... Line 590...
584
					Integer n1 = Integer.parseInt(l1) ;
590
						n2 = 0;
585
					Integer n2 = Integer.parseInt(l2) ;
591
					}
586
					
592
					
587
					return n1.compareTo(n2) ;
593
					return n1.compareTo(n2) ;