Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 195 Rev 199
Line 1... Line 1...
1
package org.tela_botanica.client.vues.observation;
1
package org.tela_botanica.client.vues.observation.filtres;
Line 2... Line 2...
2
 
2
 
3
import java.util.Comparator;
3
import java.util.Comparator;
Line 4... Line 4...
4
import java.util.Iterator;
4
import java.util.Iterator;
Line 22... Line 22...
22
import com.gwtext.client.widgets.tree.event.TreeNodeListenerAdapter;
22
import com.gwtext.client.widgets.tree.event.TreeNodeListenerAdapter;
23
import com.gwtext.client.widgets.tree.event.TreePanelListenerAdapter;
23
import com.gwtext.client.widgets.tree.event.TreePanelListenerAdapter;
24
import com.gwtext.client.core.EventObject;
24
import com.gwtext.client.core.EventObject;
Line 25... Line 25...
25
 
25
 
26
/**
26
/**
27
 * fenêtre de recherche affichant l'arbre des mots clés en lecture et un bouton
27
 * Arbre Filtrant sur les entites geographiques 
28
 * cliquable
28
 *
29
 * 
29
 * 
30
 * @author aurelien
30
 * @author aurelien + david
31
 * 
31
 * 
-
 
32
 */
-
 
33
 
32
 */
34
 
33
public class ArbreEntiteGeographiqueObservationFiltreVue extends Panel implements Rafraichissable,
35
public class ArbreEntiteGeographiqueObservationFiltreVue extends Panel implements Rafraichissable,
Line 34... Line 36...
34
		Filtrable {
36
		Filtrable {
35
 
37
 
Line 47... Line 49...
47
	 * Le treepanel qui affiche l'arbre
49
	 * Le treepanel qui affiche l'arbre
48
	 */
50
	 */
49
	private TreePanel arbreEntitesGeographiques = null;
51
	private TreePanel arbreEntitesGeographiques = null;
Line 50... Line -...
50
 
-
 
51
 
-
 
52
 
-
 
53
	/**
-
 
54
	 * La structure de donnees qui stocke l'arbre. Utilisee a ce niveau car trop liee a la vue
-
 
55
	 */
-
 
56
	
-
 
57
	private Tree donneeEntitesGeographiques = new Tree();;
52
 
58
	
53
 
59
	/**
54
	/**
60
	 * booléen d'initialisation
55
	 * booléen d'initialisation
Line 61... Line 56...
61
	 */
56
	 */
62
	private boolean estInstancie = false;
57
	private boolean estInstancie = false;
63
 
58
 
64
	/**
59
	/**
65
	 * booléen d'etat
-
 
66
	 */
60
	 * booléen d'etat
Line 67... Line 61...
67
	private boolean filtreModifie = false;
61
	 */
Line 68... Line 62...
68
	
62
	private boolean filtreModifie = false;
Line 193... Line 187...
193
					default: 
187
					default: 
194
						break;
188
						break;
195
				}
189
				}
Line 196... Line 190...
196
				
190
				
-
 
191
				filtreModifie = true ;
-
 
192
				
-
 
193
				// Le filtre est modifie : on lance un rafraaaichissement de la liste des observations affichees
197
				filtreModifie = true ;
194
				
Line 198... Line 195...
198
				observationMediateur.obtenirNombreObservation() ;
195
				observationMediateur.obtenirNombreObservation() ;
Line 199... Line 196...
199
				
196
				
Line 312... Line 309...
312
								node_lieu.setUserObject(usObj);
309
								node_lieu.setUserObject(usObj);
313
							}
310
							}
314
						}
311
						}
315
						else
312
						else
