Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 164 → Rev 165

/tags/v1.0-arrosoir/client/vues/ArbreDateObservationFiltreVue.java
136,7 → 136,7
// on crée une racine pour l'arbre
TreeNode root = new TreeNode("Dates");
root.setId("racine_date");
String[] usObject = { "Dates" };
String[] usObject = { "Dates", "Dates", "racine_date" };
root.setUserObject(usObject);
 
arbreDonneesDates.setRootNode(root);
256,8 → 256,6
boolean repandreRaffraichissement) {
if (nouvelleDonnees instanceof ListeDateObservation) {
GWT.log("AH ah ah ah ah je suis un canard",null);
String annee=null;
String mois=null;
269,9 → 267,10
TreeNode root = new TreeNode();
root.setId("racine_date");
root.setText("Dates");
String[] usObjRoot = { "Dates", "Dates"};
String[] usObjRoot = { "Dates", "Dates", "racine_date"};
root.setUserObject(usObjRoot);
donneesDates.setRootNode(root);
Tree nouvelArbre = new Tree();
nouvelArbre.setRootNode(root);
// on la parse et on récupère les informations qui nous interessent
for (Iterator<String> it= data.keySet().iterator(); it.hasNext();) {
291,16 → 290,16
jour="Inconnue" ;
}
Node noeudMemeAnnee = donneesDates.getNodeById(""+annee);
Node noeudMemeAnnee = nouvelArbre.getNodeById(""+annee);
// si la région existe déjà
if(noeudMemeAnnee != null)
{
// on teste si la localité existe
Node noeudMemeMois = donneesDates.getNodeById(""+(annee+mois));
Node noeudMemeMois = nouvelArbre.getNodeById(""+(annee+mois));
if(noeudMemeMois != null)
{
// enfin on teste si le lieu dit existe
Node noeudMemeJour = donneesDates.getNodeById(""+(annee+mois+jour));
Node noeudMemeJour = nouvelArbre.getNodeById(""+(annee+mois+jour));
if(noeudMemeJour != null)
{
// tous les noeuds existent déjà, normalement ça ne devrait pas arriver
312,7 → 311,7
node_jour.setId(""+(annee+mois+jour));
node_jour.setText(jour);
noeudMemeMois.appendChild(node_jour) ;
String[] usObj = {jour,jour};
String[] usObj = {jour,jour,annee+mois+jour};
node_jour.setUserObject(usObj);
}
}
322,7 → 321,7
node_mois.setId(""+(annee+mois));
node_mois.setText(moisLettre);
noeudMemeAnnee.appendChild(node_mois) ;
String[] usObj = {moisLettre,mois};
String[] usObj = {moisLettre,mois,annee+mois};
node_mois.setUserObject(usObj);
TreeNode node_jour = new TreeNode();
329,7 → 328,7
node_jour.setId(""+(annee+mois+jour));
node_jour.setText(jour);
node_mois.appendChild(node_jour) ;
String[] usObj2 = {jour,jour};
String[] usObj2 = {jour,jour,annee+mois+jour};
node_jour.setUserObject(usObj2);
}
340,7 → 339,7
node_annee.setId(""+annee);
node_annee.setText(annee);
root.appendChild(node_annee) ;
String[] usObj = {annee, annee};
String[] usObj = {annee, annee, annee};
node_annee.setUserObject(usObj);
TreeNode node_mois = new TreeNode();
347,7 → 346,7
node_mois.setId(""+(annee+mois));
node_mois.setText(moisLettre);
node_annee.appendChild(node_mois) ;
String[] usObj2 = {moisLettre,mois};
String[] usObj2 = {moisLettre,mois,annee+mois};
node_mois.setUserObject(usObj2);
TreeNode node_jour = new TreeNode();
354,12 → 353,16
node_jour.setId(""+(annee+mois+jour));
node_jour.setText(jour);
node_mois.appendChild(node_jour) ;
String[] usObj3 = {jour,jour};
String[] usObj3 = {jour,jour,annee+mois+jour};
node_jour.setUserObject(usObj3);
}
 
}
// on trie
root.sort(comparerNoeuds()) ;
// on vide tous les noeuds
arbreDonneesDates.getRootNode().eachChild(new NodeTraversalCallback() {
372,11 → 375,8
});
 
