Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 90 → Rev 91

/trunk/src/org/tela_botanica/client/vues/ArbreDateObservationFiltreVue.java
New file
0,0 → 1,595
package org.tela_botanica.client.vues;
 
import java.util.Comparator;
import java.util.Iterator;
 
import org.tela_botanica.client.interfaces.Filtrable;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.DateObservation;
import org.tela_botanica.client.modeles.EntiteGeographiqueObservation;
import org.tela_botanica.client.modeles.ListeDateObservation;
import org.tela_botanica.client.modeles.ListeEntiteGeographiqueObservation;
import org.tela_botanica.client.modeles.ListeObservation;
import org.tela_botanica.client.modeles.Observation;
import org.tela_botanica.client.observation.ObservationMediateur;
 
import com.google.gwt.core.client.GWT;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Label;
import com.gwtext.client.data.Node;
import com.gwtext.client.data.NodeTraversalCallback;
import com.gwtext.client.data.Tree;
import com.gwtext.client.data.event.NodeListenerAdapter;
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Panel;
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.TreeNodeListenerAdapter;
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
* cliquable
*
* @author aurelien
*
*/
public class ArbreDateObservationFiltreVue extends Panel implements Rafraichissable,
Filtrable {
 
/**
* Le médiateur associé à la vue
*/
private ObservationMediateur observationMediateur = null;
 
/**
* Les localites en cours
*/
private String donneesDateEnCours = "";
 
/**
* Le treepanel qui affiche l'arbre
*/
private TreePanel arbreDonneesDates = null;
 
 
 
/**
* La structure de donnees qui stocke l'arbre. Utilisee a ce niveau car trop liee a la vue
*/
private Tree donneesDates = new Tree();
/**
* booléen d'initialisation
*/
private boolean estInstancie = false;
 
/**
* booléen d'etat
*/
private boolean filtreModifie = false;
private boolean arbreCharge = false ;
 
private String nomFiltre = "" ;
/**
* Constructeur sans argument (privé car ne doit pas être utilisé)
*/
@SuppressWarnings("unused")
private ArbreDateObservationFiltreVue() {
super();
}
 
/**
* Constructeur avec paramètres
*
* @param im
* le médiateur à associer
*/
public ArbreDateObservationFiltreVue(ObservationMediateur obs) {
 
// on crée le panel
super("Dates");
this.observationMediateur = obs;
 
arbreDonneesDates = new TreePanel();
 
this.setPaddings(5);
 
this.setBorder(false);
this.setCollapsible(true);
this.setAutoWidth(true);
 
 
// on ajoute les listeners
ajouterListenersPanel();
estInstancie = false;
}
 
/**
* Ajoute les listeners pour le rendu du panel
*/
private void ajouterListenersPanel() {
this.addListener(new PanelListenerAdapter() {
 
// on instancie réellement les composants au moment du rendu pour
// accélérer l'affichage
// et éviter des bugs
public void onRender(Component component) {
 
// on interdit le drag and drop dans l'arbre
arbreDonneesDates.setEnableDD(false);
arbreDonneesDates.setId("x-view-tree-filter-date");
arbreDonneesDates.setAutoWidth(false);
if (GWT.isScript()) {
arbreDonneesDates.setAutoScroll(true);
}
arbreDonneesDates.setBorder(false);
 
// on crée une racine pour l'arbre
TreeNode root = new TreeNode("Dates");
root.setId("racine_date");
String[] usObject = { "Dates" };
root.setUserObject(usObject);
 
arbreDonneesDates.setRootNode(root);
arbreDonneesDates.setRootVisible(true);
arbreDonneesDates.setBorder(false);
root.setExpandable(true) ;
 
add(arbreDonneesDates);
 
// on ajoute les listeners d'évenements
ajouterListeners();
 
// enfin on considère le composant comme instancié
estInstancie = true;
 
}
 
});
}
 
/**
* ajoute les listeners pour les boutons et le cochage des entites
*/
private void ajouterListeners() {
arbreDonneesDates.addListener(new TreePanelListenerAdapter() {
public void onClick(TreeNode node, EventObject e) {
nomFiltre = "" ;
donneesDateEnCours = "" ;
String nomPere = "" ;
String nomGrandPere = "" ;
switch(node.getDepth())
{
case 0:
if(!arbreCharge)
{
arbreCharge = true ;
observationMediateur.obtenirDatesObservation() ;
}
else
{
observationMediateur.obtenirNombreObservation() ;
}
return ;
case 3: nomFiltre += "annee,mois,jour";
nomPere = ((String[])node.getParentNode().getUserObject())[0] ;
nomGrandPere = ((String[])node.getParentNode().getParentNode().getUserObject())[0] ;
donneesDateEnCours += nomGrandPere+","+nomPere+","+((String[])node.getUserObject())[0] ;
break;
case 2: nomFiltre += "annee,mois";
nomPere = ((String[])node.getParentNode().getUserObject())[0] ;
donneesDateEnCours += nomPere+","+((String[])node.getUserObject())[0] ;
break;
case 1: nomFiltre += "annee";
donneesDateEnCours += ((String[])node.getUserObject())[0] ;
break;
default:
break;
}
filtreModifie = true ;
observationMediateur.obtenirNombreObservation() ;
}
}) ;
arbreDonneesDates.getRootNode().addListener(new TreeNodeListenerAdapter() {
public void onExpand(Node node) {
if(!arbreCharge)
{
observationMediateur.obtenirDatesObservation() ;
arbreCharge = true ;
}
}
}) ;
}
 
/**
* Méthode héritée de l'interface rafraichissable
*/
public void rafraichir(Object nouvelleDonnees,
boolean repandreRaffraichissement) {
if (nouvelleDonnees instanceof ListeDateObservation) {
String annee=null;
String mois=null;
String jour=null;
ListeDateObservation data = (ListeDateObservation) nouvelleDonnees ;
// on crée un arbre vide
TreeNode root = new TreeNode();
root.setId("racine_date");
root.setText("Dates");
String[] usObjRoot = { "Dates"};
root.setUserObject(usObjRoot);
donneesDates.setRootNode(root);
// on la parse et on récupère les informations qui nous interessent
for (Iterator<String> it= data.keySet().iterator(); it.hasNext();) {
DateObservation ent=(DateObservation) data.get(it.next());
annee= ent.getAnnee() ;
mois= ent.getMois() ;
String moisLettre = renvoyerMois(Integer.parseInt(mois)) ;
jour= ent.getJour() ;
if(annee.contains("0000")) {
annee="Inconnue" ;
}
if(moisLettre.contains("00")) {
mois="Inconnue" ;
}
if(jour.contains("00")) {
jour="Inconnue" ;
}
Node noeudMemeId = donneesDates.getNodeById(""+annee);
// si la région existe déjà
if(noeudMemeId != null)
{
// on teste si la localité existe
Node noeudMemeLoc = donneesDates.getNodeById(""+(annee+mois));
if(noeudMemeLoc != null)
{
// enfin on teste si le lieu dit existe
Node noeudMemeLieu = donneesDates.getNodeById(""+(annee+mois+jour));
if(noeudMemeLieu != null)
{
// tous les noeuds existent déjà, normalement ça ne devrait pas arriver
}
else
{
// enfin on ne crée que le noeud du lieu dit
TreeNode node_lieu = new TreeNode();
node_lieu.setId(""+(annee+mois+jour));
node_lieu.setText(jour);
noeudMemeLoc.appendChild(node_lieu) ;
String[] usObj = {jour};
node_lieu.setUserObject(usObj);
}
}
else
{
TreeNode node_loc = new TreeNode();
node_loc.setId(""+(annee+mois));
node_loc.setText(moisLettre);
noeudMemeId.appendChild(node_loc) ;
String[] usObj = {mois};
node_loc.setUserObject(usObj);
TreeNode node_lieu = new TreeNode();
node_lieu.setId(""+(annee+mois+jour));
node_lieu.setText(jour);
node_loc.appendChild(node_lieu) ;
String[] usObj2 = {jour};
node_lieu.setUserObject(usObj2);
}
}
else
{
TreeNode node_id_loc = new TreeNode();
node_id_loc.setId(""+annee);
node_id_loc.setText(annee);
root.appendChild(node_id_loc) ;
String[] usObj = {annee};
node_id_loc.setUserObject(usObj);
TreeNode node_loc = new TreeNode();
node_loc.setId(""+(annee+mois));
node_loc.setText(moisLettre);
node_id_loc.appendChild(node_loc) ;
String[] usObj2 = {mois};
node_loc.setUserObject(usObj2);
TreeNode node_lieu = new TreeNode();
node_lieu.setId(""+(annee+mois+jour));
node_lieu.setText(jour);
node_loc.appendChild(node_lieu) ;
String[] usObj3 = {jour};
node_lieu.setUserObject(usObj3);
}
 
}
// on vide tous les noeuds
arbreDonneesDates.getRootNode().eachChild(new NodeTraversalCallback() {
public boolean execute(Node node) {
node.remove();
return true;
}
});
 
// et on recopie le nouvel arbre
copierFilsNoeud(donneesDates.getRootNode(), arbreDonneesDates
.getRootNode());
// si l'arbre n'était pas encore considéré comme instancié
if (!estInstancie) {
// on signale que oui
estInstancie = true;
}
// l'état du filtre est réinitialisé
filtreModifie = false;
//show() ;
doLayout();
 
}
if(nouvelleDonnees instanceof DateObservation)
{
DateObservation ent = (DateObservation)nouvelleDonnees ;
String annee= ent.getAnnee() ;
String mois= ent.getMois() ;
String moisLettre = renvoyerMois(Integer.parseInt(mois)) ;
String jour= ent.getJour() ;
Node root = arbreDonneesDates.getRootNode() ;
if(annee.contains("0000") || annee.equals(null)) {
annee="Inconnue" ;
}
if(mois.contains("00") || mois.equals(null)) {
mois="Inconnue" ;
}
if(jour.contains("00") || jour.equals(null)) {
jour="Inconnue" ;
}
Node noeudMemeId = donneesDates.getNodeById(""+annee);
// si la région existe déjà
if(noeudMemeId != null)
{
// on teste si la localité existe
Node noeudMemeLoc = donneesDates.getNodeById(""+(annee+mois));
if(noeudMemeLoc != null)
{
// enfin on teste si le lieu dit existe
Node noeudMemeLieu = donneesDates.getNodeById(""+(annee+mois+jour));
if(noeudMemeLieu != null)
{
// tous les noeuds existent déjà, normalement ça ne devrait pas arriver
}
else
{
// enfin on ne crée que le noeud du lieu dit
TreeNode node_lieu = new TreeNode();
node_lieu.setId(""+(annee+mois+jour));
node_lieu.setText(jour);
String[] usObj = {jour};
node_lieu.setUserObject(usObj);
noeudMemeLoc.appendChild(node_lieu) ;
}
}
else
{
TreeNode node_loc = new TreeNode();
node_loc.setId(""+(annee+mois));
node_loc.setText(mois);
String[] usObj = {moisLettre};
node_loc.setUserObject(usObj);
noeudMemeId.appendChild(node_loc) ;
TreeNode node_lieu = new TreeNode();
node_lieu.setId(""+(annee+mois+jour));
node_lieu.setText(jour);
String[] usObj2 = {jour};
node_lieu.setUserObject(usObj2);
node_loc.appendChild(node_lieu) ;
}
}
else
{
// TODO: Pourquoi l'ajout ne marche que sur la racine ?
TreeNode node_id_loc = new TreeNode();
node_id_loc.setId(""+annee);
node_id_loc.setText(annee);
String[] usObj = {annee};
node_id_loc.setUserObject(usObj);
root.appendChild(node_id_loc) ;
TreeNode node_loc = new TreeNode();
node_loc.setId(""+(annee+mois));
node_loc.setText(mois);
String[] usObj2 = {moisLettre};
node_loc.setUserObject(usObj2);
node_id_loc.appendChild(node_loc) ;
TreeNode node_lieu = new TreeNode();
node_lieu.setId(""+(annee+mois+jour));
node_lieu.setText(jour);
String[] usObj3 = {jour};
node_lieu.setUserObject(usObj3);
node_loc.appendChild(node_lieu) ;
// TODO : améliorer la compararaison des noeuds
root.sort(comparerNoeuds()) ;
}
arbreDonneesDates.doLayout() ;
}
}
 
 
/**
* Accesseur pour le panneau contenant l'arbre
*
* @return le panneau de l'arbre des mots clés
*/
public TreePanel getArbreMotsCles() {
return arbreDonneesDates;
}
 
/**
* Méthode héritée de Filtrable renvoie le nom du filtre
*/
public String renvoyerNomFiltre() {
 
return "Dates";
}
 
/**
* Renvoie un tableau contenant le nom du champ à filtrer et la valeur
*
* @return un tableau contenant le nom du champ à filtrer et sa valeur
*/
public String[] renvoyerValeursAFiltrer() {
 
valider();
String valeursFiltrees[] = {nomFiltre, donneesDateEnCours } ;
 
return valeursFiltrees;
}
 
/**
* Fonction récursive qui prend deux noeuds d'arbre en paramètre et crée un
* copie du sous arbre du premier noeud, qu'elle concatène au deuxième
*
* @param ndPereOriginal
* le père des noeuds de l'arbre original
* @param ndPereCopie
* le père qui va recevoir les copies
*/
private void copierFilsNoeud(Node ndPereOriginal, TreeNode ndPereCopie) {
if (ndPereCopie != null && ndPereOriginal != null) {
Node[] ndNodeFils = ndPereOriginal.getChildNodes();
 
for (int i = 0; i < ndNodeFils.length; i++) {
 
String[] usObj = (String[]) ndNodeFils[i].getUserObject();
TreeNode child = new TreeNode(usObj[0]);
child.setUserObject(usObj);
ndPereCopie.appendChild(child);
 
if (!ndNodeFils[i].isLeaf()) {
copierFilsNoeud(ndNodeFils[i], child);
}
 
}
}
}
 
/**
* Méthode héritée de Filtrable Renvoie l'état du filtre (modifié ou non)
*/
public boolean renvoyerEtatFiltre() {
 
return filtreModifie;
}
 
public void valider() {
if (estInstancie) {
}
}
public Comparator<TreeNode> comparerNoeuds()
{
return new Comparator<TreeNode>() {
 
public int compare(TreeNode o1, TreeNode o2) {
String n1 = ((String[])o1.getUserObject())[0] ;
String n2 = ((String[])o2.getUserObject())[0] ;
return n1.compareTo(n2) ;
}
} ;
}
public String renvoyerMois(int numMois) {
switch (numMois) {
case 1:
return "janvier" ;
case 2:
return "fevrier" ;
case 3:
return "mars" ;
case 4:
return "avril" ;
case 5:
return "mai" ;
case 6:
return "juin" ;
case 7:
return "juillet" ;
case 8:
return "août" ;
case 9:
return "septembre" ;
case 10:
return "octobre" ;
case 11:
return "novembre" ;
case 12:
return "décembre" ;
default:
return "Inconnue" ;
}
}
 
 
}
/trunk/src/org/tela_botanica/client/vues/PanneauFiltresObservationVues.java
28,7 → 28,14
*/
private ArbreEntiteGeographiqueObservationFiltreVue arbreEntiteGeographiqueObservationFiltreVue = null;
/**
* L'arbre pour la recherche date
*
*/
private ArbreDateObservationFiltreVue arbreDateObservationFiltreVue = null;
 
