102,10 → 102,12 |
|
this.setPaddings(5); |
|
this.setBorder(false); |
this.setCollapsible(true); |
this.setAutoWidth(true); |
this.setAutoScroll(true) ; |
|
if (GWT.isScript()) { |
setAutoScroll(true); |
} |
|
|
// on ajoute les listeners |
128,12 → 130,6 |
arbreEntitesGeographiques.setEnableDD(false); |
arbreEntitesGeographiques.setId("x-view-tree-filter-entity"); |
arbreEntitesGeographiques.setAutoWidth(false); |
|
if (GWT.isScript()) { |
arbreEntitesGeographiques.setAutoScroll(true); |
} |
|
arbreEntitesGeographiques.setBorder(false); |
|
// on crée une racine pour l'arbre |
TreeNode root = new TreeNode("Localités"); |
182,10 → 178,9 |
case 0: |
if(!arbreCharge) |
{ |
ExtElement masked = Ext.get(arbreEntitesGeographiques.getId()); |
masked.mask("Chargement"); |
observationMediateur.obtenirListeEntiteGeographique() ; |
arbreCharge = true ; |
/*observationMediateur.obtenirListeEntiteGeographique() ; |
arbreCharge = true ;*/ |
arbreEntitesGeographiques.getRootNode().expand(); |
} |
else |
{ |
220,8 → 215,6 |
public void onExpand(Node node) { |
if(!arbreCharge) |
{ |
ExtElement masked = Ext.get(arbreEntitesGeographiques.getId()); |
masked.mask("Chargement"); |
observationMediateur.obtenirListeEntiteGeographique() ; |
arbreCharge = true ; |
} |
236,7 → 229,7 |
public void rafraichir(Object nouvelleDonnees, |
boolean repandreRaffraichissement) { |
|
|
|
if (nouvelleDonnees instanceof ListeEntiteGeographiqueObservation) { |
|
String id_location=null; |
259,18 → 252,19 |
EntiteGeographiqueObservation ent=(EntiteGeographiqueObservation) data.get(it.next()); |
|
id_location=ent.getIdLocation(); |
id_location = id_location.replaceAll("\"", ""); |
location=ent.getLocation(); |
lieuDit=ent.getLieuDit(); |
|
if(id_location.contains("000null")) { |
if(id_location.contains("000null") || id_location.equals(null) || (id_location.trim()).equals("")) { |
id_location="Inconnue" ; |
} |
|
if(location.contains("000null")) { |
if(location.contains("000null") || location.equals(null) || (location.trim().equals(""))) { |
location="Inconnue" ; |
} |
|
if(lieuDit.contains("000null")) { |
if(lieuDit.contains("000null") || lieuDit.equals(null) || (lieuDit.trim().equals(""))) { |
lieuDit="Inconnue" ; |
} |
|
370,9 → 364,6 |
// l'état du filtre est réinitialisé |
filtreModifie = false; |
|
ExtElement masked = Ext.get(arbreEntitesGeographiques.getId()); |
masked.unmask(); |
|
//show() ; |
doLayout(); |
|
379,25 → 370,32 |
} |
|
if(nouvelleDonnees instanceof Observation) |
{ |
{ |
// si l'arbre n'est pas encore chargé, on ne tient pas compte de l'ajout |
// l'arbre complet sera de toute façon renvoyé plus tard lors du premier chargement |
// de l'arbre |
if(!arbreCharge) { |
return; |
} |
|
Observation obs = (Observation)nouvelleDonnees ; |
|
String id_location= obs.getIdentifiantLocalite(); |
id_location.replaceAll("\"", "") ; |
id_location = id_location.replaceAll("\"", ""); |
String location=obs.getLocalite(); |
String lieuDit=obs.getLieudit(); |
|
Node root = arbreEntitesGeographiques.getRootNode() ; |
|
if(id_location.contains("000null") || id_location.equals(null)) { |
if(id_location.contains("000null") || id_location.equals(null) || (id_location.trim()).equals("")) { |
id_location="Inconnue" ; |
} |
|
if(location.contains("000null") || location.equals(null)) { |
if(location.contains("000null") || location.equals(null) || (location.trim().equals(""))) { |
location="Inconnue" ; |
} |
|
if(lieuDit.contains("000null") || lieuDit.equals(null)) { |
if(lieuDit.contains("000null") || lieuDit.equals(null) || (lieuDit.trim().equals(""))) { |
lieuDit="Inconnue" ; |
} |
|
581,9 → 579,17 |
l2 = "0"+l2; |
} |
|
Integer n1 = Integer.parseInt(l1) ; |
Integer n2 = Integer.parseInt(l2) ; |
Integer n1 = 0; |
Integer n2 = 0; |
|
try{ |
n1 = Integer.parseInt(l1) ; |
n2 = Integer.parseInt(l2) ; |
} catch(NumberFormatException ne) { |
n1 = 0; |
n2 = 0; |
} |
|
return n1.compareTo(n2) ; |
} |
else |