// et on recopie le nouvel arbre
copierFilsNoeud(donneesDates.getRootNode(), arbreDonneesDates
copierFilsNoeud(nouvelArbre.getRootNode(), arbreDonneesDates
.getRootNode());
// on trie
root.sort(comparerNoeuds()) ;
// si l'arbre n'était pas encore considéré comme instancié
if (!estInstancie) {
420,16 → 420,16
jour="Inconnue" ;
}
Node noeudMemeAnnee = donneesDates.getNodeById(""+annee);
Node noeudMemeAnnee = arbreDonneesDates.getNodeById(""+annee);
// si la région existe déjà
if(noeudMemeAnnee != null)
{
// on teste si la localité existe
Node noeudMemeMois = donneesDates.getNodeById(""+(annee+mois));
Node noeudMemeMois = arbreDonneesDates.getNodeById(""+(annee+mois));
if(noeudMemeMois != null)
{
// enfin on teste si le lieu dit existe
Node noeudMemeJour = donneesDates.getNodeById(""+(annee+mois+jour));
Node noeudMemeJour = arbreDonneesDates.getNodeById(""+(annee+mois+jour));
if(noeudMemeJour != null)
{
// tous les noeuds existent déjà, normalement ça ne devrait pas arriver
440,7 → 440,7
TreeNode node_jour = new TreeNode();
node_jour.setId(""+(annee+mois+jour));
node_jour.setText(jour);
String[] usObj = {jour,jour};
String[] usObj = {jour,jour,annee+mois+jour};
node_jour.setUserObject(usObj);
noeudMemeMois.appendChild(node_jour) ;
452,16 → 452,14
TreeNode node_mois = new TreeNode();
node_mois.setId(""+(annee+mois));
node_mois.setText(moisLettre);
String[] usObj = {moisLettre,mois};
String[] usObj = {moisLettre,mois,annee+mois};
node_mois.setUserObject(usObj);
noeudMemeAnnee.appendChild(node_mois) ;
Window.alert("on crée on nouveau mois "+node_mois.getId()) ;
TreeNode node_jour = new TreeNode();
node_jour.setId(""+(annee+mois+jour));
node_jour.setText(jour);
String[] usObj2 = {jour,jour};
String[] usObj2 = {jour,jour,annee+mois+jour};
node_jour.setUserObject(usObj2);
node_mois.appendChild(node_jour) ;
474,7 → 472,7
TreeNode node_annee = new TreeNode();
node_annee.setId(""+annee);
node_annee.setText(annee);
String[] usObj = {annee,annee};
String[] usObj = {annee,annee,annee};
node_annee.setUserObject(usObj);
root.appendChild(node_annee) ;
481,7 → 479,7
TreeNode node_mois = new TreeNode();
node_mois.setId(""+(annee+mois));
node_mois.setText(moisLettre);
String[] usObj2 = {moisLettre,mois};
String[] usObj2 = {moisLettre,mois,annee+mois};
node_mois.setUserObject(usObj2);
node_annee.appendChild(node_mois) ;
488,7 → 486,7
TreeNode node_jour = new TreeNode();
node_jour.setId(""+(annee+mois+jour));
node_jour.setText(jour);
String[] usObj3 = {jour,jour};
String[] usObj3 = {jour,jour,annee+mois+jour};
node_jour.setUserObject(usObj3);
node_mois.appendChild(node_jour) ;
550,6 → 548,7
String[] usObj = (String[]) ndNodeFils[i].getUserObject();
TreeNode child = new TreeNode(usObj[0]);
child.setUserObject(usObj);
child.setId(""+usObj[2]);
ndPereCopie.appendChild(child);
 
if (!ndNodeFils[i].isLeaf()) {
632,7 → 631,7
TreeNode root = new TreeNode("Dates");
root.setId("racine_date");
String[] usObject = { "Dates" };
String[] usObject = { "Dates", "Dates", "racine_date" };
root.setUserObject(usObject);
 
arbreDonneesDates.setRootNode(root);
654,4 → 653,4
}
 
 
}
}
/tags/v1.0-arrosoir/client/vues/ArbreEntiteGeographiqueObservationFiltreVue.java
261,12 → 261,13
ListeEntiteGeographiqueObservation data = (ListeEntiteGeographiqueObservation) nouvelleDonnees ;
// on crée un arbre vide
Tree nouvelArbre = new Tree() ;
TreeNode root = new TreeNode();
root.setId("racine_entite");
root.setText("Localités");
String[] usObjRoot = { "Localités"};
root.setUserObject(usObjRoot);
donneeEntitesGeographiques.setRootNode(root);
nouvelArbre.setRootNode(root);
// on la parse et on récupère les informations qui nous interessent
for (Iterator<String> it= data.keySet().iterator(); it.hasNext();) {
292,16 → 293,17
lieuDit="Inconnue" ;
}
Node noeudMemeId = donneeEntitesGeographiques.getNodeById(""+id_location);
Node noeudMemeId = nouvelArbre.getNodeById(""+id_location);
// si la région existe déjà
if(noeudMemeId != null)
{
// on teste si la localité existe
Node noeudMemeLoc = donneeEntitesGeographiques.getNodeById(""+(id_location+location));
Node noeudMemeLoc = nouvelArbre.getNodeById(""+(id_location+location));
if(noeudMemeLoc != null)
{
// enfin on teste si le lieu dit existe
Node noeudMemeLieu = donneeEntitesGeographiques.getNodeById(""+(id_location+location+lieuDit));
Node noeudMemeLieu = nouvelArbre.getNodeById(""+(id_location+location+lieuDit));
if(noeudMemeLieu != null)
{
// tous les noeuds existent déjà, normalement ça ne devrait pas arriver
313,7 → 315,7
node_lieu.setId(""+(id_location+location+lieuDit));
node_lieu.setText(lieuDit);
noeudMemeLoc.appendChild(node_lieu) ;
String[] usObj = {lieuDit};
String[] usObj = {lieuDit,id_location+location+lieuDit};
node_lieu.setUserObject(usObj);
}
}
323,7 → 325,7
node_loc.setId(""+(id_location+location));
node_loc.setText(location);
noeudMemeId.appendChild(node_loc) ;
String[] usObj = {location};
String[] usObj = {location,id_location+location};
node_loc.setUserObject(usObj);
TreeNode node_lieu = new TreeNode();
330,7 → 332,7
node_lieu.setId(""+(id_location+location+lieuDit));
node_lieu.setText(lieuDit);
node_loc.appendChild(node_lieu) ;
String[] usObj2 = {lieuDit};
String[] usObj2 = {lieuDit,id_location+location+lieuDit};
node_lieu.setUserObject(usObj2);
}
341,7 → 343,7
node_id_loc.setId(""+id_location);
node_id_loc.setText(id_location);
root.appendChild(node_id_loc) ;
String[] usObj = {id_location};
String[] usObj = {id_location,id_location};
node_id_loc.setUserObject(usObj);
TreeNode node_loc = new TreeNode();
348,7 → 350,7
node_loc.setId(""+(id_location+location));
node_loc.setText(location);
node_id_loc.appendChild(node_loc) ;
String[] usObj2 = {location};
String[] usObj2 = {location,id_location+location};
node_loc.setUserObject(usObj2);
TreeNode node_lieu = new TreeNode();
355,7 → 357,7
node_lieu.setId(""+(id_location+location+lieuDit));
node_lieu.setText(lieuDit);
node_loc.appendChild(node_lieu) ;
String[] usObj3 = {lieuDit};
String[] usObj3 = {lieuDit,id_location+location+lieuDit};
node_lieu.setUserObject(usObj3);
}
374,10 → 376,8
}
});
copierFilsNoeud(root, arbreEntitesGeographiques.getRootNode());
 