/**
* Construcuteur sans argument (privé car on ne doit pas l'utiliser)
52,13 → 59,13
this.setCollapsible(true);
setLayout(new AccordionLayout(true));
 
arbreEntiteGeographiqueObservationFiltreVue = new ArbreEntiteGeographiqueObservationFiltreVue(observationMediateur);
add(arbreEntiteGeographiqueObservationFiltreVue);
 
Panel dummy = new Panel("Date");
add(dummy);
arbreDateObservationFiltreVue = new ArbreDateObservationFiltreVue(observationMediateur) ;
add(arbreDateObservationFiltreVue) ;
}
 
/**
67,9 → 74,13
* @return le filtre des mots clés
*/
public ArbreEntiteGeographiqueObservationFiltreVue getarbreEntiteGeographiqueObservationFiltreVue() {
public ArbreEntiteGeographiqueObservationFiltreVue getArbreEntiteGeographiqueObservationFiltreVue() {
return arbreEntiteGeographiqueObservationFiltreVue;
}
public ArbreDateObservationFiltreVue getArbreDateObservationFiltreVue() {
return arbreDateObservationFiltreVue;
}
 
 
/**
79,7 → 90,7
*/
public boolean renvoyerEtatFiltre() {
 
return (arbreEntiteGeographiqueObservationFiltreVue.renvoyerEtatFiltre());
return (arbreEntiteGeographiqueObservationFiltreVue.renvoyerEtatFiltre() || arbreDateObservationFiltreVue.renvoyerEtatFiltre());
}
 
91,6 → 102,7
*/
public String[][] renvoyerValeursAFiltrer() {
String[][] filtres = { arbreEntiteGeographiqueObservationFiltreVue.renvoyerValeursAFiltrer(),
arbreDateObservationFiltreVue.renvoyerValeursAFiltrer()
};
return filtres;
/trunk/src/org/tela_botanica/client/vues/ArbreEntiteGeographiqueObservationFiltreVue.java
432,6 → 432,8
}
else
{
// TODO: Pourquoi l'ajout ne marche que sur la racine ?
TreeNode node_id_loc = new TreeNode();
node_id_loc.setId(""+id_location);
node_id_loc.setText(id_location);
453,6 → 455,7
node_lieu.setUserObject(usObj3);
node_loc.appendChild(node_lieu) ;
// TODO : améliorer la compararaison des noeuds
root.sort(comparerNoeuds()) ;
}
541,13 → 544,23
 
public int compare(TreeNode o1, TreeNode o2) {
String n1 = o1.getText() ;
String n2 = o2.getText() ;
if(o1.getDepth() == 1 && o2.getDepth() == 1)
{
Integer n1 = Integer.parseInt(((String[])o1.getUserObject())[0]) ;
Integer n2 = Integer.parseInt(((String[])o2.getUserObject())[0]) ;
return n1.compareTo(n2) ;
}
else
{
String n1 = o1.getText() ;
String n2 = o2.getText() ;
return n1.compareTo(n2) ;
return n1.compareTo(n2) ;
}
}
} ;
}
 
}
/trunk/src/org/tela_botanica/client/modeles/ListeDateObservationAsynchroneDAO.java
New file
0,0 → 1,93
package org.tela_botanica.client.modeles;
 
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.observation.ObservationModele;
 
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.Window;
 
