423,14 → 423,13 |
|
case KEY_ENTER: |
|
if (selectionEspece) { |
selectionEspece=false; |
} |
else { |
validerSaisie(Champs.ESPECE); |
} |
if(selectionEspece) { |
selectionEspece=false; |
} |
else { |
validerSaisie(Champs.ESPECE); |
} |
|
|
break; |
|
default: |
479,7 → 478,7 |
} |
}); |
|
comment.addKeyPressListener(new EventCallback() { |
/*comment.addKeyPressListener(new EventCallback() { |
|
public void execute(EventObject e) { |
// TODO Auto-generated method stub |
492,7 → 491,7 |
default: |
} |
} |
}); |
});*/ |
|
|
|
677,6 → 676,13 |
String str = (String)nouvelleDonnees ; |
observationMediateur.obtenirNombreObservation() ; |
} |
|
if(nouvelleDonnees instanceof String[]) { |
String[] anumNom = (String[])nouvelleDonnees ; |
numeroNom = anumNom[1]; |
espece.setValue(anumNom[0]); |
setModification("false"); |
} |
|
} |
|
702,6 → 708,29 |
|
|
public void ajouterObservation() { |
|
if(departement.equals("000null") || departement.equals("")) { |
String[] depCom = commune.getText().split(" "); |
if(depCom.length > 1) { |
String dep = depCom[1].replace('(', ' '); |
dep =dep.replace(')', ' '); |
dep = dep.trim(); |
dep = dep.replace('\\',' '); |
dep = dep.trim(); |
|
try |
{ |
int nDep = Integer.parseInt(dep); |
if(nDep > 0 && nDep < 110) { |
departement = dep ; |
} |
} |
catch(NumberFormatException e) |
{ |
departement = "" ; |
} |
} |
} |
|
Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getRawValue()); |
observationMediateur.ajouterObservation(obs); |
724,7 → 753,14 |
public void afficherDetailsObservation(Observation obs) |
{ |
raz() ; |
char g ; |
|
String idLoc =obs.getIdentifiantLocalite().replaceAll(" ","/"); |
idLoc = idLoc.replaceAll("%",""); |
idLoc = idLoc.replaceAll("\"",""); |
idLoc = idLoc.replace('\\',' '); |
idLoc = idLoc.trim(); |
|
if(!obs.getDate().equals("null") && !obs.getDate().equals("000null")) { |
String[] dateEtHeure = obs.getDate().split(" ", 2); |
if(verifierFormatDate(dateEtHeure[0])) { |
748,10 → 784,16 |
comment.setValue(obs.getCommentaire()) ; |
} |
if(!obs.getLocalite().equals("null") && !obs.getLocalite().equals("000null")) { |
commune.setValue(obs.getLocalite()) ; |
if(!idLoc.equals("000null")) { |
commune.setValue(obs.getLocalite()+" ("+idLoc+")") ; |
} |
else |
{ |
commune.setValue(obs.getLocalite()); |
} |
} |
if(!obs.getIdentifiantLocalite().equals("null") && !obs.getIdentifiantLocalite().equals("000null")) { |
departement = obs.getIdentifiantLocalite(); |
departement = idLoc; |
} |
if(!obs.getNomSaisi().equals("null") && !obs.getNomSaisi().equals("000null")) { |
espece.setValue(obs.getNomSaisi()) ; |