Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 2622 → Rev 2568

/trunk/src/org/tela_botanica/client/vues/observation/filtres/ArbreEntiteGeographiqueObservationFiltreVue.java
3,7 → 3,6
import java.util.Comparator;
import java.util.Iterator;
 
import org.tela_botanica.client.i18n.Msg;
import org.tela_botanica.client.interfaces.Filtrable;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.objets.EntiteGeographiqueObservation;
82,7 → 81,7
public ArbreEntiteGeographiqueObservationFiltreVue(ObservationMediateur obs) {
 
// on crée le panel
super(Msg.get("localites"));
super("Localités");
this.observationMediateur = obs;
 
117,9 → 116,9
arbreEntitesGeographiques.setId("x-view-tree-filter-entity");
 
// on crée une racine pour l'arbre
TreeNode root = new TreeNode(Msg.get("localites"));
TreeNode root = new TreeNode("Localités");
root.setId("racine_entite");
String[] usObject = { Msg.get("localites") };
String[] usObject = { "Localités" };
root.setUserObject(usObject);
 
arbreEntitesGeographiques.setRootNode(root);
246,8 → 245,8
Tree nouvelArbre = new Tree() ;
TreeNode root = new TreeNode();
root.setId("racine_entite");
root.setText(Msg.get("localites"));
String[] usObjRoot = { Msg.get("localites") };
root.setText("Localités");
String[] usObjRoot = { "Localités"};
root.setUserObject(usObjRoot);
nouvelArbre.setRootNode(root);
286,7 → 285,7
arbreEntitesGeographiques.doLayout();
 
}
 
if(nouvelleDonnees instanceof Observation)
{
// Cas d'ajout unitaire d'une observation
297,14 → 296,14
if(!arbreCharge) {
return;
}
 
Observation obs = (Observation)nouvelleDonnees ;
EntiteGeographiqueObservation ent = new EntiteGeographiqueObservation(obs.getIdentifiantLocalite(),obs.getLocalite(),obs.getLieudit(),obs.getStation());
ent.setPays(obs.getPays());
 
creerHierarchieNoeud(arbreEntitesGeographiques.getTree(), arbreEntitesGeographiques.getRootNode(), ent);
 
doLayout();
doLayout();
arbreEntitesGeographiques.doLayout() ;
}
}
325,7 → 324,7
@Override
public String renvoyerNomFiltre() {
 
return Msg.get("localites");
return "Localités";
}
 
