Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 84 → Rev 85

/trunk/src/org/tela_botanica/client/vues/ArbreEntiteGeographiqueObservationFiltreVue.java
21,6 → 21,8
import com.gwtext.client.widgets.event.PanelListenerAdapter;
import com.gwtext.client.widgets.tree.TreeNode;
import com.gwtext.client.widgets.tree.TreePanel;
import com.gwtext.client.widgets.tree.event.TreePanelListenerAdapter;
import com.gwtext.client.core.EventObject;
 
/**
* fenêtre de recherche affichant l'arbre des mots clés en lecture et un bouton
65,6 → 67,10
*/
private boolean filtreModifie = false;
 
private String[] valeursFiltrees = null ;
private boolean arbreCharge = false ;
 
/**
* Constructeur sans argument (privé car ne doit pas être utilisé)
*/
131,6 → 137,7
arbreEntitesGeographiques.setRootNode(root);
arbreEntitesGeographiques.setRootVisible(true);
arbreEntitesGeographiques.setBorder(false);
root.setExpandable(true) ;
 
add(arbreEntitesGeographiques);
 
153,7 → 160,39
* ajoute les listeners pour les boutons et le cochage des entites
*/
private void ajouterListeners() {
 
arbreEntitesGeographiques.addListener(new TreePanelListenerAdapter() {
public void onClick(TreeNode node, EventObject e) {
String nomFiltre = "" ;
switch(node.getDepth())
{
case 0:
if(!arbreCharge)
{
observationMediateur.obtenirListeEntiteGeographique() ;
arbreCharge = true ;
}
return ;
case 1: nomFiltre = "id_location";
break;
case 2: nomFiltre = "location";
break;
case 3: nomFiltre = "lieudit";
break;
default:
break;
}
entitesGeographiquesEncours = node.getText() ;
filtreModifie = true ;
observationMediateur.obtenirListeObservation() ;
}
}) ;
}
 
/**
192,10 → 231,10
entite=ent.getEntite();
if(entite.contains("000null")) {
entite="Inconnue" ;
}
if(entite.contains("000null") ) {
entite="Inconnue";
}
idEntite=ent.getIdEntite();
idParent=ent.getIdParent();
218,8 → 257,11
node.setId(idEntite);
node.setText(entite);
Node parentNode = donneeEntitesGeographiques.getNodeById(idParent);
node.setUserObject(usObj);
parentNode.appendChild(node);
if(parentNode != null)
{
node.setUserObject(usObj);
parentNode.appendChild(node);
}
}
}
 
281,9 → 323,12
public String[] renvoyerValeursAFiltrer() {
 
valider();
if(filtreModifie) {
valeursFiltrees[0] = "localites" ;
valeursFiltrees[1] = entitesGeographiquesEncours ;
}
 
String[] valeursFiltrees = { "localites", entitesGeographiquesEncours };
 
return valeursFiltrees;
}
 
304,7 → 349,6
 
String[] usObj = (String[]) ndNodeFils[i].getUserObject();
TreeNode child = new TreeNode(usObj[0]);
child.setId(usObj[0] + "_filtre");
child.setUserObject(usObj);
ndPereCopie.appendChild(child);