Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 90 Rev 91
Line 430... Line 430...
430
						
430
						
431
					}
431
					}
432
			}
432
			}
433
			else
433
			else
-
 
434
			{
-
 
435
				// TODO: Pourquoi l'ajout ne marche que sur la racine ?
434
			{
436
				
435
				TreeNode node_id_loc = new TreeNode();
437
				TreeNode node_id_loc = new TreeNode();
436
				node_id_loc.setId(""+id_location);
438
				node_id_loc.setId(""+id_location);
437
				node_id_loc.setText(id_location);
439
				node_id_loc.setText(id_location);
438
				String[] usObj = {id_location};
440
				String[] usObj = {id_location};
Line 451... Line 453...
451
				node_lieu.setText(lieuDit);
453
				node_lieu.setText(lieuDit);
452
				String[] usObj3 = {lieuDit};
454
				String[] usObj3 = {lieuDit};
453
				node_lieu.setUserObject(usObj3);
455
				node_lieu.setUserObject(usObj3);
454
				node_loc.appendChild(node_lieu) ;
456
				node_loc.appendChild(node_lieu) ;
Line -... Line 457...
-
 
457
				
455
				
458
				// TODO : améliorer la compararaison des noeuds
456
				root.sort(comparerNoeuds()) ;
459
				root.sort(comparerNoeuds()) ;
Line 457... Line 460...
457
			}
460
			}
458
				
461
				
Line 539... Line 542...
539
	{
542
	{
540
		return new Comparator<TreeNode>() {
543
		return new Comparator<TreeNode>() {
Line 541... Line 544...
541
 
544
 
Line -... Line 545...
-
 
545
			public int compare(TreeNode o1, TreeNode o2) {
-
 
546
				
-
 
547
				if(o1.getDepth() == 1 && o2.getDepth() == 1)
-
 
548
				{
-
 
549
					Integer n1 = Integer.parseInt(((String[])o1.getUserObject())[0]) ;
-
 
550
					Integer n2 = Integer.parseInt(((String[])o2.getUserObject())[0]) ;
-
 
551
					
-
 
552
					return n1.compareTo(n2) ;
-
 
553
				}
542
			public int compare(TreeNode o1, TreeNode o2) {
554
				else
543
				
555
				{
Line 544... Line 556...
544
				String n1 = o1.getText() ;
556
					String n1 = o1.getText() ;
-
 
557
					String n2 = o2.getText() ;
545
				String n2 = o2.getText() ;
558
				
Line 546... Line 559...
546
				
559
					return n1.compareTo(n2) ;
547
				return n1.compareTo(n2) ;
560
				}
548
			}
561
			}
549
			
562