/**
388,7 → 387,7
}
}
 
public Comparator<TreeNode> comparerNoeuds()
{
return new Comparator<TreeNode>() {
448,9 → 447,9
arbreEntitesGeographiques.clear() ;
// on crée une racine pour l'arbre
TreeNode root = new TreeNode(Msg.get("localites"));
TreeNode root = new TreeNode("Localités");
root.setId("racine_entite");
String[] usObject = { Msg.get("localites") };
String[] usObject = { "Localités" };
root.setUserObject(usObject);
 
arbreEntitesGeographiques.setRootNode(root);
538,25 → 537,25
Node noeudMemeId = null;
String idNoeud = "";
String locNiveau = "";
 
Node noeudParent = root;
 
for(int i = 0; i < idLocalites.length; i++) {
// Recherche des noeuds correspondant à chacun des niveaux de la hierarchie
locNiveau = idLocalites[i];
idNoeud += idLocalites[i];
 
noeudMemeId = arbre.getNodeById(idNoeud);
 
// Si le noeud n'existe pas on le crée
if(noeudMemeId == null) {
noeudMemeId = creerNoeud(idNoeud, locNiveau);
noeudParent.appendChild(noeudMemeId) ;
}
 
noeudParent = noeudMemeId;
}
 
root.sort(comparerNoeuds()) ;
}
 
590,41 → 589,41
arbreEntitesGeographiques.getSelectionModel().select(noeudArbreEncours);
mettreAJourValeurEnCours(noeudArbreEncours);
 
continuer = false;
}
 
return continuer;
}
 
});
}
 
private int calculerProfondeurPourNomFiltre(String nom) {
 
int profondeur = 0;
 
if(nom.equals("pays")) {
profondeur = 1;
}
 
if(nom.equals("departement")) {
profondeur = 2;
}
 
if(nom.equals("localite")) {
profondeur = 3;
}
 
if(nom.equals("lieudit")) {
profondeur = 4;
}
 
if(nom.equals("station")) {
profondeur = 5;
}
 
return profondeur;
}
 
}
/trunk/src/org/tela_botanica/client/vues/observation/filtres/ArbreDateObservationFiltreVue.java
3,7 → 3,6
import java.util.Comparator;
import java.util.Iterator;
 
import org.tela_botanica.client.i18n.Msg;
import org.tela_botanica.client.interfaces.Filtrable;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.objets.DateObservation;
84,7 → 83,7
public ArbreDateObservationFiltreVue(ObservationMediateur obs) {
 
// on crée le panel
super(Msg.get("dates"));
super("Dates");
this.observationMediateur = obs;
 
120,9 → 119,9
arbreDonneesDates.setBorder(false);
 
// on crée une racine pour l'arbre
TreeNode root = new TreeNode(Msg.get("dates"));
TreeNode root = new TreeNode("Dates");
root.setId("racine_date");
String[] usObject = { Msg.get("dates"), "Dates", "racine_date" };
String[] usObject = { "Dates", "Dates", "racine_date" };
root.setUserObject(usObject);
 
arbreDonneesDates.setRootNode(root);
260,8 → 259,8
// on crée un arbre vide
TreeNode root = new TreeNode();
root.setId("racine_date");
root.setText(Msg.get("dates"));
String[] usObjRoot = { Msg.get("dates"), Msg.get("dates"), "racine_date"};
root.setText("Dates");
String[] usObjRoot = { "Dates", "Dates", "racine_date"};
root.setUserObject(usObjRoot);
Tree nouvelArbre = new Tree();
nouvelArbre.setRootNode(root);
509,7 → 508,7
@Override
public String renvoyerNomFiltre() {
 
return Msg.get("dates");
return "Dates";
}
 
/**
595,9 → 594,9
arbreDonneesDates.collapseAll();
arbreDonneesDates.clear();
TreeNode root = new TreeNode(Msg.get("dates"));
TreeNode root = new TreeNode("Dates");
root.setId("racine_date");
String[] usObject = { Msg.get("dates"), Msg.get("dates"), "racine_date" };
String[] usObject = { "Dates", "Dates", "racine_date" };
root.setUserObject(usObject);
 
arbreDonneesDates.setRootNode(root);
/trunk/src/org/tela_botanica/client/vues/observation/filtres/ArbreMotsClesObservationVue.java
1,5 → 1,4
package org.tela_botanica.client.vues.observation.filtres;
import org.tela_botanica.client.i18n.Msg;
import org.tela_botanica.client.interfaces.Filtrable;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.observation.ObservationMediateur;
117,7 → 116,7
*/
public ArbreMotsClesObservationVue(ObservationMediateur om) {
// on crée le panel
super(Msg.get("projets"));
super("Projets");
this.setLayout(new VerticalLayout());
oMediateur = om;
156,9 → 155,9
arbreMotsCles.setSelectionModel(msModel);
 
// on crée une racine pour l'arbre
TreeNode root = new TreeNode(Msg.get("projets"));
TreeNode root = new TreeNode("Projets");
root.setId("racine_obs");
String[] usObject = { Msg.get("projets"), "racine_obs" };
String[] usObject = { "Projets", "racine_obs" };
root.setUserObject(usObject);
root.setExpandable(true);
167,7 → 166,7
// on crée l'éditeur pour l'arbre
tfEdit = new TextField();
te = new TreeEditor(arbreMotsCles, tfEdit);
ajouterMotCle = new Button(Msg.get("ajouter-projet"));
ajouterMotCle = new Button("Ajouter un projet");
arbreMotsCles.add(te);
arbreMotsCles.getRootNode().addListener(new TreeNodeListenerAdapter() {
289,14 → 288,13
if(!MotsClesUtilitaire.estUnMotCleAutorise(text)) {
te.startEdit(node);
String[] params = { MotsClesUtilitaire.getChaineCaracteresInterdits() };
Window.alert(Msg.get("mot-cle-non-vide", params));
Window.alert("Un mot clé ne peut pas être vide ou contenir les caractères suivants : "+MotsClesUtilitaire.getChaineCaracteresInterdits());
return;
}
if(!MotsClesUtilitaire.estUnePositionAutorisee(node, node.getParentNode(), text)) {
te.startEdit(node);
Window.alert(Msg.get("mot-cle-existe-deja"));
Window.alert("Un mot clé de même nom existe déjà à cette position");
return;
}
 
326,7 → 324,7
boolean ok = true;
if(!MotsClesUtilitaire.estUnePositionAutorisee(node, newParent, node.getText())) {
ok = false;
Window.alert(Msg.get("mot-cle-existe-deja"));
Window.alert("Un mot clé de même nom existe déjà à cette position");
}
return ok;
}
458,7 → 456,7
// si ça n'est pas la racine (qu'on ne peut pas supprimer)
if (!n.getId().equals(getArbreMotsCles().getRootNode().getId())) {
if(Window.confirm(Msg.get("confirmer-suppression-projet"))) {
if(Window.confirm("Etes vous sur de vouloir supprimer ce projet ?")) {
// on détache le noeud et on le détruit
n.getParentNode().removeChild(n);
n.destroy();
470,7 → 468,7
} else {
// si l'utilisateur tente de supprimer la racine, on l'avertit de
// son erreur
Window.alert(Msg.get("impossible-supprimer-racine"));
Window.alert("Impossible de supprimer la racine de l'arbre");
}
}
 
684,9 → 682,9
arbreMotsCles.clear() ;
// on crée une racine pour l'arbre
TreeNode root = new TreeNode(Msg.get("projets"));
TreeNode root = new TreeNode("Projets");
root.setId("racine_obs");
String[] usObject = { Msg.get("projets"), "racine_obs" };
String[] usObject = { "Projets", "racine_obs" };
root.setUserObject(usObject);
root.setExpandable(true);
 
754,9 → 752,9
TreeEditor te) {
Menu mn = new Menu();
final com.gwtext.client.widgets.menu.Item ajoutN = new Item(
Msg.get("ajouter-projet"));
"Ajouter un projet");
final com.gwtext.client.widgets.menu.Item suppN = new Item(
Msg.get("supprimer-projet"));
"Supprimer projet");
 
mn.addItem(ajoutN);
mn.addItem(suppN);