public class ListeDateObservationAsynchroneDAO {
/**
* Le modèle associé au DAO.
*/
private ObservationModele observationModele = null;
/**
* Constructeur.
* @param obs : Modele
*/
public ListeDateObservationAsynchroneDAO(final ObservationModele obs) {
this.observationModele = obs;
}
/**
* Envoie une requete au serveur jrest pour obtenir les communes correspondant
* à des critères données en paramètres.
* @param r le rafraichissable qui demande la mise à jour
* @param critere un string contenant le terme a rechercher
*/
public final void obtenirListeDate(final Rafraichissable r, final String utilisateur) {
RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, observationModele.getConfig().getServiceBaseUrl() + "/InventoryDateList/" + utilisateur);
try {
rb.sendRequest(null, new RequestCallback() {
 
public void onError(final Request request, final Throwable exception) {
// TODO Auto-generated method stub
}
 
public void onResponseReceived(final Request request,
final Response response) {
final ListeDateObservation lDateObs;
final JSONValue responseValue = JSONParser.parse(response.getText());
JSONArray reponse = responseValue.isArray();
 
// si c'est un tableau
if ((reponse) != null) {
lDateObs = new ListeDateObservation(reponse);
} else {
lDateObs = new ListeDateObservation(0);
}
// dans tous les cas on transmet la liste crée au rafraichissable en lui demandant de répandre les données car il est
// le premier à les recevoir
r.rafraichir(lDateObs, true);
}
});
} catch (RequestException e) {
e.printStackTrace();
}
}
 
}
/trunk/src/org/tela_botanica/client/modeles/DateObservation.java
New file
0,0 → 1,59
package org.tela_botanica.client.modeles;
 
