Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 104 Rev 109
Line 25... Line 25...
25
import com.gwtext.client.widgets.tree.TreeNode;
25
import com.gwtext.client.widgets.tree.TreeNode;
26
import com.gwtext.client.widgets.tree.TreePanel;
26
import com.gwtext.client.widgets.tree.TreePanel;
27
import com.gwtext.client.widgets.tree.event.TreeNodeListenerAdapter;
27
import com.gwtext.client.widgets.tree.event.TreeNodeListenerAdapter;
28
import com.gwtext.client.widgets.tree.event.TreePanelListenerAdapter;
28
import com.gwtext.client.widgets.tree.event.TreePanelListenerAdapter;
29
import com.gwtext.client.core.EventObject;
29
import com.gwtext.client.core.EventObject;
-
 
30
import com.gwtext.client.core.Ext;
-
 
31
import com.gwtext.client.core.ExtElement;
Line 30... Line 32...
30
 
32
 
31
/**
33
/**
32
 * fenêtre de recherche affichant l'arbre des mots clés en lecture et un bouton
34
 * fenêtre de recherche affichant l'arbre des mots clés en lecture et un bouton
33
 * cliquable
35
 * cliquable
Line 178... Line 180...
178
				switch(node.getDepth()) 
180
				switch(node.getDepth()) 
179
				{
181
				{
180
					case 0:
182
					case 0:
181
						if(!arbreCharge)
183
						if(!arbreCharge)
182
						{
184
						{
-
 
185
							ExtElement masked = Ext.get(arbreEntitesGeographiques.getId());
-
 
186
							masked.mask("Chargement");
183
							observationMediateur.obtenirListeEntiteGeographique() ;
187
							observationMediateur.obtenirListeEntiteGeographique() ;
184
							arbreCharge = true ;
188
							arbreCharge = true ;
185
						}
189
						}
186
						else 
190
						else 
187
						{
191
						{
Line 214... Line 218...
214
		arbreEntitesGeographiques.getRootNode().addListener(new TreeNodeListenerAdapter() {
218
		arbreEntitesGeographiques.getRootNode().addListener(new TreeNodeListenerAdapter() {
Line 215... Line 219...
215
			
219
			
216
			public void onExpand(Node node) {
220
			public void onExpand(Node node) {
217
				if(!arbreCharge)
221
				if(!arbreCharge)
-
 
222
				{
-
 
223
					ExtElement masked = Ext.get(arbreEntitesGeographiques.getId());
218
				{
224
					masked.mask("Chargement");
219
					observationMediateur.obtenirListeEntiteGeographique() ;
225
					observationMediateur.obtenirListeEntiteGeographique() ;
220
					arbreCharge = true ;
226
					arbreCharge = true ;
221
				}
227
				}
Line 332... Line 338...
332
						node_lieu.setText(lieuDit);
338
						node_lieu.setText(lieuDit);
333
						node_loc.appendChild(node_lieu) ;
339
						node_loc.appendChild(node_lieu) ;
334
						String[] usObj3 = {lieuDit};
340
						String[] usObj3 = {lieuDit};
335
						node_lieu.setUserObject(usObj3);
341
						node_lieu.setUserObject(usObj3);
336
					}
342
					}
-
 
343
					
-
 
344
					root.sort(comparerNoeuds()) ;
-
 
345
					doLayout();
Line 337... Line 346...
337
 
346
 
Line 338... Line 347...
338
				}
347
				}
339
			
348
			
Line 358... Line 367...
358
					estInstancie = true;
367
					estInstancie = true;
359
				}
368
				}
Line 360... Line 369...
360
	
369
	
361
				// l'état du filtre est réinitialisé
370
				// l'état du filtre est réinitialisé
-
 
371
				filtreModifie = false;
-
 
372
				
-
 
373
				ExtElement masked = Ext.get(arbreEntitesGeographiques.getId());
-
 
374
				masked.unmask();
362
				filtreModifie = false;
375
				
363
				//show() ;
376
				//show() ;
Line 364... Line 377...
364
				doLayout();
377
				doLayout();
Line 409... Line 422...
409
							node_lieu.setId(""+(id_location+location+lieuDit));
422
							node_lieu.setId(""+(id_location+location+lieuDit));
410
							node_lieu.setText(lieuDit);
423
							node_lieu.setText(lieuDit);
411
							String[] usObj = {lieuDit};
424
							String[] usObj = {lieuDit};
412
							node_lieu.setUserObject(usObj);
425
							node_lieu.setUserObject(usObj);
413
							noeudMemeLoc.appendChild(node_lieu) ;
426
							noeudMemeLoc.appendChild(node_lieu) ;
-
 
427
							
-
 
428
							root.sort(comparerNoeuds()) ;
414
						}
429
						}
415
					}
430
					}
416
					else
431
					else
417
					{
432
					{
418
						TreeNode node_loc = new TreeNode();
433
						TreeNode node_loc = new TreeNode();
Line 427... Line 442...
427
						node_lieu.setText(lieuDit);
442
						node_lieu.setText(lieuDit);
428
						String[] usObj2 = {lieuDit};
443
						String[] usObj2 = {lieuDit};
429
						node_lieu.setUserObject(usObj2);
444
						node_lieu.setUserObject(usObj2);
430
						node_loc.appendChild(node_lieu) ;
445
						node_loc.appendChild(node_lieu) ;
Line -... Line 446...
-
 
446
						
-
 
447
						root.sort(comparerNoeuds()) ;
431
						
448
						
432
					}
449
					}
433
			}
450
			}
434
			else
451
			else
435
			{
452
			{
Line 454... Line 471...
454
				node_lieu.setText(lieuDit);
471
				node_lieu.setText(lieuDit);
455
				String[] usObj3 = {lieuDit};
472
				String[] usObj3 = {lieuDit};
456
				node_lieu.setUserObject(usObj3);
473
				node_lieu.setUserObject(usObj3);
457
				node_loc.appendChild(node_lieu) ;
474
				node_loc.appendChild(node_lieu) ;
Line 458... Line -...
458
				
-
 
459
				// TODO : améliorer la compararaison des noeuds
475
				
460
				root.sort(comparerNoeuds()) ;
-
 
Line -... Line 476...
-
 
476
				root.sort(comparerNoeuds()) ;
461
			}
477
				
462
				
478
			}	
463
				arbreEntitesGeographiques.doLayout() ;
479
				arbreEntitesGeographiques.doLayout() ;
Line 543... Line 559...
543
	{
559
	{
544
		return new Comparator<TreeNode>() {
560
		return new Comparator<TreeNode>() {
Line 545... Line 561...
545
 
561
 
Line -... Line 562...
-
 
562
			public int compare(TreeNode o1, TreeNode o2) {
-
 
563
				
-
 
564
				if(o1.getText().equals("Inconnue")) {
-
 
565
					return -1 ;
-
 
566
				}
-
 
567
				
-
 
568
				if(o2.getText().equals("Inconnue")) {
-
 
569
					return 1 ;
546
			public int compare(TreeNode o1, TreeNode o2) {
570
				}
547
				
571
				
-
 
572
				if(o1.getDepth() == 1 && o2.getDepth() == 1)
-
 
573
				{
-
 
574
					String l1 = o1.getText() ;
-
 
575
					String l2 = o2.getText() ;
-
 
576
					if(l1.length() == 1) {
-
 
577
						l1 = "0"+l1;
-
 
578
					}
-
 
579
					
-
 
580
					if(l2.length() == 1) {
-
 
581
						l2 = "0"+l2;
548
				if(o1.getDepth() == 1 && o2.getDepth() == 1 && o1.getText().equals("Inconnue") && o2.getText().equals("Inconnue"))
582
					}
549
				{
583
					
Line 550... Line 584...
550
					Integer n1 = Integer.parseInt(((String[])o1.getUserObject())[0]) ;
584
					Integer n1 = Integer.parseInt(l1) ;
551
					Integer n2 = Integer.parseInt(((String[])o2.getUserObject())[0]) ;
585
					Integer n2 = Integer.parseInt(l2) ;
552
					
586
					
553
					return n1.compareTo(n2) ;
587
					return n1.compareTo(n2) ;
Line 558... Line 592...
558
					String n2 = o2.getText() ;
592
					String n2 = o2.getText() ;
Line 559... Line 593...
559
				
593
				
560
					return n1.compareTo(n2) ;
594
					return n1.compareTo(n2) ;
561
				}
595
				}
562
			}
-
 
563
			
596
			}
564
		} ;
597
		} ;
Line 565... Line 598...
565
	}
598
	}