/trunk/src/org/tela_botanica/client/vues/FormulaireSaisieObservationVue.java |
---|
29,6 → 29,7 |
import com.gwtext.client.widgets.form.ComboBox; |
import com.gwtext.client.widgets.form.DateField; |
import com.gwtext.client.widgets.form.FormPanel; |
import com.gwtext.client.widgets.form.TextArea; |
import com.gwtext.client.widgets.form.TextField; |
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter; |
import com.gwtext.client.widgets.layout.ColumnLayout; |
97,6 → 98,8 |
private final int KEY_TAB = 9; |
private final int KEY_UP = 38; |
private int tailleChamps = 350 ; |
/** |
* Combobox permettant de selectionner le mode |
* modification ou bien création |
125,8 → 128,6 |
*/ |
public FormulaireSaisieObservationVue(ObservationMediateur obs) |
{ |
// on associe le médiateur |
observationMediateur = obs ; |
156,7 → 157,7 |
commune=new ComboBox("Commune","commune",275 ); |
commune=new ComboBox("Commune","commune",tailleChamps ); |
final String resultTplCommune = "<div class=\"search-item-commune\">{commune}</div>"; |
179,7 → 180,7 |
station = new TextField("Station", "station", 275); |
station = new TextField("Station", "station", tailleChamps); |
station.setAllowBlank(true); |
panneauPremierColonne.add(station); |
190,7 → 191,7 |
panneauPremierColonne.add(date); |
espece=new ComboBox("Espèce","nom",275 ); |
espece=new ComboBox("Espèce","nom",tailleChamps ); |
final String resultTplEspece = "<div class=\"search-item-espece\">{nom}</div>"; |
207,21 → 208,22 |
panneauPremierColonne.add(espece); |
panneauPremierColonne.add(espece); |
comment = new TextField("Notes", "comment", 275); |
comment.setAllowBlank(true); |
panneauPremierColonne.add(comment); |
lieudit = new TextField("Lieu-dit", "lieudit", 275); |
lieudit = new TextField("Lieu-dit", "lieudit", tailleChamps); |
lieudit.setAllowBlank(true); |
panneauSecondeColonne.add(lieudit); |
milieu = new TextField("Milieu", "milieu", 275); |
milieu = new TextField("Milieu", "milieu", tailleChamps); |
milieu.setAllowBlank(true); |
panneauSecondeColonne.add(milieu); |
comment = new TextArea("Notes", "comment"); |
comment.setAllowBlank(true); |
comment.setHeight(50); |
comment.setWidth(tailleChamps); |
panneauSecondeColonne.add(comment); |
panneauIntermediaire.add(panneauPremierColonne, new ColumnLayoutData(.5)); |
panneauIntermediaire.add(panneauSecondeColonne, new ColumnLayoutData(.5)); |
365,6 → 367,7 |
espece.setValue(record.getAsString("nom")); |
numeroNom=record.getAsString("numeroNom"); |
selectionEspece=true; |
observationMediateur.obtenirImageInformationExternes(numeroNom); |
} |
}); |
/trunk/src/org/tela_botanica/client/vues/ArbreEntiteGeographiqueObservationFiltreVue.java |
---|
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 |
/trunk/src/org/tela_botanica/client/vues/ListeObservationVue.java |
---|
9,8 → 9,7 |
import org.tela_botanica.client.interfaces.ListePaginable; |
import org.tela_botanica.client.interfaces.Rafraichissable; |
import org.tela_botanica.client.interfaces.VueListable; |
import com.google.gwt.user.client.Window; |
import com.gwtext.client.core.EventCallback; |
import com.gwtext.client.core.EventObject; |
import com.gwtext.client.core.Ext; |
import com.gwtext.client.core.ExtElement; |
20,13 → 19,16 |
import com.gwtext.client.data.MemoryProxy; |
import com.gwtext.client.data.Record; |
import com.gwtext.client.data.RecordDef; |
import com.gwtext.client.data.SimpleStore; |
import com.gwtext.client.data.Store; |
import com.gwtext.client.data.StringFieldDef; |
import com.gwtext.client.widgets.Button; |
import com.gwtext.client.widgets.Component; |
import com.gwtext.client.widgets.Tool; |
import com.gwtext.client.widgets.event.ContainerListenerAdapter; |
import com.gwtext.client.widgets.form.ComboBox; |
import com.gwtext.client.widgets.Toolbar; |
import com.gwtext.client.widgets.ToolbarButton; |
import com.gwtext.client.widgets.ToolbarTextItem; |
import com.gwtext.client.widgets.event.ButtonListenerAdapter; |
import com.gwtext.client.widgets.event.PanelListenerAdapter; |
import com.gwtext.client.widgets.grid.CellMetadata; |
import com.gwtext.client.widgets.grid.ColumnConfig; |
import com.gwtext.client.widgets.grid.ColumnModel; |
107,7 → 109,6 |
*/ |
private int nbElements = 0 ; |
private ListeObservation cacheListeObservation = null; |
private Tool exporterObservations = null ; |
136,9 → 137,35 |
bt = new BarrePaginationVue(this); |
bt.setLabelElement("Observations"); |
bt.setTaillePageParDefaut(20); |
bt.setIntervallesPages(new String[] {"400","200", "100" , "50" , "20"}) ; |
this.setBottomToolbar(bt) ; |
bt.setIntervallesPages(new String[] {"400","200", "100" , "50" , "20", "10"}) ; |
this.setTopToolbar(bt) ; |
Toolbar barreActions = new Toolbar(); |
ToolbarButton transmettre = new ToolbarButton("Transmettre"); |
transmettre.addListener(new ButtonListenerAdapter() { |
public void onClick(Button b, EventObject e) { |
observationMediateur.transmettreObservations(); |
} |
}); |
ToolbarButton supprimer = new ToolbarButton("Supprimer"); |
supprimer.addListener(new ButtonListenerAdapter() { |
public void onClick(Button b, EventObject e) { |
observationMediateur.supprimerObservations(); |
} |
}); |
ToolbarTextItem exporter = new ToolbarTextItem("<a href=\"#\" id=\"lienExport\"> Exporter </a>"); |
barreActions.addButton(transmettre); |
barreActions.addSpacer(); |
barreActions.addButton(supprimer); |
barreActions.addSpacer(); |
barreActions.addItem(exporter); |
this.setBottomToolbar(barreActions); |
exporterObservations = new Tool(Tool.PIN, new Function() { |
public void execute() { |
174,13 → 201,13 |
} ; |
etatObservation = new ColumnConfig("Transmis", "etat_observation", 60, true, new Renderer() { |
etatObservation = new ColumnConfig("Transmis", "etat_observation", 20, true, new Renderer() { |
public String render(Object value, CellMetadata cellMetadata, |
Record record, int rowIndex, int colNum, Store store) { |
if(value.equals("1")) |
{ |
return "<input type=\"checkbox\" checked =\"checked\" disabled=\"disabled\" />" ; |
return "<img src=\"tela.png\"/></img>" ; |
} |
else |
{ |
278,25 → 305,20 |
}); |
/*this.getSelectionModel().addListener(new RowSelectionListenerAdapter() { |
this.addListener(new PanelListenerAdapter() { |
public void onRender(Component c) { |
ExtElement lienExport = Ext.get("lienExport") ; |
lienExport.addListener("click", new EventCallback() { |
// gestion de la sélection |
public void onSelectionChange(RowSelectionModel sm) { |
// si on a rien de sélectionné |
if (sm.getCount() <= 0) { |
// on notifie le médiateur (qui désactive notamment l'accès à certaines infos) |
// getobservationMediateur().aucuneSelection(); |
} else { |
// sinon on notifie le médiateur |
// getobservationMediateur().selection(); |
// et on lui demande de synchroniser la selection avec les autres vues |
// getobservationMediateur().synchroniserSelection("liste"); |
} |
public void execute(EventObject e) { |
observationMediateur.exporterObservations(); |
} |
}); |
} |
});*/ |
}); |
} |
/** |
/trunk/src/org/tela_botanica/client/vues/ArbreDateObservationFiltreVue.java |
---|
180,10 → 180,9 |
case 0: |
if(!arbreCharge) |
{ |
ExtElement masked = Ext.get(arbreDonneesDates.getId()); |
masked.mask("Chargement"); |
arbreCharge = true ; |
observationMediateur.obtenirDatesObservation() ; |
/* arbreCharge = true ; |
observationMediateur.obtenirDatesObservation() ;*/ |
arbreDonneesDates.getRootNode().expand(); |
} |
else |
{ |
218,8 → 217,6 |
public void onExpand(Node node) { |
if(!arbreCharge) |
{ |
ExtElement masked = Ext.get(arbreDonneesDates.getId()); |
masked.mask("Chargement"); |
observationMediateur.obtenirDatesObservation() ; |
arbreCharge = true ; |
} |
361,8 → 358,6 |
estInstancie = true; |
} |
ExtElement masked = Ext.get(arbreDonneesDates.getId()); |
masked.unmask(); |
// l'état du filtre est réinitialisé |
filtreModifie = false; |
372,7 → 367,14 |
} |
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 ent = (Observation)nouvelleDonnees ; |
String dateSpl[] = ent.getDate().split("/") ; |
/trunk/src/org/tela_botanica/client/vues/BarrePaginationVue.java |
---|
146,6 → 146,14 |
listePaginable = lst; |
// on remplit l'espace pour que l'intervalle d'élement se place à droite |
// de la barre |
addItem(intervalleElements); |
addSpacer(); |
// on remplit l'espace pour que l'intervalle d'élement se place à droite |
// de la barre |
addFill(); |
// on dispose un peu de texte et quelques espaces pour séparer les |
// éléments |
addButton(prevPage); |
164,10 → 172,6 |
prevPage.setIcon("page_prev.png"); |
suivPage.setIcon("page_suiv.png"); |
// le store contient les valeur possibles pour les tailles de page |
/*final Store store = new SimpleStore(new String[] { "nb_page" }, |
new String[][] {getNbPages()} ); |
store.load();*/ |
setIntervallesPages(pages) ; |
// le template definit ce que l'on affiche pour chaque element du store |
185,14 → 189,7 |
selecteurTaillePage.setWidth(50); |
addItem(nbElemParPage); |
// on remplit l'espace pour que l'intervalle d'élement se place à droite |
// de la barre |
addFill(); |
addItem(intervalleElements); |
addSpacer(); |
// on ajoute les différents listeners |
ajouterListeners(); |
} |