// et on recopie le nouvel arbre
copierFilsNoeud(donneeEntitesGeographiques.getRootNode(), arbreEntitesGeographiques
.getRootNode());
// si l'arbre n'était pas encore considéré comme instancié
if (!estInstancie) {
389,7 → 389,7
filtreModifie = false;
//show() ;
doLayout();
arbreEntitesGeographiques.doLayout();
 
}
426,16 → 426,16
lieuDit="Inconnue" ;
}
Node noeudMemeId = donneeEntitesGeographiques.getNodeById(""+id_location);
Node noeudMemeId = arbreEntitesGeographiques.getNodeById(""+id_location);
// si la région existe déjà
if(noeudMemeId != null)
{
// on teste si la localité existe
Node noeudMemeLoc = donneeEntitesGeographiques.getNodeById(""+(id_location+location));
Node noeudMemeLoc = arbreEntitesGeographiques.getNodeById(""+(id_location+location));
if(noeudMemeLoc != null)
{
// enfin on teste si le lieu dit existe
Node noeudMemeLieu = donneeEntitesGeographiques.getNodeById(""+(id_location+location+lieuDit));
Node noeudMemeLieu = arbreEntitesGeographiques.getNodeById(""+(id_location+location+lieuDit));
if(noeudMemeLieu != null)
{
// tous les noeuds existent déjà, normalement ça ne devrait pas arriver
446,7 → 446,7
TreeNode node_lieu = new TreeNode();
node_lieu.setId(""+(id_location+location+lieuDit));
node_lieu.setText(lieuDit);
String[] usObj = {lieuDit};
String[] usObj = {lieuDit,id_location+location+lieuDit};
node_lieu.setUserObject(usObj);
noeudMemeLoc.appendChild(node_lieu) ;
458,7 → 458,7
TreeNode node_loc = new TreeNode();
node_loc.setId(""+(id_location+location));
node_loc.setText(location);
String[] usObj = {location};
String[] usObj = {location,id_location+location};
node_loc.setUserObject(usObj);
noeudMemeId.appendChild(node_loc) ;
465,7 → 465,7
TreeNode node_lieu = new TreeNode();
node_lieu.setId(""+(id_location+location+lieuDit));
node_lieu.setText(lieuDit);
String[] usObj2 = {lieuDit};
String[] usObj2 = {lieuDit,id_location+location+lieuDit};
node_lieu.setUserObject(usObj2);
node_loc.appendChild(node_lieu) ;
480,7 → 480,7
TreeNode node_id_loc = new TreeNode();
node_id_loc.setId(""+id_location);
node_id_loc.setText(id_location);
String[] usObj = {id_location};
String[] usObj = {id_location,id_location};
node_id_loc.setUserObject(usObj);
root.appendChild(node_id_loc) ;
487,7 → 487,7
TreeNode node_loc = new TreeNode();
node_loc.setId(""+(id_location+location));
node_loc.setText(location);
String[] usObj2 = {location};
String[] usObj2 = {location,id_location+location};
node_loc.setUserObject(usObj2);
node_id_loc.appendChild(node_loc) ;
494,7 → 494,7
TreeNode node_lieu = new TreeNode();
node_lieu.setId(""+(id_location+location+lieuDit));
node_lieu.setText(lieuDit);
String[] usObj3 = {lieuDit};
String[] usObj3 = {lieuDit,id_location+location+lieuDit};
node_lieu.setUserObject(usObj3);
node_loc.appendChild(node_lieu) ;
555,6 → 555,7
String[] usObj = (String[]) ndNodeFils[i].getUserObject();
TreeNode child = new TreeNode(usObj[0]);
child.setUserObject(usObj);
child.setId(""+usObj[1]);
ndPereCopie.appendChild(child);
 
if (!ndNodeFils[i].isLeaf()) {