316
						{
313
						{
-
 
314
							//  on  crée  le noeud de la location
317
							TreeNode node_loc = new TreeNode();
315
							TreeNode node_loc = new TreeNode();
318
							node_loc.setId(""+(id_location+location));
316
							node_loc.setId(""+(id_location+location));
319
							node_loc.setText(location);
317
							node_loc.setText(location);
320
							noeudMemeId.appendChild(node_loc) ;
318
							noeudMemeId.appendChild(node_loc) ;
321
							String[] usObj = {location,id_location+location};
319
							String[] usObj = {location,id_location+location};
Line 330... Line 328...
330
							
328
							
331
						}
329
						}
332
					}
330
					}
333
					else
331
					else
-
 
332
					{
334
					{
333
						//  on  crée  le noeud de l'identifiant  location
335
						TreeNode node_id_loc = new TreeNode();
334
						TreeNode node_id_loc = new TreeNode();
336
						node_id_loc.setId(""+id_location);
335
						node_id_loc.setId(""+id_location);
337
						node_id_loc.setText(id_location);
336
						node_id_loc.setText(id_location);
338
						root.appendChild(node_id_loc) ;
337
						root.appendChild(node_id_loc) ;
Line 367... Line 366...
367
						node.remove();
366
						node.remove();
368
						return true;
367
						return true;
369
					}
368
					}
Line 370... Line 369...
370
	
369
	
-
 
370
				});
371
				});
371
				
Line 372... Line 372...
372
				copierFilsNoeud(root, arbreEntitesGeographiques.getRootNode());
372
				copierFilsNoeud(root, arbreEntitesGeographiques.getRootNode());
-
 
373
 
373
 
374
	
374
	
375
				// si l'arbre n'était pas encore considéré comme instancié
375
				// si l'arbre n'était pas encore considéré comme instancié
376
				
376
				if (!estInstancie) {
377
				if (!estInstancie) {
Line 386... Line 387...
386
 
387
 
Line 387... Line 388...
387
			}
388
			}
388
		
389
		
-
 
390
		if(nouvelleDonnees instanceof Observation)
-
 
391
		{	
389
		if(nouvelleDonnees instanceof Observation)
392
			// Cas d'ajout unitaire d'une observation
390
		{	
393
			
391
			// si l'arbre n'est pas encore chargé, on ne tient pas compte de l'ajout
394
			// si l'arbre n'est pas encore chargé, on ne tient pas compte de l'ajout
392
			// l'arbre complet sera de toute façon renvoyé plus tard lors du premier chargement
395
			// l'arbre complet sera de toute façon renvoyé plus tard lors du premier chargement
393
			// de l'arbre
396
			// de l'arbre
Line 446... Line 449...
446
							root.sort(comparerNoeuds()) ;
449
							root.sort(comparerNoeuds()) ;
447
						}
450
						}
448
					}
451
					}
449
					else
452
					else
450
					{
453
					{
-
 
454
						//  on  crée  le noeud de la location
451
						TreeNode node_loc = new TreeNode();
455
						TreeNode node_loc = new TreeNode();
452
						node_loc.setId(""+(id_location+location));
456
						node_loc.setId(""+(id_location+location));
453
						node_loc.setText(location);
457
						node_loc.setText(location);
454
						String[] usObj = {location,id_location+location};
458
						String[] usObj = {location,id_location+location};
455
						node_loc.setUserObject(usObj);
459
						node_loc.setUserObject(usObj);
Line 468... Line 472...
468
			}
472
			}
469
			else
473
			else
470
			{
474
			{
471
				// TODO: Pourquoi l'ajout ne marche que sur la racine ?
475
				// TODO: Pourquoi l'ajout ne marche que sur la racine ?
Line -... Line 476...
-
 
476
				
-
 
477
				//  on  crée  le noeud de l'id location
472
				
478
				
473
				TreeNode node_id_loc = new TreeNode();
479
				TreeNode node_id_loc = new TreeNode();
474
				node_id_loc.setId(""+id_location);
480
				node_id_loc.setId(""+id_location);
475
				node_id_loc.setText(id_location);
481
				node_id_loc.setText(id_location);
476
				String[] usObj = {id_location,id_location};
482
				String[] usObj = {id_location,id_location};