import com.google.gwt.user.client.Window;
 
/**
*
* Classe representant une entite geographique (localite, commune, lieu dit) presente dans la liste des observations
*
*/
 
public class DateObservation {
 
 
private String annee=null;
private String mois=null;
private String jour=null;
 
public DateObservation() {
// TODO Auto-generated constructor stub
}
 
/**
* @param commune
* @param departement
*/
public DateObservation(String date) {
String dateTab[] = date.split(" ") ;
String dateSpl[] = dateTab[0].split("-") ;
annee= dateSpl[0];
mois= dateSpl[1];
jour= dateSpl[2];
}
 
 
 
public String getAnnee() {
return annee;
}
 
 
public String getMois() {
return mois;
}
 
 
public String getJour() {
return jour;
}
 
}
/trunk/src/org/tela_botanica/client/modeles/ListeDateObservation.java
New file
0,0 → 1,60
package org.tela_botanica.client.modeles;
 
 
import java.util.LinkedHashMap;
 
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.Window;
 
/**
* table de hachage composée d'entite geographique, renvoyé par les objets de type DAO
* La clé est le nom de l'entite + le nom de l'entite parente
*
* @author david delon
*
*/
public class ListeDateObservation extends LinkedHashMap<String, DateObservation> {
/**
*
*/
private static final long serialVersionUID = 6057292016502553510L;
 
/**
* Constructeur sans paramètres
*/
public ListeDateObservation()
{
super();
}
/**
* Constructeur avec paramètre
* @param taille la taille de la table de hachage
*/
public ListeDateObservation(int taille)
{
super(taille);
}
public ListeDateObservation(JSONArray dates)
{
super(dates.size()) ;
final int taillemax = dates.size();
for (int i = 0; i < taillemax; i++) {
JSONArray dateEncours = dates.get(i).isArray() ;
if(dateEncours != null)
{
String dateString = ((JSONString)dateEncours.get(0)).stringValue() ;
DateObservation dat = new DateObservation(dateString);
 
this.put(dateString,dat);
}
}
}
}
/trunk/src/org/tela_botanica/client/observation/ObservationMediateur.java
323,7 → 323,7
// On raffraichi la liste d'observation
observationModele.ajouterObservation(listeObservation, obs) ;
filtres.getarbreEntiteGeographiqueObservationFiltreVue().rafraichir(obs,true) ;
filtres.getArbreEntiteGeographiqueObservationFiltreVue().rafraichir(obs,true) ;
}
376,7 → 376,7
*/
public void obtenirListeEntiteGeographique() {
observationModele.obtenirListeEntiteGeographique(filtres.getarbreEntiteGeographiqueObservationFiltreVue());
observationModele.obtenirListeEntiteGeographique(filtres.getArbreEntiteGeographiqueObservationFiltreVue());
}
391,7 → 391,7
// On raffraichi la liste d'observation
observationModele.modifierObservation(listeObservation, obs) ;
filtres.getarbreEntiteGeographiqueObservationFiltreVue().rafraichir(obs,true) ;
filtres.getArbreEntiteGeographiqueObservationFiltreVue().rafraichir(obs,true) ;
}
464,17 → 464,25
*/
public String[][] renvoyerFiltres()
{
if(filtres.getarbreEntiteGeographiqueObservationFiltreVue() != null)
{
String[] filtresEntitesGeo = filtres.getarbreEntiteGeographiqueObservationFiltreVue().renvoyerValeursAFiltrer() ;
String chaineNomsFiltres = filtresEntitesGeo[0] ;
String chaineValFiltres = filtresEntitesGeo[1] ;
String[] filtresEntitesGeo = filtres.getArbreEntiteGeographiqueObservationFiltreVue().renvoyerValeursAFiltrer() ;
String chaineNomsFiltresGeo = filtresEntitesGeo[0] ;
String chaineValFiltresGeo = filtresEntitesGeo[1] ;
String[] filtresDate = filtres.getArbreDateObservationFiltreVue().renvoyerValeursAFiltrer() ;
String chaineNomsFiltresDate = filtresDate[0] ;
String chaineValFiltresDate = filtresDate[1] ;
String chaineNomsFiltres = chaineNomsFiltresGeo+","+chaineNomsFiltresDate ;
String chaineValFiltres = chaineValFiltresGeo+","+chaineValFiltresDate ;
String[] nomsFiltres = chaineNomsFiltres.split(",") ;
String[] valsFiltres = chaineValFiltres.split(",") ;
String [][] valeursFiltres = new String[nomsFiltres.length][2] ;
 
if(nomsFiltres.length > 0)
{
String [][] valeursFiltres = new String[nomsFiltres.length][2] ;
for(int i = 0 ; i < nomsFiltres.length ; i++)
{
493,16 → 501,8
}
else
{
String [][] valeursFiltres = {{"",""}} ;
return valeursFiltres ;
}
}
else
{
String[][] valeursFiltres = {{"",""}} ;
return valeursFiltres ;
}
}
 
568,5 → 568,12
masked.unmask() ;
}
}
 
 
public void obtenirDatesObservation() {
observationModele.obtenirDatesObservation(filtres.getArbreDateObservationFiltreVue()) ;
}
}
/trunk/src/org/tela_botanica/client/observation/ObservationModele.java
8,6 → 8,7
import org.tela_botanica.client.modeles.Configuration;
import org.tela_botanica.client.modeles.ImageGeneriqueVueAsynchroneDAO;
import org.tela_botanica.client.modeles.ImageInformationRepartitionAsynchroneDAO;
import org.tela_botanica.client.modeles.ListeDateObservationAsynchroneDAO;
import org.tela_botanica.client.modeles.ListeEntiteGeographiqueObservation;
import org.tela_botanica.client.modeles.ListeEntiteGeographiqueObservationAsynchroneDAO;
import org.tela_botanica.client.modeles.ListeObservationAsynchroneDAO;
17,6 → 18,7
import org.tela_botanica.client.modeles.NombreObservationAsynchroneDAO;
import org.tela_botanica.client.modeles.Observation;
import org.tela_botanica.client.modeles.ObservationAsynchroneDAO;
import org.tela_botanica.client.vues.ArbreDateObservationFiltreVue;
import org.tela_botanica.client.vues.InformationRepartitionVue;
import org.tela_botanica.client.vues.ListeObservationVue;
 
253,5 → 255,14
entDAO.obtenirListeEntitesGeographiques(r, observationMediateur.getIdentifiant());
 
}
 
 
 
public void obtenirDatesObservation(
Rafraichissable r) {
ListeDateObservationAsynchroneDAO ldoDAO = new ListeDateObservationAsynchroneDAO(this);
ldoDAO.obtenirListeDate(r, observationMediateur.getIdentifiant());
}
}