Subversion Repositories eFlore/Applications.cel

Rev

Rev 1332 | Rev 1489 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1332 Rev 1488
1
package org.tela_botanica.client.vues.observation;
1
package org.tela_botanica.client.vues.observation;
2
 
2
 
3
// TODO Detecter redim et supprimer ajuster
3
// TODO Detecter redim et supprimer ajuster
4
 
4
 
5
import java.util.Date;
5
import java.util.Date;
-
 
6
import java.util.HashMap;
6
import java.util.Iterator;
7
import java.util.Iterator;
7
 
8
 
8
import org.tela_botanica.client.CarnetEnLigneMediateur;
9
import org.tela_botanica.client.CarnetEnLigneMediateur;
9
import org.tela_botanica.client.interfaces.Rafraichissable;
10
import org.tela_botanica.client.interfaces.Rafraichissable;
10
import org.tela_botanica.client.modeles.objets.Configuration;
11
import org.tela_botanica.client.modeles.objets.Configuration;
11
import org.tela_botanica.client.modeles.objets.EntiteGeographiqueObservation;
12
import org.tela_botanica.client.modeles.objets.EntiteGeographiqueObservation;
12
import org.tela_botanica.client.modeles.objets.ListeObservation;
13
import org.tela_botanica.client.modeles.objets.ListeObservation;
13
import org.tela_botanica.client.modeles.objets.ListeReferentielCommune;
14
import org.tela_botanica.client.modeles.objets.ListeReferentielCommune;
14
import org.tela_botanica.client.modeles.objets.ListeReferentielNom;
15
import org.tela_botanica.client.modeles.objets.ListeReferentielNom;
15
import org.tela_botanica.client.modeles.objets.Observation;
16
import org.tela_botanica.client.modeles.objets.Observation;
16
import org.tela_botanica.client.modeles.objets.ReferentielCommune;
17
import org.tela_botanica.client.modeles.objets.ReferentielCommune;
17
import org.tela_botanica.client.modeles.objets.ReferentielNom;
18
import org.tela_botanica.client.modeles.objets.ReferentielNom;
18
import org.tela_botanica.client.modeles.objets.ListeReferentielPerso.TypesReferentiels;
19
import org.tela_botanica.client.modeles.objets.ListeReferentielPerso.TypesReferentiels;
19
import org.tela_botanica.client.observation.ObservationMediateur;
20
import org.tela_botanica.client.observation.ObservationMediateur;
20
import org.tela_botanica.client.util.AutoCompletionRefComboBox;
21
import org.tela_botanica.client.util.AutoCompletionRefComboBox;
21
import org.tela_botanica.client.util.Util;
22
import org.tela_botanica.client.util.Util;
-
 
23
 
-
 
24
import com.google.gwt.event.dom.client.KeyCodes;
22
 
25
import com.google.gwt.event.dom.client.KeyEvent;
23
import com.google.gwt.maps.client.geom.LatLng;
26
import com.google.gwt.maps.client.geom.LatLng;
24
import com.google.gwt.user.client.Timer;
27
import com.google.gwt.user.client.Timer;
25
import com.google.gwt.user.client.Window;
28
import com.google.gwt.user.client.Window;
26
import com.google.gwt.user.client.ui.HTML;
29
import com.google.gwt.user.client.ui.HTML;
27
import com.gwtext.client.core.EventCallback;
30
import com.gwtext.client.core.EventCallback;
28
import com.gwtext.client.core.EventObject;
31
import com.gwtext.client.core.EventObject;
29
import com.gwtext.client.core.Ext;
32
import com.gwtext.client.core.Ext;
30
import com.gwtext.client.core.ExtElement;
33
import com.gwtext.client.core.ExtElement;
31
import com.gwtext.client.core.ListenerConfig;
34
import com.gwtext.client.core.ListenerConfig;
32
import com.gwtext.client.core.Position;
35
import com.gwtext.client.core.Position;
33
import com.gwtext.client.data.ArrayReader;
36
import com.gwtext.client.data.ArrayReader;
34
import com.gwtext.client.data.FieldDef;
37
import com.gwtext.client.data.FieldDef;
35
import com.gwtext.client.data.MemoryProxy;
38
import com.gwtext.client.data.MemoryProxy;
36
import com.gwtext.client.data.RecordDef;
39
import com.gwtext.client.data.RecordDef;
37
import com.gwtext.client.data.SimpleStore;
40
import com.gwtext.client.data.SimpleStore;
38
import com.gwtext.client.data.Store;
41
import com.gwtext.client.data.Store;
39
import com.gwtext.client.data.StringFieldDef;
42
import com.gwtext.client.data.StringFieldDef;
40
import com.gwtext.client.widgets.BoxComponent;
43
import com.gwtext.client.widgets.BoxComponent;
41
import com.gwtext.client.widgets.Button;
44
import com.gwtext.client.widgets.Button;
42
import com.gwtext.client.widgets.Container;
45
import com.gwtext.client.widgets.Container;
43
import com.gwtext.client.widgets.DatePicker;
46
import com.gwtext.client.widgets.DatePicker;
44
import com.gwtext.client.widgets.Panel;
47
import com.gwtext.client.widgets.Panel;
45
import com.gwtext.client.widgets.ToolTip;
48
import com.gwtext.client.widgets.ToolTip;
46
import com.gwtext.client.widgets.Toolbar;
49
import com.gwtext.client.widgets.Toolbar;
47
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
50
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
48
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
51
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
49
import com.gwtext.client.widgets.event.DatePickerListenerAdapter;
52
import com.gwtext.client.widgets.event.DatePickerListenerAdapter;
50
import com.gwtext.client.widgets.event.PanelListenerAdapter;
53
import com.gwtext.client.widgets.event.PanelListenerAdapter;
51
import com.gwtext.client.widgets.form.ComboBox;
54
import com.gwtext.client.widgets.form.ComboBox;
52
import com.gwtext.client.widgets.form.DateField;
55
import com.gwtext.client.widgets.form.DateField;
53
import com.gwtext.client.widgets.form.Field;
56
import com.gwtext.client.widgets.form.Field;
54
import com.gwtext.client.widgets.form.FormPanel;
57
import com.gwtext.client.widgets.form.FormPanel;
55
import com.gwtext.client.widgets.form.Label;
58
import com.gwtext.client.widgets.form.Label;
56
import com.gwtext.client.widgets.form.MultiFieldPanel;
59
import com.gwtext.client.widgets.form.MultiFieldPanel;
57
import com.gwtext.client.widgets.form.TextArea;
60
import com.gwtext.client.widgets.form.TextArea;
58
import com.gwtext.client.widgets.form.TextField;
61
import com.gwtext.client.widgets.form.TextField;
59
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
62
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
60
import com.gwtext.client.widgets.form.event.TextFieldListenerAdapter;
63
import com.gwtext.client.widgets.form.event.TextFieldListenerAdapter;
61
import com.gwtext.client.widgets.layout.AnchorLayoutData;
64
import com.gwtext.client.widgets.layout.AnchorLayoutData;
62
import com.gwtext.client.widgets.layout.ColumnLayout;
65
import com.gwtext.client.widgets.layout.ColumnLayout;
63
import com.gwtext.client.widgets.layout.ColumnLayoutData;
66
import com.gwtext.client.widgets.layout.ColumnLayoutData;
64
import com.gwtext.client.widgets.layout.FormLayout;
67
import com.gwtext.client.widgets.layout.FormLayout;
65
import com.gwtext.client.widgets.layout.RowLayout;
68
import com.gwtext.client.widgets.layout.RowLayout;
66
import com.gwtext.client.data.Record;
69
import com.gwtext.client.data.Record;
67
 
70
 
68
/**
71
/**
69
 * Panneau contenant les infos, les métadonnées et l'arbre des mots clés, il implémente l'interface rafraichissable
72
 * Panneau contenant les infos, les métadonnées et l'arbre des mots clés, il implémente l'interface rafraichissable
70
 * @author aurelien
73
 * @author aurelien
71
 *
74
 *
72
 */
75
 */
73
public class FormulaireSaisieObservationVue extends Panel implements Rafraichissable  {
76
public class FormulaireSaisieObservationVue extends Panel implements Rafraichissable  {
74
 
77
 
75
 
78
 
76
	/**
79
	/**
77
	 * Le médiateur associé à la vue
80
	 * Le médiateur associé à la vue
78
	 */
81
	 */
79
	private ObservationMediateur	observationMediateur		= null;
82
	private ObservationMediateur	observationMediateur		= null;
80
	
83
	
81
	FormPanel panneauFormulaire = null;
84
	FormPanel panneauFormulaire = null;
82
 
85
 
83
	private DateField date = null;
86
	private DateField date = null;
84
	private ComboBox lieudit = null;
87
	private ComboBox lieudit = null;
85
	private ComboBox station = null;
88
	private ComboBox station = null;
86
	private ComboBox milieu = null;
89
	private ComboBox milieu = null;
87
	private TextField comment = null;
90
	private TextField comment = null;
88
	private ComboBox  commune = null;
91
	private ComboBox  commune = null;
89
	private String departement = null;
92
	private String departement = null;
90
	private ComboBox  espece = null;
93
	private ComboBox  espece = null;
91
	private String numeroNom = null;
94
	private String numeroNom = null;
92
	private String numeroOrdre = null;
95
	private String numeroOrdre = null;
93
	private String codeInseeCommune = null;
96
	private String codeInseeCommune = null;
94
	
97
	
95
	private String referentielGeo = null;
98
	private String referentielGeo = null;
96
 
99
 
97
	// Pour remise a zero partielle lors d'une validation
100
	// Pour remise a zero partielle lors d'une validation
98
	
101
	
99
	private  enum Champs {
102
	private  enum Champs {
100
	    DATE, LIEUDIT, STATION, MILIEU, COMMENT, COMMUNE, ESPECE, TOUT, LATITUDE, LONGITUDE ;
103
	    DATE, LIEUDIT, STATION, MILIEU, COMMENT, COMMUNE, ESPECE, TOUT, LATITUDE, LONGITUDE, ABONDANCE, CERTITUDE;
101
	    
104
	    
102
	    @Override
105
	    @Override
103
		public String toString() {
106
		public String toString() {
104
	    	
107
	    	
105
	    	switch(this) {
108
	    	switch(this) {
106
	    	case DATE:
109
	    	case DATE:
107
	    		return "date";
110
	    		return "date";
108
	    		
111
	    		
109
	    	case COMMUNE:
112
	    	case COMMUNE:
110
	    		return "commune";
113
	    		return "commune";
111
	    	
114
	    	
112
    		case LIEUDIT:
115
    		case LIEUDIT:
113
    			return "lieu dit";
116
    			return "lieu dit";
114
	    	
117
	    	
115
    		case STATION:
118
    		case STATION:
116
    			return "station";
119
    			return "station";
117
	    	
120
	    	
118
    		case MILIEU:
121
    		case MILIEU:
119
    			return "milieu";
122
    			return "milieu";
120
	    	
123
	    	
121
    		case COMMENT:
124
    		case COMMENT:
122
    			return "commentaire";
125
    			return "commentaire";
123
	    	
126
	    	
124
	    	case ESPECE:
127
	    	case ESPECE:
125
	    		return "espèce";
128
	    		return "espèce";
126
	    		
129
	    		
127
	    	case LATITUDE:
130
	    	case LATITUDE:
128
	    		return "latitude";
131
	    		return "latitude";
129
	    		
132
	    		
130
	    	case LONGITUDE:
133
	    	case LONGITUDE:
131
	    		return "longitude";
134
	    		return "longitude";
-
 
135
	    		
-
 
136
	    	case ABONDANCE:
-
 
137
	    		return "abondance";
-
 
138
	    		
-
 
139
	    	case CERTITUDE:
-
 
140
	    		return "certitude";
132
	    	
141
	    	
133
	    	case TOUT:
142
	    	case TOUT:
134
	    		return "date, commune, lieu dit, station, milieu, espèce, commentaire, latitude, longitude";
143
	    		return "date, commune, lieu dit, station, milieu, espèce, commentaire, latitude, longitude, abondance, certitude";
135
	    	}
144
	    	}
136
			return TOUT.toString();
145
			return TOUT.toString();
137
	    }
146
	    }
138
	};
147
	};
139
	
148
	
140
	private String formatDate = null ;
149
	private String formatDate = null ;
141
	private Button boutonOK = new Button("Créer");
150
	private Button boutonOK = new Button("Créer");
142
	private Button boutonAnnuler = new Button("Réinitialiser");
151
	private Button boutonAnnuler = new Button("Réinitialiser");
143
 
152
 
144
	private boolean selectionCommune=false;
153
	private boolean selectionCommune=false;
145
	private boolean selectionEspece=false;
154
	private boolean selectionEspece=false;
-
 
155
	private boolean selectionAbondance = false;
-
 
156
	private boolean selectionCertitude = false;
146
	
157
	
147
	private boolean modification = false ;
158
	private boolean modification = false ;
148
	private Toolbar bt = null ;
159
	private Toolbar bt = null ;
149
	
160
	
150
	private final String VALEURS_MULTIPLES = "(Valeurs multiples)";
161
	private final String VALEURS_MULTIPLES = "(Valeurs multiples)";
151
	private final String modeleMessageModif = "commune:lieu-dit:station:milieu:latitude:longitude:date:espece:commentaire";
162
	private final String modeleMessageModif = "commune:lieu-dit:station:milieu:latitude:longitude:date:espece:commentaire:abondance:certitude";
152
	private boolean communeModifiee = false;
163
	private boolean communeModifiee = false;
153
	private boolean lieuDitModifie = false;
164
	private boolean lieuDitModifie = false;
154
	private boolean stationModifiee = false;
165
	private boolean stationModifiee = false;
155
	private boolean milieuModifie = false;
166
	private boolean milieuModifie = false;
156
	private boolean dateModifiee = false;
167
	private boolean dateModifiee = false;
157
	private boolean especeModifiee = false;
168
	private boolean especeModifiee = false;
158
	private boolean commModifie = false;
169
	private boolean commModifie = false;
159
	
-
 
-
 
170
	private boolean abondanceModifiee = false;
-
 
171
	private boolean certitudeModifiee = false;
160
	
172
	
161
	private final int KEY_ALT = 18;
173
	private final int KEY_ALT = 18;
162
	private final int KEY_BACKSPACE = 8;
174
	private final int KEY_BACKSPACE = 8;
163
	private final int KEY_CTRL = 17;
175
	private final int KEY_CTRL = 17;
164
	private final int KEY_DELETE = 46;
176
	private final int KEY_DELETE = 46;
165
	private final int KEY_DOWN = 40;
177
	private final int KEY_DOWN = 40;
166
	private final int KEY_END = 35;
178
	private final int KEY_END = 35;
167
	private final int KEY_ENTER = 13;
179
	private final int KEY_ENTER = 13;
168
	private final int KEY_ESCAPE = 27;
180
	private final int KEY_ESCAPE = 27;
169
	private final int KEY_HOME = 36;
181
	private final int KEY_HOME = 36;
170
	private final int KEY_LEFT = 37;
182
	private final int KEY_LEFT = 37;
171
	private final int KEY_PAGEDOWN = 34;
183
	private final int KEY_PAGEDOWN = 34;
172
	private final int KEY_PAGEUP = 33;
184
	private final int KEY_PAGEUP = 33;
173
	private final int KEY_RIGHT = 39;
185
	private final int KEY_RIGHT = 39;
174
	private final int KEY_SHIFT = 16;
186
	private final int KEY_SHIFT = 16;
175
	private final int KEY_TAB = 9;
187
	private final int KEY_TAB = 9;
176
	private final int KEY_UP = 38;
188
	private final int KEY_UP = 38;
177
	
189
	
178
	
190
	
179
	/**
191
	/**
180
	 * Combobox permettant de selectionner le mode
192
	 * Combobox permettant de selectionner le mode
181
	 * modification ou bien création
193
	 * modification ou bien création
182
	 */
194
	 */
183
	private ComboBox selecteurMode = new ComboBox();
195
	private ComboBox selecteurMode = new ComboBox();
184
	
196
	
185
	Store storeMode = null ;
197
	Store storeMode = null ;
186
 
198
 
187
	/**
199
	/**
188
	 * Booleen d'instanciation
200
	 * Booleen d'instanciation
189
	 */
201
	 */
190
	boolean estInstancie = false ;
202
	boolean estInstancie = false ;
191
 
203
 
192
	private Panel panneauIntermediaire;
204
	private Panel panneauIntermediaire;
193
 
205
 
194
	private Panel panneauPremierColonne;
206
	private Panel panneauPremierColonne;
195
 
207
 
196
	private Panel panneauSecondeColonne;
208
	private Panel panneauSecondeColonne;
197
 
209
 
198
	private boolean masseModification =false ;
210
	private boolean masseModification =false ;
199
 
211
 
200
	private TextField longitude;
212
	private TextField longitude;
201
 
213
 
202
	private TextField latitude;
214
	private TextField latitude;
203
	
215
	
204
	private MultiFieldPanel htmlCommunePanel = null;
216
	private MultiFieldPanel htmlCommunePanel = null;
205
 
217
 
206
	private MultiFieldPanel coordPanel;
218
	private MultiFieldPanel coordPanel;
207
 
219
 
208
	private TextField coordonnees;
220
	private TextField coordonnees;
209
	
221
	
210
	private Label lienSelectionCommune = null;
222
	private Label lienSelectionCommune = null;
211
 
223
 
212
	private HTML afficherFormulaireLatLon;
224
	private HTML afficherFormulaireLatLon;
213
 
225
 
214
	private HTML basculerverscarto;
226
	private HTML basculerverscarto;
215
	
227
	
216
	private boolean longlatAjoutee;
228
	private boolean longlatAjoutee;
217
 
229
 
218
	private boolean latModifiee;
230
	private boolean latModifiee;
219
 
231
 
220
	private boolean longModifiee;
232
	private boolean longModifiee;
221
 
233
 
222
	protected boolean rechercheCommuneEnCours = false;
234
	protected boolean rechercheCommuneEnCours = false;
223
 
235
 
224
	private Timer tCoord;
236
	private Timer tCoord;
225
	
237
	
-
 
238
	final String resultTplRefPerso = "<div class=\"search-item-commune\">{element_referentiel}</div>"; 
-
 
239
	
-
 
240
	private ComboBox selecteurAbondance = null; 
-
 
241
	
226
	final String resultTplRefPerso = "<div class=\"search-item-commune\">{element_referentiel}</div>";  
242
	private ComboBox selecteurCertitude = null; 
227
	
243
	
228
	/**
244
	/**
229
	 * Constructeur sans argument (privé car ne doit pas être utilisé)
245
	 * Constructeur sans argument (privé car ne doit pas être utilisé)
230
	 */
246
	 */
231
	@SuppressWarnings("unused")
247
	@SuppressWarnings("unused")
232
	private FormulaireSaisieObservationVue()
248
	private FormulaireSaisieObservationVue()
233
	{
249
	{
234
		super() ;
250
		super() ;
235
	}
251
	}
236
	
252
	
237
	/**
253
	/**
238
	 * Constructeur avec argument
254
	 * Constructeur avec argument
239
	 * @param im
255
	 * @param im
240
	 */
256
	 */
241
	public FormulaireSaisieObservationVue(ObservationMediateur obs)
257
	public FormulaireSaisieObservationVue(ObservationMediateur obs)
242
	{
258
	{
243
		
259
		
244
		super("Saisie");
260
		super("Saisie");
245
		// on associe le médiateur
261
		// on associe le médiateur
246
		observationMediateur = obs ;
262
		observationMediateur = obs ;
247
		
263
		
248
	     	
264
	     	
249
		panneauFormulaire = new FormPanel(Position.RIGHT);
265
		panneauFormulaire = new FormPanel(Position.RIGHT);
250
		panneauFormulaire.setBorder(false);
266
		panneauFormulaire.setBorder(false);
251
		
267
		
252
		// Panneau intermediaire qui contient deux colonnes de formulaire
268
		// Panneau intermediaire qui contient deux colonnes de formulaire
253
		panneauIntermediaire = new Panel();  
269
		panneauIntermediaire = new Panel();  
254
		
270
		
255
		if (Window.getClientWidth()> Window.getClientHeight()) {
271
		if (Window.getClientWidth()> Window.getClientHeight()) {
256
			panneauIntermediaire.setLayout(new ColumnLayout()); 
272
			panneauIntermediaire.setLayout(new ColumnLayout()); 
257
		}
273
		}
258
		else {
274
		else {
259
			panneauIntermediaire.setLayout(new RowLayout()); 
275
			panneauIntermediaire.setLayout(new RowLayout()); 
260
		}
276
		}
261
		
277
		
262
		panneauIntermediaire.setBorder(false);
278
		panneauIntermediaire.setBorder(false);
263
 
279
 
264
		//création du panneau formulaire de gauche auquels on ajoute les champs
280
		//création du panneau formulaire de gauche auquels on ajoute les champs
265
		panneauPremierColonne = new Panel();  
281
		panneauPremierColonne = new Panel();  
266
		panneauPremierColonne.setLayout(new FormLayout());  
282
		panneauPremierColonne.setLayout(new FormLayout());  
267
		panneauPremierColonne.setBorder(false);
283
		panneauPremierColonne.setBorder(false);
268
 
284
 
269
		//création du panneau formulaire de droite
285
		//création du panneau formulaire de droite
270
	    panneauSecondeColonne = new Panel();  
286
	    panneauSecondeColonne = new Panel();  
271
		panneauSecondeColonne.setLayout(new FormLayout());  
287
		panneauSecondeColonne.setLayout(new FormLayout());  
272
		panneauSecondeColonne.setBorder(false);
288
		panneauSecondeColonne.setBorder(false);
273
				
289
				
274
		this.setPaddings(5) ;
290
		this.setPaddings(5) ;
275
	
291
	
276
		// Accesskey pour debugging
292
		// Accesskey pour debugging
277
		commune=new ComboBox("Commune","commune\" accesskey=\"1");  
293
		commune=new ComboBox("Commune","commune\" accesskey=\"1");  
278
		
294
		
279
		final String resultTplCommune = "<div class=\"search-item-commune\">{commune}</div>";  
295
		final String resultTplCommune = "<div class=\"search-item-commune\">{commune}</div>";  
280
		commune.setTpl(resultTplCommune);
296
		commune.setTpl(resultTplCommune);
281
		commune.setMode(ComboBox.REMOTE);
297
		commune.setMode(ComboBox.REMOTE);
282
		commune.setItemSelector("div.search-item-commune");
298
		commune.setItemSelector("div.search-item-commune");
283
		commune.setTypeAhead(true);  
299
		commune.setTypeAhead(true);  
284
		commune.setLoadingText("Recherche...");  
300
		commune.setLoadingText("Recherche...");  
285
		commune.setHideTrigger(true);
301
		commune.setHideTrigger(true);
286
		
302
		
287
		  //création du lien "Accès carto" dans le formulaire	
303
		  //création du lien "Accès carto" dans le formulaire	
288
		basculerverscarto = new HTML(" <a id=\"lien_carto\" href=\"#\" tabindex=\"2\">Localiser la commune</a>");
304
		basculerverscarto = new HTML(" <a id=\"lien_carto\" href=\"#\" tabindex=\"2\">Localiser la commune</a>");
289
		basculerverscarto.addStyleName("lien_actif");
305
		basculerverscarto.addStyleName("lien_actif");
290
		
306
		
291
		//création info bulle sur le lien "accès carto"
307
		//création info bulle sur le lien "accès carto"
292
		ToolTip tip2 = new ToolTip();  
308
		ToolTip tip2 = new ToolTip();  
293
		tip2.setHtml("Via une carte, obtenez les coordonnées (latitude/longitude) de votre observation ");  
309
		tip2.setHtml("Via une carte, obtenez les coordonnées (latitude/longitude) de votre observation ");  
294
		tip2.applyTo(basculerverscarto.getElement());
310
		tip2.applyTo(basculerverscarto.getElement());
295
		
311
		
296
		//Sur une meme ligne, ajout de plusieurs champs
312
		//Sur une meme ligne, ajout de plusieurs champs
297
		htmlCommunePanel = new MultiFieldPanel(); 
313
		htmlCommunePanel = new MultiFieldPanel(); 
298
		
314
		
299
		int largeurCommune = Window.getClientWidth()/4;
315
		int largeurCommune = Window.getClientWidth()/4;
300
		htmlCommunePanel.addToRow(commune, largeurCommune);
316
		htmlCommunePanel.addToRow(commune, largeurCommune);
301
		htmlCommunePanel.addToRow(basculerverscarto, 160); 
317
		htmlCommunePanel.addToRow(basculerverscarto, 160); 
302
 
318
 
303
		htmlCommunePanel.setBorder(false);
319
		htmlCommunePanel.setBorder(false);
304
		htmlCommunePanel.setId("x-commune-panel"); 
320
		htmlCommunePanel.setId("x-commune-panel"); 
305
 
321
 
306
		panneauPremierColonne.add(htmlCommunePanel);
322
		panneauPremierColonne.add(htmlCommunePanel);
307
 
323
 
308
	    station = new AutoCompletionRefComboBox("Station", "station", observationMediateur, TypesReferentiels.REFERENTIEL_STATION) {
324
	    station = new AutoCompletionRefComboBox("Station", "station", observationMediateur, TypesReferentiels.REFERENTIEL_STATION) {
309
 
325
 
310
			@Override
326
			@Override
311
			public void onModificationValeur() {
327
			public void onModificationValeur() {
312
				stationModifiee = true;
328
				stationModifiee = true;
313
			}
329
			}
314
 
330
 
315
			@Override
331
			@Override
316
			public void onValidationSaisie() {
332
			public void onValidationSaisie() {
317
				validerSaisie(Champs.STATION);
333
				validerSaisie(Champs.STATION);
318
			}  	
334
			}  	
319
	    };
335
	    };
320
	    panneauPremierColonne.add(station, new AnchorLayoutData("95%"));  
336
	    panneauPremierColonne.add(station, new AnchorLayoutData("95%"));  
321
	    
337
	    
322
		latitude = new TextField("Lat", "lat");
338
		latitude = new TextField("Lat", "lat");
323
		latitude.setGrowMax(70);
339
		latitude.setGrowMax(70);
324
		latitude.setAllowBlank(true);
340
		latitude.setAllowBlank(true);
325
	    
341
	    
326
	    longitude = new TextField("Lon", "lon");
342
	    longitude = new TextField("Lon", "lon");
327
	    longitude.setGrowMax(70);
343
	    longitude.setGrowMax(70);
328
		longitude.setAllowBlank(true);
344
		longitude.setAllowBlank(true);
329
				
345
				
330
		lienSelectionCommune = new Label("");
346
		lienSelectionCommune = new Label("");
331
		
347
		
332
		
348
		
333
		lienSelectionCommune.setId("conteneur_selection_commune");
349
		lienSelectionCommune.setId("conteneur_selection_commune");
334
		lienSelectionCommune.setStyleName("conteneur_selection_commune");
350
		lienSelectionCommune.setStyleName("conteneur_selection_commune");
335
		lienSelectionCommune.addStyleName("lien_actif");
351
		lienSelectionCommune.addStyleName("lien_actif");
336
			
352
			
337
		// Panneau de type plusieurs champs de formulaire sur une meme ligne, où seront renseignés Lat/Lon
353
		// Panneau de type plusieurs champs de formulaire sur une meme ligne, où seront renseignés Lat/Lon
338
		coordPanel = new MultiFieldPanel(); 
354
		coordPanel = new MultiFieldPanel(); 
339
		coordPanel.setPaddings(0, 0, 0, 10);
355
		coordPanel.setPaddings(0, 0, 0, 10);
340
		coordPanel.setVisible(false);
356
		coordPanel.setVisible(false);
341
		
357
		
342
		final double largeur ;
358
		final double largeur ;
343
		largeur = 120;
359
		largeur = 120;
344
				
360
				
345
		coordPanel.addToRow(latitude, new ColumnLayoutData(largeur)); 
361
		coordPanel.addToRow(latitude, new ColumnLayoutData(largeur)); 
346
		coordPanel.addToRow(longitude, new ColumnLayoutData(largeur));  
362
		coordPanel.addToRow(longitude, new ColumnLayoutData(largeur));  
347
		coordPanel.addToRow(lienSelectionCommune, new ColumnLayoutData(largeur)); 
363
		coordPanel.addToRow(lienSelectionCommune, new ColumnLayoutData(largeur)); 
348
		lienSelectionCommune.addClass("lien_decale");
364
		lienSelectionCommune.addClass("lien_decale");
349
		coordPanel.setBorder(false);
365
		coordPanel.setBorder(false);
350
		
366
		
351
		  //création du champs coordonnées	
367
		  //création du champs coordonnées	
352
		referentielGeo = Configuration.getReferentielGeo();
368
		referentielGeo = Configuration.getReferentielGeo();
353
		
369
		
354
		coordonnees = new TextField("Coordonnées", "", 0);
370
		coordonnees = new TextField("Coordonnées", "", 0);
355
		coordonnees.setMaxLength(0);
371
		coordonnees.setMaxLength(0);
356
		coordonnees.setReadOnly(true);
372
		coordonnees.setReadOnly(true);
357
		coordonnees.setCls("fieldname");
373
		coordonnees.setCls("fieldname");
358
		
374
		
359
		//création du lien "saisie X/Y" dans le formulaire
375
		//création du lien "saisie X/Y" dans le formulaire
360
		afficherFormulaireLatLon = new HTML("<span style=\"padding-left:30px;\" class=\"conteneur_lien_afficher_lat_lon\">" +
376
		afficherFormulaireLatLon = new HTML("<span style=\"padding-left:30px;\" class=\"conteneur_lien_afficher_lat_lon\">" +
361
				"<a title=\"Lat / Lon sont les latitudes / longitudes, à remplir en degrés décimaux\" class=\"lien_actif\" id=\"lien_coord\" href=\"#\" tabindex=\"6\">Saisie Lat/Lon ("+referentielGeo+")</a>" +
377
				"<a title=\"Lat / Lon sont les latitudes / longitudes, à remplir en degrés décimaux\" class=\"lien_actif\" id=\"lien_coord\" href=\"#\" tabindex=\"6\">Saisie Lat/Lon ("+referentielGeo+")</a>" +
362
				"<span><span style=\"padding-left:20px\" class=\"conteneur_lien_localiser_lat_lon\">"+
378
				"<span><span style=\"padding-left:20px\" class=\"conteneur_lien_localiser_lat_lon\">"+
363
				"<a title=\"Cliquez pour obtenir les coordonnées de votre observation à partir de la carte\" class=\"lien_actif\" id=\"lien_carto_coord\" href=\"#\" tabindex=\"7\">Localiser sur la carte</a>"+
379
				"<a title=\"Cliquez pour obtenir les coordonnées de votre observation à partir de la carte\" class=\"lien_actif\" id=\"lien_carto_coord\" href=\"#\" tabindex=\"7\">Localiser sur la carte</a>"+
364
				"</span>");
380
				"</span>");
365
						
381
						
366
			//ajout d'un listener sur le lien "saisie X/Y"	
382
			//ajout d'un listener sur le lien "saisie X/Y"	
367
			coordPanel.addListener(new PanelListenerAdapter() {
383
			coordPanel.addListener(new PanelListenerAdapter() {
368
				
384
				
369
				@Override
385
				@Override
370
				public void onAfterLayout(Container c) {
386
				public void onAfterLayout(Container c) {
371
					
387
					
372
					ExtElement lienCoord = Ext.get("lien_coord");
388
					ExtElement lienCoord = Ext.get("lien_coord");
373
					lienCoord.removeAllListeners();
389
					lienCoord.removeAllListeners();
374
					lienCoord.addListener("click", new EventCallback() {
390
					lienCoord.addListener("click", new EventCallback() {
375
						@Override
391
						@Override
376
						public void execute(EventObject e) {
392
						public void execute(EventObject e) {
377
							
393
							
378
							coordPanel.setVisible(!coordPanel.isVisible());
394
							coordPanel.setVisible(!coordPanel.isVisible());
379
							
395
							
380
							if(Ext.isIE()) {
396
							if(Ext.isIE()) {
381
								latitude.focus();
397
								latitude.focus();
382
							}
398
							}
383
							
399
							
384
							CarnetEnLigneMediateur.fireResize();
400
							CarnetEnLigneMediateur.fireResize();
385
						}
401
						}
386
					}) ;
402
					}) ;
387
					
403
					
388
					ExtElement lienCartoCoord = Ext.get("lien_carto_coord");
404
					ExtElement lienCartoCoord = Ext.get("lien_carto_coord");
389
					lienCartoCoord.removeAllListeners();
405
					lienCartoCoord.removeAllListeners();
390
					lienCartoCoord.addListener("click", new EventCallback() {
406
					lienCartoCoord.addListener("click", new EventCallback() {
391
						@Override
407
						@Override
392
						public void execute(EventObject e) {
408
						public void execute(EventObject e) {
393
							obtenirInformationCoord();
409
							obtenirInformationCoord();
394
						}
410
						}
395
					}) ;
411
					}) ;
396
				
412
				
397
					ExtElement lienCarto = Ext.get("lien_carto");
413
					ExtElement lienCarto = Ext.get("lien_carto");
398
					lienCarto.removeAllListeners();
414
					lienCarto.removeAllListeners();
399
					lienCarto.addListener("click", new EventCallback() {
415
					lienCarto.addListener("click", new EventCallback() {
400
 
416
 
401
						@Override
417
						@Override
402
						public void execute(EventObject e) {
418
						public void execute(EventObject e) {
403
							
419
							
404
							if(commune.getValue() != null && !commune.getValue().equals("") && !getDepartement().equals("")) {
420
							if(commune.getValue() != null && !commune.getValue().equals("") && !getDepartement().equals("")) {
405
								obtenirInformationCommune();
421
								obtenirInformationCommune();
406
								longlatAjoutee = true;
422
								longlatAjoutee = true;
407
					
423
					
408
							} else {
424
							} else {
409
								Window.alert("Veuillez renseigner une commune et un numéro de département sous la forme : Commune (departement)");
425
								Window.alert("Veuillez renseigner une commune et un numéro de département sous la forme : Commune (departement)");
410
							}
426
							}
411
						}
427
						}
412
					});
428
					});
413
					
429
					
414
					if(!Ext.isIE() && Window.getClientWidth() < 1200) {
430
					if(!Ext.isIE() && Window.getClientWidth() < 1200) {
415
						
431
						
416
						int largeurN = (int)largeur;
432
						int largeurN = (int)largeur;
417
						
433
						
418
						latitude.setWidth(largeurN+"px");
434
						latitude.setWidth(largeurN+"px");
419
						longitude.setWidth(largeurN+"px");
435
						longitude.setWidth(largeurN+"px");
420
						lienSelectionCommune.setWidth(largeurN+"px");						
436
						lienSelectionCommune.setWidth(largeurN+"px");						
421
					}
437
					}
422
				}
438
				}
423
			});
439
			});
424
						
440
						
425
		//Sur une meme ligne, ajout de plusieurs champs
441
		//Sur une meme ligne, ajout de plusieurs champs
426
		final MultiFieldPanel htmlPanel = new MultiFieldPanel();  
442
		final MultiFieldPanel htmlPanel = new MultiFieldPanel();  
427
		
443
		
428
		htmlPanel.addToRow(coordonnees, 100); 
444
		htmlPanel.addToRow(coordonnees, 100); 
429
		htmlPanel.addToRow(afficherFormulaireLatLon, new ColumnLayoutData(0.9)); 
445
		htmlPanel.addToRow(afficherFormulaireLatLon, new ColumnLayoutData(0.9)); 
430
		htmlPanel.setBorder(false);
446
		htmlPanel.setBorder(false);
431
		htmlPanel.setId("x-coord-panel");
447
		htmlPanel.setId("x-coord-panel");
432
			
448
			
433
		panneauPremierColonne.add(htmlPanel);
449
		panneauPremierColonne.add(htmlPanel);
434
		panneauPremierColonne.add(coordPanel);
450
		panneauPremierColonne.add(coordPanel);
435
	    
451
	    
436
	    date = new DateField("Date", "date", 200);  
452
	    date = new DateField("Date", "date", 200);  
437
	    date.setAllowBlank(true);
453
	    date.setAllowBlank(true);
438
	    formatDate = "d/m/Y";
454
	    formatDate = "d/m/Y";
439
	    date.setFormat(formatDate) ;
455
	    date.setFormat(formatDate) ;
440
	    date.setTitle("Date de l'observation au format jj/mm/aaaa");
456
	    date.setTitle("Date de l'observation au format jj/mm/aaaa");
441
	    //date.setTabIndex(5);
457
	    //date.setTabIndex(5);
442
	    panneauPremierColonne.add(date, new AnchorLayoutData("55%"));  
458
	    panneauPremierColonne.add(date, new AnchorLayoutData("55%"));  
443
 	
459
 	
444
		espece=new ComboBox("Espèce","nom");  
460
		espece=new ComboBox("Espèce","nom");  
445
			
461
			
446
		final String resultTplEspece = "<div class=\"search-item-espece {indicateurNomRetenu}\">{nom}</div>";  
462
		final String resultTplEspece = "<div class=\"search-item-espece {indicateurNomRetenu}\">{nom}</div>";  
447
 
463
 
448
		
464
		
449
		espece.setTpl(resultTplEspece);
465
		espece.setTpl(resultTplEspece);
450
		espece.setMode(ComboBox.REMOTE);
466
		espece.setMode(ComboBox.REMOTE);
451
		// espece.setPageSize(10); // Ne fonctionne pas 
467
		// espece.setPageSize(10); // Ne fonctionne pas 
452
		espece.setItemSelector("div.search-item-espece");
468
		espece.setItemSelector("div.search-item-espece");
453
		espece.setTypeAhead(true);  
469
		espece.setTypeAhead(true);  
454
		espece.setLoadingText("Recherche...");  
470
		espece.setLoadingText("Recherche...");  
455
		  
471
		  
456
		espece.setHideTrigger(true);
472
		espece.setHideTrigger(true);
457
		//espece.setTabIndex(6);
473
		//espece.setTabIndex(6);
458
 
474
 
459
	    panneauPremierColonne.add(espece, new AnchorLayoutData("95%"));   
475
	    panneauPremierColonne.add(espece, new AnchorLayoutData("95%"));   
-
 
476
	    
-
 
477
	    selecteurAbondance = new ComboBox();
-
 
478
	    selecteurAbondance.setLabel("Abondance");
-
 
479
	    selecteurAbondance.setStore(getValeursAbondance());
-
 
480
	    selecteurAbondance.setDisplayField("label") ;
-
 
481
	    selecteurAbondance.setValueField("valeur");
-
 
482
	    selecteurAbondance.setEditable(true);
-
 
483
	    selecteurAbondance.setHideTrigger(false);
-
 
484
	    selecteurAbondance.setForceSelection(false);
-
 
485
	    panneauPremierColonne.add(selecteurAbondance, new AnchorLayoutData("50%"));   
-
 
486
	    
-
 
487
	    selecteurCertitude = new ComboBox();
-
 
488
	    selecteurCertitude.setLabel("Certitude");
-
 
489
	    selecteurCertitude.setStore(getValeursCertitude());
-
 
490
	    selecteurCertitude.setDisplayField("label") ;
-
 
491
	    selecteurCertitude.setValueField("valeur");
-
 
492
	    selecteurCertitude.setEditable(true);
-
 
493
	    selecteurCertitude.setHideTrigger(false);
-
 
494
	    selecteurCertitude.setForceSelection(false);
-
 
495
	    panneauPremierColonne.add(selecteurCertitude, new AnchorLayoutData("50%"));   
460
	    
496
	    
461
	    lieudit = new AutoCompletionRefComboBox("Lieu-dit", "lieudit",observationMediateur,TypesReferentiels.REFERENTIEL_LIEU_DIT) {
497
	    lieudit = new AutoCompletionRefComboBox("Lieu-dit", "lieudit",observationMediateur,TypesReferentiels.REFERENTIEL_LIEU_DIT) {
462
 
498
 
463
			@Override
499
			@Override
464
			public void onModificationValeur() {
500
			public void onModificationValeur() {
465
				lieuDitModifie = true;			
501
				lieuDitModifie = true;			
466
			}
502
			}
467
 
503
 
468
			@Override
504
			@Override
469
			public void onValidationSaisie() {
505
			public void onValidationSaisie() {
470
				validerSaisie(Champs.LIEUDIT);
506
				validerSaisie(Champs.LIEUDIT);
471
			}
507
			}
472
	    };
508
	    };
473
	    panneauSecondeColonne.add(lieudit,  new AnchorLayoutData("95%"));  
509
	    panneauSecondeColonne.add(lieudit,  new AnchorLayoutData("95%"));  
474
	       	    
510
	       	    
475
	    milieu = new AutoCompletionRefComboBox("Milieu","milieu",observationMediateur,TypesReferentiels.REFERENTIEL_MILIEU) {
511
	    milieu = new AutoCompletionRefComboBox("Milieu","milieu",observationMediateur,TypesReferentiels.REFERENTIEL_MILIEU) {
476
 
512
 
477
			@Override
513
			@Override
478
			public void onModificationValeur() {
514
			public void onModificationValeur() {
479
				milieuModifie = true;
515
				milieuModifie = true;
480
			}
516
			}
481
 
517
 
482
			@Override
518
			@Override
483
			public void onValidationSaisie() {
519
			public void onValidationSaisie() {
484
				validerSaisie(Champs.MILIEU);
520
				validerSaisie(Champs.MILIEU);
485
			}
521
			}
486
	    	
522
	    	
487
	    };
523
	    };
488
	    panneauSecondeColonne.add(milieu,  new AnchorLayoutData("95%"));
524
	    panneauSecondeColonne.add(milieu,  new AnchorLayoutData("95%"));
489
	    
525
	    
490
	    comment = new TextArea("Notes", "comment");  
526
	    comment = new TextArea("Notes", "comment");  
491
	    comment.setAllowBlank(true);
527
	    comment.setAllowBlank(true);
492
	    comment.setHeight(50);
528
	    comment.setHeight(50);
493
	    
529
	    
494
	    //comment.setTabIndex(7);
530
	    //comment.setTabIndex(7);
495
	    panneauSecondeColonne.add(comment, new AnchorLayoutData("95%") );
531
	    panneauSecondeColonne.add(comment, new AnchorLayoutData("95%") );
496
	    
532
	    
497
	    if (Window.getClientWidth() > Window.getClientHeight() || Window.getClientWidth() < 800) {
533
	    if (Window.getClientWidth() > Window.getClientHeight() || Window.getClientWidth() < 800) {
498
			panneauIntermediaire.add(panneauPremierColonne, new ColumnLayoutData(.5));
534
			panneauIntermediaire.add(panneauPremierColonne, new ColumnLayoutData(.5));
499
			panneauIntermediaire.add(panneauSecondeColonne, new ColumnLayoutData(.5));
535
			panneauIntermediaire.add(panneauSecondeColonne, new ColumnLayoutData(.5));
500
	    }
536
	    }
501
	    else {
537
	    else {
502
			panneauIntermediaire.add(panneauPremierColonne);
538
			panneauIntermediaire.add(panneauPremierColonne);
503
			panneauIntermediaire.add(panneauSecondeColonne);
539
			panneauIntermediaire.add(panneauSecondeColonne);
504
	    	
540
	    	
505
	    }
541
	    }
506
			
542
			
507
		panneauFormulaire.add(panneauIntermediaire);
543
		panneauFormulaire.add(panneauIntermediaire);
508
		
544
		
509
		Object[][] mode = {{"création",false} , {"modification", true} };
545
		Object[][] mode = {{"création",false} , {"modification", true} };
510
		storeMode = new SimpleStore(new String[] { "nom_mode", "mode" },
546
		storeMode = new SimpleStore(new String[] { "nom_mode", "mode" },
511
				mode);
547
				mode);
512
		storeMode.load();
548
		storeMode.load();
513
		selecteurMode.setStore(storeMode);
549
		selecteurMode.setStore(storeMode);
514
		selecteurMode.setDisplayField("nom_mode") ;
550
		selecteurMode.setDisplayField("nom_mode") ;
515
		selecteurMode.setLabel("mode ") ;
551
		selecteurMode.setLabel("mode ") ;
516
		selecteurMode.setForceSelection(true) ;
552
		selecteurMode.setForceSelection(true) ;
517
		selecteurMode.setValue("création") ;
553
		selecteurMode.setValue("création") ;
518
		selecteurMode.setEditable(false) ;
554
		selecteurMode.setEditable(false) ;
519
		selecteurMode.setCls("x-selec-crea") ;
555
		selecteurMode.setCls("x-selec-crea") ;
520
		
556
		
521
		bt = new Toolbar() ;
557
		bt = new Toolbar() ;
522
		bt.addSpacer() ;
558
		bt.addSpacer() ;
523
		bt.addText("Mode de saisie ") ;
559
		bt.addText("Mode de saisie ") ;
524
		bt.addField(selecteurMode) ;
560
		bt.addField(selecteurMode) ;
525
		
561
		
526
		
562
		
527
		if (Ext.isIE()) {
563
		if (Ext.isIE()) {
528
			panneauPremierColonne.setButtonAlign(Position.RIGHT);
564
			panneauPremierColonne.setButtonAlign(Position.RIGHT);
529
			panneauPremierColonne.addButton(boutonOK);
565
			panneauPremierColonne.addButton(boutonOK);
530
			panneauSecondeColonne.setButtonAlign(Position.LEFT);
566
			panneauSecondeColonne.setButtonAlign(Position.LEFT);
531
			panneauPremierColonne.addButton(boutonAnnuler);
567
			panneauPremierColonne.addButton(boutonAnnuler);
532
		}
568
		}
533
		else {
569
		else {
534
		
570
		
535
			panneauFormulaire.addButton(boutonOK);
571
			panneauFormulaire.addButton(boutonOK);
536
			panneauFormulaire.addButton(boutonAnnuler);		
572
			panneauFormulaire.addButton(boutonAnnuler);		
537
		}
573
		}
538
		
574
		
539
		
575
		
540
		selecteurMode.addListener(new ComboBoxListenerAdapter() {
576
		selecteurMode.addListener(new ComboBoxListenerAdapter() {
541
 
577
 
542
			@Override
578
			@Override
543
			public void onSelect(ComboBox comboBox, Record record, int index) {
579
			public void onSelect(ComboBox comboBox, Record record, int index) {
544
				
580
				
545
				// et on met la valeur à jour dans la combobox
581
				// et on met la valeur à jour dans la combobox
546
				comboBox.setValue(record.getAsString("nom_mode"));
582
				comboBox.setValue(record.getAsString("nom_mode"));
547
				setModification(record.getAsString("mode")) ;
583
				setModification(record.getAsString("mode")) ;
548
			}
584
			}
549
 
585
 
550
		});
586
		});
551
	
587
	
552
		this.add(panneauFormulaire) ;
588
		this.add(panneauFormulaire) ;
553
		this.setTopToolbar(bt) ;
589
		this.setTopToolbar(bt) ;
554
		
590
		
555
		this.setAutoScroll(true);
591
		this.setAutoScroll(true);
556
	
592
	
557
		
593
		
558
		panneauFormulaire.addListener(new PanelListenerAdapter() {
594
		panneauFormulaire.addListener(new PanelListenerAdapter() {
559
	        @Override
595
	        @Override
560
			public void onResize(BoxComponent component, int adjWidth, int adjHeight, int rawWidth, int rawHeight) {
596
			public void onResize(BoxComponent component, int adjWidth, int adjHeight, int rawWidth, int rawHeight) {
561
	        	panneauIntermediaire.setWidth(rawWidth);
597
	        	panneauIntermediaire.setWidth(rawWidth);
562
	        	panneauIntermediaire.setHeight(rawHeight);
598
	        	panneauIntermediaire.setHeight(rawHeight);
563
	        	
599
	        	
564
	        	panneauPremierColonne.doLayout();
600
	        	panneauPremierColonne.doLayout();
565
	        	panneauSecondeColonne.doLayout();
601
	        	panneauSecondeColonne.doLayout();
566
	        		        	
602
	        		        	
567
	        	htmlCommunePanel.doLayout();
603
	        	htmlCommunePanel.doLayout();
568
	        	htmlPanel.doLayout();
604
	        	htmlPanel.doLayout();
569
	        	
605
	        	
570
	        	doLayout();
606
	        	doLayout();
571
	     }});
607
	     }});
572
		
608
		
573
		// on ajoute les listeners
609
		// on ajoute les listeners
574
		
-
 
575
		
-
 
576
		ajouterListeners() ;
610
		ajouterListeners() ;
577
		
-
 
578
		saisieTabindex();
611
		saisieTabindex();
-
 
612
	}
579
		
613
	
-
 
614
	private Store getValeursAbondance() {		
-
 
615
		Object[][] valeurs = {{"i : un seul individu","i"}, 
-
 
616
								{"r : rare (quelques pieds)","r"}, 
-
 
617
								{"+ : recouvrement R < 1%","+"}, 
-
 
618
								{"1 : 1% < R < 5%","1"}, 
-
 
619
								{"2 : 5% < R < 25%","2"}, 
-
 
620
								{"3 : 25% < R < 50%","3"}, 
-
 
621
								{"4 : 50% < R < 75%","4"}, 
-
 
622
								{"5 : recouvrement R > 75%","5"} 
-
 
623
							};
-
 
624
		SimpleStore storeAbondance = new SimpleStore(new String[] {"label","valeur"},valeurs);
-
 
625
		storeAbondance.load();
-
 
626
		return storeAbondance;
-
 
627
	}
-
 
628
	
-
 
629
	private Store getValeursCertitude() {		
-
 
630
		Object[][] valeurs = {{"Certain","certain"}, 
-
 
631
								{"Douteux","douteux"}, 
-
 
632
								{"A déterminer","aDeterminer"}
-
 
633
							};
-
 
634
		SimpleStore storeCertitude = new SimpleStore(new String[] {"label","valeur"},valeurs);
-
 
635
		storeCertitude.load();
-
 
636
		return storeCertitude;
580
	}
637
	}
581
	
638
	
582
	private void ajouterListeners()
639
	private void ajouterListeners()
583
	{	
640
	{	
584
		// Listener completion communne 
641
		// Listener completion communne 
585
		final Rafraichissable r = this;
642
		final Rafraichissable r = this;
586
		
643
		
587
		   commune.addListener(new ComboBoxListenerAdapter() {  
644
		   commune.addListener(new ComboBoxListenerAdapter() {  
588
	             @Override
645
	             @Override
589
				public void onSelect(ComboBox comboBox, Record record, int index) {  
646
				public void onSelect(ComboBox comboBox, Record record, int index) {  
590
	                 commune.setValue(record.getAsString("commune"));
647
	                 commune.setValue(record.getAsString("commune"));
591
	                 departement=record.getAsString("departement");
648
	                 departement=record.getAsString("departement");
592
	                 codeInseeCommune=record.getAsString("codeInsee");
649
	                 codeInseeCommune=record.getAsString("codeInsee");
593
	                 selectionCommune=true;
650
	                 selectionCommune=true;
594
	                 commune.collapse();
651
	                 commune.collapse();
595
	             }  
652
	             }  
596
	             
653
	             
597
	             @Override
654
	             @Override
598
				public void onExpand(ComboBox comboBox) {
655
				public void onExpand(ComboBox comboBox) {
599
	            	 comboBox.focus();
656
	            	 comboBox.focus();
600
	             }
657
	             }
601
	         });  
658
	         });  
602
	         
659
	         
603
	        
660
	        
604
			ListenerConfig listenerConfigCommune=new ListenerConfig();
661
			ListenerConfig listenerConfigCommune=new ListenerConfig();
605
			listenerConfigCommune.setDelay(200);
662
			listenerConfigCommune.setDelay(200);
606
			listenerConfigCommune.setStopPropagation(false);
663
			listenerConfigCommune.setStopPropagation(false);
607
			listenerConfigCommune.setStopEvent(false);
664
			listenerConfigCommune.setStopEvent(false);
608
			
665
			
609
		    commune.addKeyPressListener(new EventCallback()	{
666
		    commune.addKeyPressListener(new EventCallback()	{
610
		    	
667
		    	
611
	    	    @Override
668
	    	    @Override
612
				public void execute(EventObject e) {
669
				public void execute(EventObject e) {
613
	    	    	
670
	    	    	
614
	    	    		  
671
	    	    		  
615
	    	    		switch(e.getKey()) {
672
	    	    		switch(e.getKey()) {
616
	    	    	      
673
	    	    	      
617
    	    				case KEY_ALT:
674
    	    				case KEY_ALT:
618
	    	    	        case KEY_CTRL:
675
	    	    	        case KEY_CTRL:
619
	    	    	        case KEY_DOWN:
676
	    	    	        case KEY_DOWN:
620
	    	    	        case KEY_END:
677
	    	    	        case KEY_END:
621
	    	    	        case KEY_ESCAPE:
678
	    	    	        case KEY_ESCAPE:
622
	    	    	        case KEY_HOME:
679
	    	    	        case KEY_HOME:
623
	    	    	        case KEY_LEFT:
680
	    	    	        case KEY_LEFT:
624
	    	    	        case KEY_PAGEDOWN:
681
	    	    	        case KEY_PAGEDOWN:
625
	    	    	        case KEY_PAGEUP:
682
	    	    	        case KEY_PAGEUP:
626
	    	    	        case KEY_RIGHT:
683
	    	    	        case KEY_RIGHT:
627
	    	    	        case KEY_SHIFT:
684
	    	    	        case KEY_SHIFT:
628
	    	    	        case KEY_TAB:
685
	    	    	        case KEY_TAB:
629
	    	    	        case KEY_UP:
686
	    	    	        case KEY_UP:
630
	    	    	    	
687
	    	    	    	
631
	    	    	        break;
688
	    	    	        break;
632
	    	    		
689
	    	    		
633
	    	    	    	case KEY_ENTER:
690
	    	    	    	case KEY_ENTER:
634
	    	    	    	  
691
	    	    	    	  
635
		    	    	    	 if (selectionCommune) {
692
		    	    	    	 if (selectionCommune) {
636
		    	    	    		 communeModifiee= true;
693
		    	    	    		 communeModifiee= true;
637
		    	    	    		 selectionCommune=false;
694
		    	    	    		 selectionCommune=false;
638
		    	    	    	 }
695
		    	    	    	 }
639
		    	    	    	else {
696
		    	    	    	else {
640
	
697
	
641
		    	    	    		validerSaisie(Champs.COMMUNE);
698
		    	    	    		validerSaisie(Champs.COMMUNE);
642
		    	    	    		// lancer mise a jour 	    	    	    		 
699
		    	    	    		// lancer mise a jour 	    	    	    		 
643
		    	    	    	 }
700
		    	    	    	 }
644
		    	    	    break;
701
		    	    	    break;
645
	    	    	       
702
	    	    	       
646
		    	    	    default:
703
		    	    	    default:
647
		    	    	    	  departement="";
704
		    	    	    	  departement="";
648
		    	    	    	  commune.collapse();	
705
		    	    	    	  commune.collapse();	
649
		    	    	    	  obtenirListeReferentielCommune();
706
		    	    	    	  obtenirListeReferentielCommune();
650
		    	    	    	  communeModifiee= true;
707
		    	    	    	  communeModifiee= true;
651
		    	    	    	  	    	    	        
708
		    	    	    	  	    	    	        
652
		    	    	    break;
709
		    	    	    break;
653
	    	    	    }
710
	    	    	    }
654
	     			}
711
	     			}
655
	    		},    listenerConfigCommune
712
	    		},    listenerConfigCommune
656
			);
713
			);
657
		    
714
		    
658
		    date.addKeyPressListener(new EventCallback() {
715
		    date.addKeyPressListener(new EventCallback() {
659
 
716
 
660
				@Override
717
				@Override
661
				public void execute(EventObject e) {
718
				public void execute(EventObject e) {
662
					// TODO Auto-generated method stub
719
					// TODO Auto-generated method stub
663
					switch(e.getKey()) {
720
					switch(e.getKey()) {
664
					
721
					
665
						case KEY_ALT:
722
						case KEY_ALT:
666
		    	        case KEY_CTRL:
723
		    	        case KEY_CTRL:
667
		    	        case KEY_DOWN:
724
		    	        case KEY_DOWN:
668
		    	        case KEY_END:
725
		    	        case KEY_END:
669
		    	        case KEY_ESCAPE:
726
		    	        case KEY_ESCAPE:
670
		    	        case KEY_HOME:
727
		    	        case KEY_HOME:
671
		    	        case KEY_LEFT:
728
		    	        case KEY_LEFT:
672
		    	        case KEY_PAGEDOWN:
729
		    	        case KEY_PAGEDOWN:
673
		    	        case KEY_PAGEUP:
730
		    	        case KEY_PAGEUP:
674
		    	        case KEY_RIGHT:
731
		    	        case KEY_RIGHT:
675
		    	        case KEY_SHIFT:
732
		    	        case KEY_SHIFT:
676
		    	        case KEY_TAB:
733
		    	        case KEY_TAB:
677
		    	        	if(date.getRawValue().equals(VALEURS_MULTIPLES)) {
734
		    	        	if(date.getRawValue().equals(VALEURS_MULTIPLES)) {
678
		    	        		date.clearInvalid();
735
		    	        		date.clearInvalid();
679
		    	        	}
736
		    	        	}
680
		    	        case KEY_UP:
737
		    	        case KEY_UP:
681
		    	    	
738
		    	    	
682
		    	        break;
739
		    	        break;
683
	  	    	      
740
	  	    	      
684
	  	    	      case KEY_ENTER:	  	
741
	  	    	      case KEY_ENTER:	  	
685
	  	    	    		validerSaisie(Champs.DATE); 
742
	  	    	    		validerSaisie(Champs.DATE); 
686
	  	    	    	  break;
743
	  	    	    	  break;
687
	  	    	       
744
	  	    	       
688
	  	    	      default:
745
	  	    	      default:
689
	  					dateModifiee = true;
746
	  					dateModifiee = true;
690
					}
747
					}
691
				}
748
				}
692
		    });
749
		    });
693
		    
750
		    
694
		    date.addListener(new DatePickerListenerAdapter() {
751
		    date.addListener(new DatePickerListenerAdapter() {
695
 
752
 
696
				@Override
753
				@Override
697
				public void onSelect(DatePicker dataPicker, Date date) {
754
				public void onSelect(DatePicker dataPicker, Date date) {
698
					dateModifiee = true;
755
					dateModifiee = true;
699
				}
756
				}
700
		    });
757
		    });
701
		    
758
		    
702
		    ListenerConfig listenerConfigAutocompletion=new ListenerConfig();
759
		    ListenerConfig listenerConfigAutocompletion=new ListenerConfig();
703
		    listenerConfigAutocompletion.setDelay(200);
760
		    listenerConfigAutocompletion.setDelay(200);
704
		    listenerConfigAutocompletion.setStopPropagation(false);
761
		    listenerConfigAutocompletion.setStopPropagation(false);
705
		    listenerConfigAutocompletion.setStopEvent(false);
762
		    listenerConfigAutocompletion.setStopEvent(false);
706
 
763
 
707
		    			
764
		    			
708
			// Listener completion espece 
765
			// Listener completion espece 
709
			espece.addListener(new ComboBoxListenerAdapter() {  
766
			espece.addListener(new ComboBoxListenerAdapter() {  
710
	             @Override
767
	             @Override
711
				public void onSelect(ComboBox comboBox, Record record, int index) {  
768
				public void onSelect(ComboBox comboBox, Record record, int index) {  
712
	            	 espece.setValue(record.getAsString("nom"));
769
	            	 espece.setValue(record.getAsString("nom"));
713
	            	 numeroNom=record.getAsString("numeroNom");
770
	            	 numeroNom=record.getAsString("numeroNom");
714
	                 selectionEspece=true;
771
	                 selectionEspece=true;
715
	                 observationMediateur.obtenirImageInformationExternes(numeroNom);
772
	                 observationMediateur.obtenirImageInformationExternes(numeroNom);
716
	             }  
773
	             }  
717
	         });  
774
	         });  
718
	         
775
	         
719
 
776
 
720
			ListenerConfig listenerConfigEspece=new ListenerConfig();
777
			ListenerConfig listenerConfigEspece=new ListenerConfig();
721
			listenerConfigEspece.setDelay(10);
778
			listenerConfigEspece.setDelay(10);
722
			listenerConfigEspece.setStopPropagation(false);
779
			listenerConfigEspece.setStopPropagation(false);
723
			listenerConfigEspece.setStopEvent(false);			
780
			listenerConfigEspece.setStopEvent(false);			
724
 
781
 
725
		
782
		
726
			espece.addKeyPressListener(new EventCallback()	{
783
			espece.addKeyPressListener(new EventCallback()	{
727
		    	
784
		    	
728
		    	    @Override
785
		    	    @Override
729
					public void execute(EventObject e) {
786
					public void execute(EventObject e) {
730
		    	    	
787
		    	    	
731
		    	    		  
788
		    	    		  
732
		    	    		  switch(e.getKey()) {
789
		    	    		  switch(e.getKey()) {
733
		    	    	      	    		  
790
		    	    	      	    		  
734
		    	    		  
791
		    	    		  
735
		    	    		  case KEY_ALT:
792
		    	    		  case KEY_ALT:
736
		    	    	      case KEY_CTRL:
793
		    	    	      case KEY_CTRL:
737
		    	    	      case KEY_DOWN:
794
		    	    	      case KEY_DOWN:
738
		    	    	      case KEY_END:
795
		    	    	      case KEY_END:
739
		    	    	      case KEY_ESCAPE:
796
		    	    	      case KEY_ESCAPE:
740
		    	    	      case KEY_HOME:
797
		    	    	      case KEY_HOME:
741
		    	    	      case KEY_LEFT:
798
		    	    	      case KEY_LEFT:
742
		    	    	      case KEY_PAGEDOWN:
799
		    	    	      case KEY_PAGEDOWN:
743
		    	    	      case KEY_PAGEUP:
800
		    	    	      case KEY_PAGEUP:
744
		    	    	      case KEY_RIGHT:
801
		    	    	      case KEY_RIGHT:
745
		    	    	      case KEY_SHIFT:
802
		    	    	      case KEY_SHIFT:
746
		    	    	      case KEY_TAB:
803
		    	    	      case KEY_TAB:
747
		    	    	      case KEY_UP:
804
		    	    	      case KEY_UP:
748
		    	    	    	
805
		    	    	    	
749
		    	    	        break;
806
		    	    	        break;
750
		    	    	      
807
		    	    	      
751
		    	    	      case KEY_ENTER:
808
		    	    	      case KEY_ENTER:
752
		    	    	    	  
809
		    	    	    	  
753
			    	    	    	if(selectionEspece) {
810
			    	    	    	if(selectionEspece) {
754
			    	    	    		especeModifiee = true;
811
			    	    	    		especeModifiee = true;
755
			    	    	    		selectionEspece=false;
812
			    	    	    		selectionEspece=false;
756
			    	    	    	}
813
			    	    	    	}
757
			    	    	    	else {
814
			    	    	    	else {
758
			    	    	    		validerSaisie(Champs.ESPECE); 	    	    		 
815
			    	    	    		validerSaisie(Champs.ESPECE); 	    	    		 
759
			    	    	    	}
816
			    	    	    	}
760
		    	    	    	
817
		    	    	    	
761
		    	    	    	  break;
818
		    	    	    	  break;
762
		    	    	       
819
		    	    	       
763
		    	    	      default:
820
		    	    	      default:
764
		    	    	    	  
821
		    	    	    	  
765
		    	    	    	  numeroNom="";
822
		    	    	    	  numeroNom="";
766
		    	    	    	  obtenirListeReferentielNom();
823
		    	    	    	  obtenirListeReferentielNom();
767
		    	    	    	  especeModifiee = true;
824
		    	    	    	  especeModifiee = true;
768
		    	    	    	  	    	    	        
825
		    	    	    	  	    	    	        
769
		    	    	        break;
826
		    	    	        break;
770
		    	    	    }
827
		    	    	    }
771
 
828
 
772
		    	    	 
829
		    	    	 
773
		    	    	
830
		    	    	
774
		     		}
831
		     		}
775
		    	 
832
		    	 
776
		    		},    listenerConfigEspece
833
		    		},    listenerConfigEspece
777
		    	
834
		    	
778
			);
835
			);
779
			
836
			
780
			comment.addKeyPressListener(new EventCallback() {
837
			comment.addKeyPressListener(new EventCallback() {
781
 
838
 
782
				@Override
839
				@Override
783
				public void execute(EventObject e) {
840
				public void execute(EventObject e) {
784
					switch(e.getKey()) { 
841
					switch(e.getKey()) { 
785
						case KEY_ALT:
842
						case KEY_ALT:
786
			    	      case KEY_CTRL:
843
			    	      case KEY_CTRL:
787
			    	      case KEY_DOWN:
844
			    	      case KEY_DOWN:
788
			    	      case KEY_END:
845
			    	      case KEY_END:
789
			    	      case KEY_ESCAPE:
846
			    	      case KEY_ESCAPE:
790
			    	      case KEY_HOME:
847
			    	      case KEY_HOME:
791
			    	      case KEY_LEFT:
848
			    	      case KEY_LEFT:
792
			    	      case KEY_PAGEDOWN:
849
			    	      case KEY_PAGEDOWN:
793
			    	      case KEY_PAGEUP:
850
			    	      case KEY_PAGEUP:
794
			    	      case KEY_RIGHT:
851
			    	      case KEY_RIGHT:
795
			    	      case KEY_SHIFT:
852
			    	      case KEY_SHIFT:
796
			    	      case KEY_TAB:
853
			    	      case KEY_TAB:
797
			    	      case KEY_UP:
854
			    	      case KEY_UP:
798
		    	    	
855
		    	    	
799
		    	        break;
856
		    	        break;
800
 
857
 
801
		    	        default:
858
		    	        default:
802
						commModifie = true;
859
						commModifie = true;
803
					}
860
					}
804
				}
861
				}
805
		    });
862
		    });
806
			
863
			
807
			tCoord = new Timer() {
864
			tCoord = new Timer() {
808
 
865
 
809
				@Override
866
				@Override
810
				public void run() {
867
				public void run() {
811
    	        	double[] coord = coordonneesValides();
868
    	        	double[] coord = coordonneesValides();
812
    	        	if(!rechercheCommuneEnCours && coord != null && (longModifiee || latModifiee)) {
869
    	        	if(!rechercheCommuneEnCours && coord != null && (longModifiee || latModifiee)) {
813
    	        		rechercheCommuneEnCours = true;
870
    	        		rechercheCommuneEnCours = true;
814
    	        		Ext.get(lienSelectionCommune.getElement()).mask("recherche");
871
    	        		Ext.get(lienSelectionCommune.getElement()).mask("recherche");
815
    	        		observationMediateur.obtenirInformationCoord(r,LatLng.newInstance(coord[0], coord[1]));
872
    	        		observationMediateur.obtenirInformationCoord(r,LatLng.newInstance(coord[0], coord[1]));
816
    	        	}
873
    	        	}
817
				}
874
				}
818
				
875
				
819
			};
876
			};
820
			
877
			
821
			latitude.addKeyPressListener(new EventCallback() {
878
			latitude.addKeyPressListener(new EventCallback() {
822
 
879
 
823
				@Override
880
				@Override
824
				public void execute(EventObject e) {
881
				public void execute(EventObject e) {
825
					switch(e.getKey()) { 
882
					switch(e.getKey()) { 
826
						case KEY_ALT:
883
						case KEY_ALT:
827
			    	      case KEY_CTRL:
884
			    	      case KEY_CTRL:
828
			    	      case KEY_DOWN:
885
			    	      case KEY_DOWN:
829
			    	      case KEY_END:
886
			    	      case KEY_END:
830
			    	      case KEY_ESCAPE:
887
			    	      case KEY_ESCAPE:
831
			    	      case KEY_HOME:
888
			    	      case KEY_HOME:
832
			    	      case KEY_LEFT:
889
			    	      case KEY_LEFT:
833
			    	      case KEY_PAGEDOWN:
890
			    	      case KEY_PAGEDOWN:
834
			    	      case KEY_PAGEUP:
891
			    	      case KEY_PAGEUP:
835
			    	      case KEY_RIGHT:
892
			    	      case KEY_RIGHT:
836
			    	      case KEY_SHIFT:
893
			    	      case KEY_SHIFT:
837
			    	      case KEY_TAB:
894
			    	      case KEY_TAB:
838
			    	      case KEY_UP:
895
			    	      case KEY_UP:
839
		    	    	
896
		    	    	
840
		    	        break;
897
		    	        break;
841
		    	        
898
		    	        
842
			    	      case KEY_ENTER:	  	    	    	  
899
			    	      case KEY_ENTER:	  	    	    	  
843
	  	    	    		validerSaisie(Champs.LATITUDE); 	    	    		 
900
	  	    	    		validerSaisie(Champs.LATITUDE); 	    	    		 
844
	  	    	    	  break;
901
	  	    	    	  break;
845
 
902
 
846
		    	        default:
903
		    	        default:
847
						latModifiee = true;
904
						latModifiee = true;
848
	    	        	tCoord.cancel();
905
	    	        	tCoord.cancel();
849
	    	        	tCoord.schedule(250);
906
	    	        	tCoord.schedule(250);
850
					}
907
					}
851
				}
908
				}
852
		    });
909
		    });
853
			
910
			
854
			longitude.addKeyPressListener(new EventCallback() {
911
			longitude.addKeyPressListener(new EventCallback() {
855
 
912
 
856
				@Override
913
				@Override
857
				public void execute(EventObject e) {
914
				public void execute(EventObject e) {
858
					switch(e.getKey()) { 
915
					switch(e.getKey()) { 
859
					
916
					
860
						case KEY_ALT:
917
						case KEY_ALT:
861
			    	      case KEY_CTRL:
918
			    	      case KEY_CTRL:
862
			    	      case KEY_DOWN:
919
			    	      case KEY_DOWN:
863
			    	      case KEY_END:
920
			    	      case KEY_END:
864
			    	      case KEY_ESCAPE:
921
			    	      case KEY_ESCAPE:
865
			    	      case KEY_HOME:
922
			    	      case KEY_HOME:
866
			    	      case KEY_LEFT:
923
			    	      case KEY_LEFT:
867
			    	      case KEY_PAGEDOWN:
924
			    	      case KEY_PAGEDOWN:
868
			    	      case KEY_PAGEUP:
925
			    	      case KEY_PAGEUP:
869
			    	      case KEY_RIGHT:
926
			    	      case KEY_RIGHT:
870
			    	      case KEY_SHIFT:
927
			    	      case KEY_SHIFT:
871
			    	      case KEY_UP:
928
			    	      case KEY_UP:
872
			    	      case KEY_TAB:
929
			    	      case KEY_TAB:
873
			    	      break;
930
			    	      break;
874
			    	      
931
			    	      
875
			    	      case KEY_ENTER:	  	    	    	  
932
			    	      case KEY_ENTER:	  	    	    	  
876
		  	    	    		validerSaisie(Champs.LONGITUDE); 	    	    		 
933
		  	    	    		validerSaisie(Champs.LONGITUDE); 	    	    		 
877
		  	    	    	break;
934
		  	    	    	break;
878
 
935
 
879
		    	        default:
936
		    	        default:
880
							longModifiee = true;
937
							longModifiee = true;
881
		    	        	tCoord.cancel();
938
		    	        	tCoord.cancel();
882
		    	        	tCoord.schedule(250);
939
		    	        	tCoord.schedule(250);
883
					}
940
					}
884
				}
941
				}
885
		    });
942
		    });
-
 
943
			
-
 
944
			selecteurAbondance.addListener(new ComboBoxListenerAdapter() {  
-
 
945
 
-
 
946
				@Override
-
 
947
				public void onSelect(ComboBox comboBox, Record record, int index) {  
-
 
948
	                 selectionAbondance=true;
-
 
949
	                 abondanceModifiee = true;
-
 
950
	             }
-
 
951
	         });  
-
 
952
			
-
 
953
			selecteurAbondance.addKeyPressListener(new EventCallback() {
-
 
954
 
-
 
955
				@Override
-
 
956
				public void execute(EventObject e) {
-
 
957
					switch(e.getKey()) { 
-
 
958
						case KEY_ALT:
-
 
959
			    	      case KEY_CTRL:
-
 
960
			    	      case KEY_DOWN:
-
 
961
			    	      case KEY_END:
-
 
962
			    	      case KEY_ESCAPE:
-
 
963
			    	      case KEY_HOME:
-
 
964
			    	      case KEY_LEFT:
-
 
965
			    	      case KEY_PAGEDOWN:
-
 
966
			    	      case KEY_PAGEUP:
-
 
967
			    	      case KEY_RIGHT:
-
 
968
			    	      case KEY_SHIFT:
-
 
969
			    	      case KEY_TAB:
-
 
970
			    	      case KEY_UP:
-
 
971
		    	        break;
-
 
972
		    	        
-
 
973
			    	    case KEY_ENTER:
-
 
974
			    	    	if(!selectionAbondance) {	
-
 
975
		  	    	    		validerSaisie(Champs.ABONDANCE); 	
-
 
976
			    	    	} else {
-
 
977
			    	    		selectionAbondance = false;
-
 
978
			    	    	}
-
 
979
	  	    	    	break;
-
 
980
 
-
 
981
		    	        default:
-
 
982
		    	        	selecteurAbondance.setRawValue(selecteurAbondance.getRawValue());
-
 
983
		    	        	selecteurAbondance.setValue(selecteurAbondance.getRawValue());
-
 
984
		    	        	abondanceModifiee = true;
-
 
985
		    	        	selectionAbondance = false;
-
 
986
		    	        break;
-
 
987
					}
-
 
988
				}
-
 
989
		    });
-
 
990
			
-
 
991
			selecteurCertitude.addListener(new ComboBoxListenerAdapter() {  
-
 
992
 
-
 
993
				@Override
-
 
994
				public void onSelect(ComboBox comboBox, Record record, int index) {  
-
 
995
	                 selectionCertitude=true;
-
 
996
	                 certitudeModifiee = true;
-
 
997
	             }
-
 
998
	         });  
-
 
999
			
-
 
1000
			selecteurCertitude.addKeyPressListener(new EventCallback() {
-
 
1001
 
-
 
1002
				@Override
-
 
1003
				public void execute(EventObject e) {
-
 
1004
					switch(e.getKey()) { 
-
 
1005
						case KEY_ALT:
-
 
1006
			    	      case KEY_CTRL:
-
 
1007
			    	      case KEY_DOWN:
-
 
1008
			    	      case KEY_END:
-
 
1009
			    	      case KEY_ESCAPE:
-
 
1010
			    	      case KEY_HOME:
-
 
1011
			    	      case KEY_LEFT:
-
 
1012
			    	      case KEY_PAGEDOWN:
-
 
1013
			    	      case KEY_PAGEUP:
-
 
1014
			    	      case KEY_RIGHT:
-
 
1015
			    	      case KEY_SHIFT:
-
 
1016
			    	      case KEY_TAB:
-
 
1017
			    	      case KEY_UP:
-
 
1018
		    	        break;
-
 
1019
		    	        
-
 
1020
			    	    case KEY_ENTER:
-
 
1021
			    	    	if(!selectionCertitude) {	
-
 
1022
		  	    	    		validerSaisie(Champs.CERTITUDE); 	
-
 
1023
			    	    	} else {
-
 
1024
			    	    		selectionCertitude = false;
-
 
1025
			    	    	}
-
 
1026
	  	    	    	break;
-
 
1027
 
-
 
1028
		    	        default:
-
 
1029
		    	        	selecteurCertitude.setRawValue(selecteurCertitude.getRawValue());
-
 
1030
		    	        	selecteurCertitude.setValue(selecteurCertitude.getRawValue());
-
 
1031
		    	        	certitudeModifiee = true;
-
 
1032
		    	        	selectionCertitude = false;
-
 
1033
		    	        break;
-
 
1034
					}
-
 
1035
				}
-
 
1036
		    });
886
 
1037
 
887
		boutonOK.addListener(new ButtonListenerAdapter() {
1038
		boutonOK.addListener(new ButtonListenerAdapter() {
888
			
1039
			
889
			@Override
1040
			@Override
890
			public void onClick(Button button, EventObject e) {
1041
			public void onClick(Button button, EventObject e) {
891
		
1042
		
892
				if(modification) {
1043
				if(modification) {
893
					if(masseModification) {
1044
					if(masseModification) {
894
							modifierObservationEnMasse(null);
1045
							modifierObservationEnMasse(null);
895
					} else {
1046
					} else {
896
						modifierObservation() ;
1047
						modifierObservation() ;
897
					}
1048
					}
898
				}
1049
				}
899
				else {
1050
				else {
900
					ajouterObservation();
1051
					ajouterObservation();
901
				}
1052
				}
902
				
1053
				
903
				
1054
				
904
			}
1055
			}
905
			
1056
			
906
		});
1057
		});
907
		
1058
		
908
		boutonAnnuler.addListener(new ButtonListenerAdapter() {
1059
		boutonAnnuler.addListener(new ButtonListenerAdapter() {
909
			
1060
			
910
			@Override
1061
			@Override
911
			public void onClick(Button button, EventObject e) {
1062
			public void onClick(Button button, EventObject e) {
912
				
1063
				
913
				if(modification)
1064
				if(modification)
914
				{
1065
				{
915
					supprimerObservation() ;
1066
					supprimerObservation() ;
916
				}
1067
				}
917
				else
1068
				else
918
				{
1069
				{
919
					raz();
1070
					raz();
920
				}
1071
				}
921
			}
1072
			}
922
			
1073
			
923
		});
1074
		});
924
		
1075
		
925
		this.addListener(new ContainerListenerAdapter() {
1076
		this.addListener(new ContainerListenerAdapter() {
926
			@Override
1077
			@Override
927
			public void onAfterLayout(Container self) {
1078
			public void onAfterLayout(Container self) {
928
				commune.focus();
1079
				commune.focus();
929
			}
1080
			}
930
		});	
1081
		});	
931
			
1082
			
932
	}
1083
	}
933
 
1084
 
934
	/**
1085
	/**
935
	 * Validation de la saisie 
1086
	 * Validation de la saisie 
936
	 */
1087
	 */
937
	
1088
	
938
	private void validerSaisie(Champs champs) {
1089
	private void validerSaisie(Champs champs) {
939
		
1090
		
940
		if(modification) {
1091
		if(modification) {
941
			if(masseModification) {
1092
			if(masseModification) {
942
					modifierObservationEnMasse(champs);
1093
					modifierObservationEnMasse(champs);
943
			} else {
1094
			} else {
944
				modifierObservation();
1095
				modifierObservation();
945
			}
1096
			}
946
			
1097
			
947
			raz(champs);
1098
			raz(champs);
948
		}
1099
		}
949
		else {
1100
		else {
950
			ajouterObservation();
1101
			ajouterObservation();
951
			raz(champs);
1102
			raz(champs);
952
		}
1103
		}
953
	}
1104
	}
954
	
1105
	
955
	/**
1106
	/**
956
	 * Desactive visuellement ce panneau
1107
	 * Desactive visuellement ce panneau
957
	 */
1108
	 */
958
	public void desactiverPanneau()
1109
	public void desactiverPanneau()
959
	{
1110
	{
960
		this.setDisabled(true) ;
1111
		this.setDisabled(true) ;
961
	}
1112
	}
962
	
1113
	
963
	/**
1114
	/**
964
	 * Active visuellement ce panneau
1115
	 * Active visuellement ce panneau
965
	 */
1116
	 */
966
	public void activerPanneau()
1117
	public void activerPanneau()
967
	{
1118
	{
968
		this.setDisabled(false) ;
1119
		this.setDisabled(false) ;
969
	}
1120
	}
970
 
1121
 
971
	@Override
1122
	@Override
972
	public void rafraichir(Object nouvelleDonnees, boolean repandreRaffraichissement) {
1123
	public void rafraichir(Object nouvelleDonnees, boolean repandreRaffraichissement) {
973
		
1124
		
974
		// si l'on a reçu une liste du referentiel commune (completion referentiel commune)
1125
		// si l'on a reçu une liste du referentiel commune (completion referentiel commune)
975
			if(nouvelleDonnees instanceof ListeReferentielCommune)
1126
			if(nouvelleDonnees instanceof ListeReferentielCommune)
976
			{
1127
			{
977
				ListeReferentielCommune data = (ListeReferentielCommune) nouvelleDonnees ;
1128
				ListeReferentielCommune data = (ListeReferentielCommune) nouvelleDonnees ;
978
				Object[][] communeData = new Object[data.size()][3];
1129
				Object[][] communeData = new Object[data.size()][3];
979
				int i = 0 ;
1130
				int i = 0 ;
980
			
1131
			
981
				// on la parse et on récupère les informations quiç nous interessent
1132
				// on la parse et on récupère les informations quiç nous interessent
982
				for (Iterator it = data.keySet().iterator(); it.hasNext();) 
1133
				for (Iterator it = data.keySet().iterator(); it.hasNext();) 
983
				{					
1134
				{					
984
					ReferentielCommune ref=data.get(it.next());
1135
					ReferentielCommune ref=data.get(it.next());
985
					
1136
					
986
					communeData[i][0]= ref.getCommune();
1137
					communeData[i][0]= ref.getCommune();
987
					communeData[i][1]= ref.getDepartement();
1138
					communeData[i][1]= ref.getDepartement();
988
					communeData[i][2]= ref.getCodeInsee();
1139
					communeData[i][2]= ref.getCodeInsee();
989
					i++ ;
1140
					i++ ;
990
				}
1141
				}
991
				
1142
				
992
				// creation du store
1143
				// creation du store
993
				FieldDef defCommune = new StringFieldDef("commune");
1144
				FieldDef defCommune = new StringFieldDef("commune");
994
				FieldDef defDepartement = new StringFieldDef("departement");
1145
				FieldDef defDepartement = new StringFieldDef("departement");
995
				FieldDef defCodeInsee = new StringFieldDef("codeInsee");
1146
				FieldDef defCodeInsee = new StringFieldDef("codeInsee");
996
							
1147
							
997
				FieldDef[] defTab = { defCommune, defDepartement, defCodeInsee};
1148
				FieldDef[] defTab = { defCommune, defDepartement, defCodeInsee};
998
				
1149
				
999
				RecordDef rd = new RecordDef(defTab);
1150
				RecordDef rd = new RecordDef(defTab);
1000
				
1151
				
1001
				final MemoryProxy dataProxy = new MemoryProxy(communeData);
1152
				final MemoryProxy dataProxy = new MemoryProxy(communeData);
1002
				final ArrayReader reader = new ArrayReader(rd);		
1153
				final ArrayReader reader = new ArrayReader(rd);		
1003
								
1154
								
1004
				Store store=new Store(dataProxy,reader);	
1155
				Store store=new Store(dataProxy,reader);	
1005
				commune.setStore(store);
1156
				commune.setStore(store);
1006
				store.load();
1157
				store.load();
1007
				
1158
				
1008
			}
1159
			}
1009
			
1160
			
1010
			//			 si l'on a reçu une liste du référentiel nom (complétion referentiel nom)
1161
			//			 si l'on a reçu une liste du référentiel nom (complétion referentiel nom)
1011
			
1162
			
1012
			if(nouvelleDonnees instanceof ListeReferentielNom)
1163
			if(nouvelleDonnees instanceof ListeReferentielNom)
1013
			{
1164
			{
1014
				
1165
				
1015
				ListeReferentielNom data = (ListeReferentielNom) nouvelleDonnees ;
1166
				ListeReferentielNom data = (ListeReferentielNom) nouvelleDonnees ;
1016
				Object[][] nomData = new Object[data.size()][3];
1167
				Object[][] nomData = new Object[data.size()][3];
1017
				int i = 0 ;
1168
				int i = 0 ;
1018
 
1169
 
1019
				// on la parse et on récupère les informations quiç nous interessent
1170
				// on la parse et on récupère les informations quiç nous interessent
1020
				for (Iterator it = data.keySet().iterator(); it.hasNext();) 
1171
				for (Iterator it = data.keySet().iterator(); it.hasNext();) 
1021
				{
1172
				{
1022
					
1173
					
1023
					ReferentielNom ref=data.get(it.next());
1174
					ReferentielNom ref=data.get(it.next());
1024
					
1175
					
1025
					nomData[i][0]= ref.getNom();
1176
					nomData[i][0]= ref.getNom();
1026
					nomData[i][1]= ref.getNumeroNom();
1177
					nomData[i][1]= ref.getNumeroNom();
1027
					if (ref.getStatut().equals("3")) {
1178
					if (ref.getStatut().equals("3")) {
1028
						nomData[i][2]="nom_retenu";
1179
						nomData[i][2]="nom_retenu";
1029
					}
1180
					}
1030
					else {
1181
					else {
1031
						nomData[i][2]="";
1182
						nomData[i][2]="";
1032
					}														
1183
					}														
1033
					i++ ;
1184
					i++ ;
1034
				}
1185
				}
1035
 
1186
 
1036
				FieldDef defNom = new StringFieldDef("nom");
1187
				FieldDef defNom = new StringFieldDef("nom");
1037
				FieldDef defNumeroNom = new StringFieldDef("numeroNom");
1188
				FieldDef defNumeroNom = new StringFieldDef("numeroNom");
1038
				FieldDef indicateurNomRetenu = new StringFieldDef("indicateurNomRetenu");
1189
				FieldDef indicateurNomRetenu = new StringFieldDef("indicateurNomRetenu");
1039
						
1190
						
1040
				FieldDef[] defTab = { defNom, defNumeroNom, indicateurNomRetenu};
1191
				FieldDef[] defTab = { defNom, defNumeroNom, indicateurNomRetenu};
1041
				
1192
				
1042
				RecordDef rd = new RecordDef(defTab);
1193
				RecordDef rd = new RecordDef(defTab);
1043
				
1194
				
1044
				final MemoryProxy dataProxy = new MemoryProxy(nomData);
1195
				final MemoryProxy dataProxy = new MemoryProxy(nomData);
1045
				final ArrayReader reader = new ArrayReader(rd);		
1196
				final ArrayReader reader = new ArrayReader(rd);		
1046
				
1197
				
1047
				Store store=new Store(dataProxy,reader);	
1198
				Store store=new Store(dataProxy,reader);	
1048
				espece.setStore(store);
1199
				espece.setStore(store);
1049
				store.load() ;
1200
				store.load() ;
1050
			}
1201
			}
1051
			
1202
			
1052
			// On recoit une observation dont on veut afficher le detail 
1203
			// On recoit une observation dont on veut afficher le detail 
1053
			
1204
			
1054
			if(nouvelleDonnees instanceof Observation)
1205
			if(nouvelleDonnees instanceof Observation)
1055
			{
1206
			{
1056
				Observation obs = (Observation)nouvelleDonnees ;
1207
				Observation obs = (Observation)nouvelleDonnees ;
1057
				afficherDetailsObservation(obs) ;
1208
				afficherDetailsObservation(obs) ;
1058
			}
1209
			}
1059
			
1210
			
1060
			if(nouvelleDonnees instanceof ListeObservation) {
1211
			if(nouvelleDonnees instanceof ListeObservation) {
1061
				
1212
				
1062
				ListeObservation listeObs = (ListeObservation)nouvelleDonnees;
1213
				ListeObservation listeObs = (ListeObservation)nouvelleDonnees;
1063
				calculerAfficherDifferences(listeObs);
1214
				calculerAfficherDifferences(listeObs);
1064
			}
1215
			}
1065
			
1216
			
1066
			// Sur Mise à jour ou suppression d'une suppression ?
1217
			// Sur Mise à jour ou suppression d'une suppression ?
1067
			
1218
			
1068
			if(nouvelleDonnees instanceof String)
1219
			if(nouvelleDonnees instanceof String)
1069
			{
1220
			{
1070
				String str = (String)nouvelleDonnees ;
1221
				String str = (String)nouvelleDonnees ;
1071
				observationMediateur.obtenirNombreObservation() ;
1222
				observationMediateur.obtenirNombreObservation() ;
1072
			}
1223
			}
1073
			
1224
			
1074
			if(nouvelleDonnees instanceof String[]) {
1225
			if(nouvelleDonnees instanceof String[]) {
1075
				String[] anumNom = (String[])nouvelleDonnees ;
1226
				String[] anumNom = (String[])nouvelleDonnees ;
1076
				numeroNom = anumNom[1];
1227
				numeroNom = anumNom[1];
1077
				espece.setValue(anumNom[0]);
1228
				espece.setValue(anumNom[0]);
1078
				setModification("false");
1229
				setModification("false");
1079
			}
1230
			}
1080
			
1231
			
1081
			if(nouvelleDonnees instanceof EntiteGeographiqueObservation)
1232
			if(nouvelleDonnees instanceof EntiteGeographiqueObservation)
1082
			{
1233
			{
1083
				EntiteGeographiqueObservation infosComm = (EntiteGeographiqueObservation)nouvelleDonnees ;
1234
				EntiteGeographiqueObservation infosComm = (EntiteGeographiqueObservation)nouvelleDonnees ;
1084
				if(rechercheCommuneEnCours) {
1235
				if(rechercheCommuneEnCours) {
1085
					afficherIndicationCommune(infosComm);
1236
					afficherIndicationCommune(infosComm);
1086
				} else {
1237
				} else {
1087
					rafraichirCommuneEtCoord(infosComm);
1238
					rafraichirCommuneEtCoord(infosComm);
1088
				}
1239
				}
1089
			}
1240
			}
1090
 
1241
 
1091
	}
1242
	}
1092
	
1243
	
1093
	
1244
	
1094
	private void afficherIndicationCommune(
1245
	private void afficherIndicationCommune(
1095
			final EntiteGeographiqueObservation infosCom) {
1246
			final EntiteGeographiqueObservation infosCom) {
1096
		
1247
		
1097
		String nCommune = "";
1248
		String nCommune = "";
1098
		if(infosCom != null && !infosCom.getZoneGeo().trim().equals("")){
1249
		if(infosCom != null && !infosCom.getZoneGeo().trim().equals("")){
1099
			nCommune += infosCom.getZoneGeo();
1250
			nCommune += infosCom.getZoneGeo();
1100
			if(!infosCom.getIdZoneGeo().trim().equals(""))
1251
			if(!infosCom.getIdZoneGeo().trim().equals(""))
1101
			nCommune += " ("+Util.convertirChaineZoneGeoVersDepartement(infosCom.getIdZoneGeo())+")";
1252
			nCommune += " ("+Util.convertirChaineZoneGeoVersDepartement(infosCom.getIdZoneGeo())+")";
1102
			
1253
			
1103
			lienSelectionCommune.setHtml("<a id=\"lien_selection_commune\" tabindex=\"9\">"+nCommune+"</a>");
1254
			lienSelectionCommune.setHtml("<a id=\"lien_selection_commune\" tabindex=\"9\">"+nCommune+"</a>");
1104
			lienSelectionCommune.setStyleName("img-curseur-depl");
1255
			lienSelectionCommune.setStyleName("img-curseur-depl");
1105
			
1256
			
1106
			Ext.get("lien_selection_commune").addListener("click",new EventCallback() {
1257
			Ext.get("lien_selection_commune").addListener("click",new EventCallback() {
1107
				@Override
1258
				@Override
1108
				public void execute(EventObject e) {
1259
				public void execute(EventObject e) {
1109
					rafraichirCommune(infosCom);
1260
					rafraichirCommune(infosCom);
1110
				}			
1261
				}			
1111
			});
1262
			});
1112
			
1263
			
1113
			Ext.get("lien_selection_commune").addListener("keypress",new EventCallback() {
1264
			Ext.get("lien_selection_commune").addListener("keypress",new EventCallback() {
1114
				@Override
1265
				@Override
1115
				public void execute(EventObject e) {
1266
				public void execute(EventObject e) {
1116
					if(e.getCharCode() == KEY_ENTER) {
1267
					if(e.getCharCode() == KEY_ENTER) {
1117
						rafraichirCommune(infosCom);
1268
						rafraichirCommune(infosCom);
1118
					}
1269
					}
1119
				}			
1270
				}			
1120
			});
1271
			});
1121
			
1272
			
1122
			Ext.get("lien_selection_commune").addListener("focus",new EventCallback() {
1273
			Ext.get("lien_selection_commune").addListener("focus",new EventCallback() {
1123
				@Override
1274
				@Override
1124
				public void execute(EventObject e) {
1275
				public void execute(EventObject e) {
1125
					Ext.get("lien_selection_commune").toggleClass("lien_sel");
1276
					Ext.get("lien_selection_commune").toggleClass("lien_sel");
1126
				}			
1277
				}			
1127
			});
1278
			});
1128
			
1279
			
1129
			Ext.get("lien_selection_commune").addListener("blur",new EventCallback() {
1280
			Ext.get("lien_selection_commune").addListener("blur",new EventCallback() {
1130
				@Override
1281
				@Override
1131
				public void execute(EventObject e) {
1282
				public void execute(EventObject e) {
1132
					Ext.get("lien_selection_commune").toggleClass("lien_sel");
1283
					Ext.get("lien_selection_commune").toggleClass("lien_sel");
1133
				}			
1284
				}			
1134
			});
1285
			});
1135
			
1286
			
1136
		} else {
1287
		} else {
1137
			if(rechercheCommuneEnCours) {
1288
			if(rechercheCommuneEnCours) {
1138
				lienSelectionCommune.setHtml("<span id=\"aucune_selection_commune\"> Erreur de localisation </span>");
1289
				lienSelectionCommune.setHtml("<span id=\"aucune_selection_commune\"> Erreur de localisation </span>");
1139
			} else {
1290
			} else {
1140
				lienSelectionCommune.setHtml("<span id=\"aucune_selection_commune\"> </span>");
1291
				lienSelectionCommune.setHtml("<span id=\"aucune_selection_commune\"> </span>");
1141
			}
1292
			}
1142
		}
1293
		}
1143
 
1294
 
1144
		Ext.get(lienSelectionCommune.getElement()).unmask();
1295
		Ext.get(lienSelectionCommune.getElement()).unmask();
1145
		rechercheCommuneEnCours = false;
1296
		rechercheCommuneEnCours = false;
1146
	}
1297
	}
1147
	
1298
	
1148
	private void rafraichirCommune(EntiteGeographiqueObservation infosCom) {
1299
	private void rafraichirCommune(EntiteGeographiqueObservation infosCom) {
1149
		String nCommune = "";
1300
		String nCommune = "";
1150
	
1301
	
1151
		if(infosCom.getZoneGeo() != null && !infosCom.getZoneGeo().equals("")) {
1302
		if(infosCom.getZoneGeo() != null && !infosCom.getZoneGeo().equals("")) {
1152
			nCommune += infosCom.getZoneGeo();
1303
			nCommune += infosCom.getZoneGeo();
1153
		}
1304
		}
1154
		
1305
		
1155
		if(infosCom.getIdZoneGeo() != null && !infosCom.getIdZoneGeo().equals("")) {
1306
		if(infosCom.getIdZoneGeo() != null && !infosCom.getIdZoneGeo().equals("")) {
1156
			String codeGeoFormate = Util.convertirChaineZoneGeoVersDepartement(infosCom.getIdZoneGeo());
1307
			String codeGeoFormate = Util.convertirChaineZoneGeoVersDepartement(infosCom.getIdZoneGeo());
1157
			nCommune += " ("+codeGeoFormate+")";
1308
			nCommune += " ("+codeGeoFormate+")";
1158
			departement = Util.convertirChaineZoneGeoVersDepartement(infosCom.getIdZoneGeo());
1309
			departement = Util.convertirChaineZoneGeoVersDepartement(infosCom.getIdZoneGeo());
1159
		}
1310
		}
1160
		commune.setValue(nCommune);
1311
		commune.setValue(nCommune);
1161
		communeModifiee = true;
1312
		communeModifiee = true;
1162
	}
1313
	}
1163
 
1314
 
1164
	private void rafraichirCommuneEtCoord(EntiteGeographiqueObservation infosCom) {
1315
	private void rafraichirCommuneEtCoord(EntiteGeographiqueObservation infosCom) {
1165
		;
1316
		;
1166
		// on ne remplace la commune que si le champ était vide
1317
		// on ne remplace la commune que si le champ était vide
1167
		if(commune.getRawValue() == null || commune.getRawValue().equals("")) {
1318
		if(commune.getRawValue() == null || commune.getRawValue().equals("")) {
1168
			rafraichirCommune(infosCom);
1319
			rafraichirCommune(infosCom);
1169
		} 
1320
		} 
1170
 
1321
 
1171
		if(infosCom.getLat() != null && !infosCom.getLat().equals("")) {
1322
		if(infosCom.getLat() != null && !infosCom.getLat().equals("")) {
1172
			latitude.setValue(infosCom.getLat());
1323
			latitude.setValue(infosCom.getLat());
1173
		}
1324
		}
1174
 
1325
 
1175
		if(infosCom.getLon() != null && !infosCom.getLon().equals("")) {
1326
		if(infosCom.getLon() != null && !infosCom.getLon().equals("")) {
1176
			longitude.setValue(infosCom.getLon());
1327
			longitude.setValue(infosCom.getLon());
1177
		}
1328
		}
1178
		
1329
		
1179
		latModifiee = true;
1330
		latModifiee = true;
1180
		longModifiee = true;
1331
		longModifiee = true;
1181
		
1332
		
1182
		coordPanel.setVisible(true);
1333
		coordPanel.setVisible(true);
1183
	}
1334
	}
1184
 
1335
 
1185
	public void obtenirListeReferentielCommune() {
1336
	public void obtenirListeReferentielCommune() {
1186
		
1337
		
1187
	 String com=commune.getText();
1338
	 String com=commune.getText();
1188
	 com=com.replaceAll("%","");
1339
	 com=com.replaceAll("%","");
1189
		  
1340
		  
1190
	 observationMediateur.obtenirListeReferentielCommune(this,com);
1341
	 observationMediateur.obtenirListeReferentielCommune(this,com);
1191
	 
1342
	 
1192
	}
1343
	}
1193
	
1344
	
1194
 
1345
 
1195
	public void obtenirListeReferentielNom() {	 
1346
	public void obtenirListeReferentielNom() {	 
1196
	 // FIXME : trouver un autre moyen que le hack "/*" pour rechercher les taxons lors de la saisie d'un espace apres le genre
1347
	 // FIXME : trouver un autre moyen que le hack "/*" pour rechercher les taxons lors de la saisie d'un espace apres le genre
1197
	  String esp=espece.getText().replaceAll(" ","/*");
1348
	  String esp=espece.getText().replaceAll(" ","/*");
1198
	  esp=esp.replaceAll("%","");
1349
	  esp=esp.replaceAll("%","");
1199
		
1350
		
1200
	  observationMediateur.obtenirListeReferentielNom(this,esp);	 
1351
	  observationMediateur.obtenirListeReferentielNom(this,esp);	 
1201
	}
1352
	}
1202
		
1353
		
1203
	protected void obtenirReferentielStation() {		
1354
	protected void obtenirReferentielStation() {		
1204
		observationMediateur.obtenirListeReferentielPerso(this,TypesReferentiels.REFERENTIEL_STATION,station.getText());
1355
		observationMediateur.obtenirListeReferentielPerso(this,TypesReferentiels.REFERENTIEL_STATION,station.getText());
1205
	}
1356
	}
1206
	
1357
	
1207
	protected void obtenirListeReferentielMilieu() {
1358
	protected void obtenirListeReferentielMilieu() {
1208
		observationMediateur.obtenirListeReferentielPerso(this,TypesReferentiels.REFERENTIEL_MILIEU,milieu.getText());
1359
		observationMediateur.obtenirListeReferentielPerso(this,TypesReferentiels.REFERENTIEL_MILIEU,milieu.getText());
1209
	}
1360
	}
1210
 
1361
 
1211
	protected void obtenirReferentielLieuDit() {
1362
	protected void obtenirReferentielLieuDit() {
1212
		observationMediateur.obtenirListeReferentielPerso(this,TypesReferentiels.REFERENTIEL_LIEU_DIT,lieudit.getText());
1363
		observationMediateur.obtenirListeReferentielPerso(this,TypesReferentiels.REFERENTIEL_LIEU_DIT,lieudit.getText());
1213
	}
1364
	}
1214
   
1365
   
1215
	public void ajouterObservation() {
1366
	public void ajouterObservation() {
1216
		
1367
		
1217
		if(!Util.verifierDateFormatCel(date.getRawValue()) && !date.getRawValue().equals("")) {
1368
		if(!Util.verifierDateFormatCel(date.getRawValue()) && !date.getRawValue().equals("")) {
1218
			Window.alert("Attention la date saisie est invalide, la date doit être au format jj/mm/aaaa");
1369
			Window.alert("Attention la date saisie est invalide, la date doit être au format jj/mm/aaaa");
1219
			date.setInvalidText("Date invalide");
1370
			date.setInvalidText("Date invalide");
1220
			return;
1371
			return;
1221
		}
1372
		}
1222
		
1373
		
1223
		if(departement != null) {  
1374
		if(departement != null) {  
1224
		// TODO : regler le probleme a la base plutot que ce patch
1375
		// TODO : regler le probleme a la base plutot que ce patch
1225
			
1376
			
1226
			if(departement.equals("000null") || departement.equals("")) {
1377
			if(departement.equals("000null") || departement.equals("")) {
1227
				String[] depCom = commune.getText().split(" ");
1378
				String[] depCom = commune.getText().split(" ");
1228
				if(depCom.length > 1) {
1379
				if(depCom.length > 1) {
1229
					String dep = depCom[1].replace('(', ' ');
1380
					String dep = depCom[1].replace('(', ' ');
1230
					dep =dep.replace(')', ' ');
1381
					dep =dep.replace(')', ' ');
1231
					dep = dep.trim();
1382
					dep = dep.trim();
1232
					dep = dep.replace('\\',' ');
1383
					dep = dep.replace('\\',' ');
1233
					dep = dep.trim();
1384
					dep = dep.trim();
1234
					
1385
					
1235
					try
1386
					try
1236
					{
1387
					{
1237
						int nDep = Integer.parseInt(dep);
1388
						int nDep = Integer.parseInt(dep);
1238
						if(nDep > 0 && nDep < 110) {
1389
						if(nDep > 0 && nDep < 110) {
1239
							departement = dep ;
1390
							departement = dep ;
1240
						}
1391
						}
1241
					}
1392
					}
1242
					catch(NumberFormatException e)
1393
					catch(NumberFormatException e)
1243
					{
1394
					{
1244
						departement = "" ;
1395
						departement = "" ;
1245
					}
1396
					}
1246
				}
1397
				}
1247
			}
1398
			}
1248
		}
1399
		}
1249
		
1400
		
1250
		String dateObs = Util.remplacerSeparateursDateFormatCel(date.getRawValue());
1401
		String dateObs = Util.remplacerSeparateursDateFormatCel(date.getRawValue());
1251
 
1402
 
1252
		Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),dateObs);	
1403
		Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),dateObs);	
1253
		
1404
		
1254
		String[] coords = getValeurCoordonnees();
1405
		String[] coords = getValeurCoordonnees();
1255
		
1406
		
1256
		obs.setLatitude(coords[0]);
1407
		obs.setLatitude(coords[0]);
1257
		obs.setLongitude(coords[1]);
1408
		obs.setLongitude(coords[1]);
-
 
1409
		
-
 
1410
		obs.setAbondance(getAbondance());
-
 
1411
		obs.setCertitude(getCertitude());
1258
		
1412
		
1259
		observationMediateur.ajouterObservation(obs);
1413
		observationMediateur.ajouterObservation(obs);
1260
	}
1414
	}
1261
	
1415
	
1262
	private void modifierObservation() {
1416
	private void modifierObservation() {
1263
		
1417
		
1264
		if(!Util.verifierDateFormatCel(date.getRawValue()) && !date.getRawValue().equals("")) {
1418
		if(!Util.verifierDateFormatCel(date.getRawValue()) && !date.getRawValue().equals("")) {
1265
			Window.alert("Attention la date saisie est invalide, la date doit être au format jj/mm/aaaa");
1419
			Window.alert("Attention la date saisie est invalide, la date doit être au format jj/mm/aaaa");
1266
			date.setInvalidText("Date invalide");
1420
			date.setInvalidText("Date invalide");
1267
			return;
1421
			return;
1268
		}
1422
		}
1269
		
1423
		
1270
		if(departement.equals("000null") || departement.equals("")) {
1424
		if(departement.equals("000null") || departement.equals("")) {
1271
			String[] depCom = commune.getText().split(" ");
1425
			String[] depCom = commune.getText().split(" ");
1272
			if(depCom.length > 1) {
1426
			if(depCom.length > 1) {
1273
				String dep = depCom[1].replace('(', ' ');
1427
				String dep = depCom[1].replace('(', ' ');
1274
				dep =dep.replace(')', ' ');
1428
				dep =dep.replace(')', ' ');
1275
				dep = dep.trim();
1429
				dep = dep.trim();
1276
				dep = dep.replace('\\',' ');
1430
				dep = dep.replace('\\',' ');
1277
				dep = dep.trim();
1431
				dep = dep.trim();
1278
				
1432
				
1279
				try
1433
				try
1280
				{
1434
				{
1281
					int nDep = Integer.parseInt(dep);
1435
					int nDep = Integer.parseInt(dep);
1282
					if(nDep > 0 && nDep < 110) {
1436
					if(nDep > 0 && nDep < 110) {
1283
						departement = dep ;
1437
						departement = dep ;
1284
					}
1438
					}
1285
				}
1439
				}
1286
				catch(NumberFormatException e)
1440
				catch(NumberFormatException e)
1287
				{
1441
				{
1288
					departement = "" ;
1442
					departement = "" ;
1289
				}
1443
				}
1290
			}
1444
			}
1291
		}
1445
		}
1292
		
1446
		
1293
		String dateObs = Util.remplacerSeparateursDateFormatCel(date.getRawValue());
1447
		String dateObs = Util.remplacerSeparateursDateFormatCel(date.getRawValue());
1294
		
1448
		
1295
		Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),dateObs);
1449
		Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),dateObs);
1296
		obs.setNumeroOrdre(numeroOrdre);
1450
		obs.setNumeroOrdre(numeroOrdre);
1297
		
1451
		
1298
		String[] coords = getValeurCoordonnees();
1452
		String[] coords = getValeurCoordonnees();
1299
		
1453
		
1300
		obs.setLatitude(coords[0]);
1454
		obs.setLatitude(coords[0]);
1301
		obs.setLongitude(coords[1]);
1455
		obs.setLongitude(coords[1]);
-
 
1456
		
-
 
1457
		obs.setAbondance(getAbondance());
-
 
1458
		obs.setCertitude(getCertitude());
1302
		
1459
		
1303
		observationMediateur.modifierObservation(obs);
1460
		observationMediateur.modifierObservation(obs);
1304
 
1461
 
1305
		selecteurMode.setValue("création");
1462
		selecteurMode.setValue("création");
1306
		setModification("false");
1463
		setModification("false");
1307
		
1464
		
1308
	}
1465
	}
1309
	
1466
	
1310
	private void modifierObservationEnMasse(Champs champModifie) {
1467
	private void modifierObservationEnMasse(Champs champModifie) {
1311
		String communeM = null;
1468
		String communeM = null;
1312
		String departementM = null;
1469
		String departementM = null;
1313
		String numNomSelM = null;
1470
		String numNomSelM = null;
1314
		String lieuDitM = null;
1471
		String lieuDitM = null;
1315
		String stationM = null;
1472
		String stationM = null;
1316
		String milieuM = null;
1473
		String milieuM = null;
1317
		String dateM = null;
1474
		String dateM = null;
1318
		String especeM = null;
1475
		String especeM = null;
1319
		String commM = null; 
1476
		String commM = null; 
1320
		String latM = null;
1477
		String latM = null;
1321
		String longM = null;
1478
		String longM = null;
-
 
1479
		String abondanceM = null;
-
 
1480
		String certitudeM = null;
1322
		
1481
		
1323
		String champs = modeleMessageModif;
1482
		String champs = modeleMessageModif;
1324
			
1483
			
1325
		if(communeModifiee) {
1484
		if(communeModifiee) {
1326
			communeM = commune.getText();
1485
			communeM = commune.getText();
1327
			
1486
			
1328
			if(departement.equals("000null") || departement.equals("")) {
1487
			if(departement.equals("000null") || departement.equals("")) {
1329
				String[] depCom = commune.getText().split(" ");
1488
				String[] depCom = commune.getText().split(" ");
1330
				if(depCom.length > 1) {
1489
				if(depCom.length > 1) {
1331
					String dep = depCom[1].replace('(', ' ');
1490
					String dep = depCom[1].replace('(', ' ');
1332
					dep =dep.replace(')', ' ');
1491
					dep =dep.replace(')', ' ');
1333
					dep = dep.trim();
1492
					dep = dep.trim();
1334
					dep = dep.replace('\\',' ');
1493
					dep = dep.replace('\\',' ');
1335
					dep = dep.trim();
1494
					dep = dep.trim();
1336
					
1495
					
1337
					try
1496
					try
1338
					{
1497
					{
1339
						int nDep = Integer.parseInt(dep);
1498
						int nDep = Integer.parseInt(dep);
1340
						if(nDep > 0 && nDep < 110) {
1499
						if(nDep > 0 && nDep < 110) {
1341
							departement = dep ;
1500
							departement = dep ;
1342
						}
1501
						}
1343
					}
1502
					}
1344
					catch(NumberFormatException e)
1503
					catch(NumberFormatException e)
1345
					{
1504
					{
1346
						departement = "" ;
1505
						departement = "" ;
1347
					}
1506
					}
1348
				}
1507
				}
1349
			}
1508
			}
1350
			
1509
			
1351
			departementM = departement;
1510
			departementM = departement;
1352
		} else {
1511
		} else {
1353
			champs = champs.replaceAll("commune", "");
1512
			champs = champs.replaceAll("commune", "");
1354
		}
1513
		}
1355
		
1514
		
1356
		if(lieuDitModifie) {
1515
		if(lieuDitModifie) {
1357
			lieuDitM = lieudit.getText();
1516
			lieuDitM = lieudit.getText();
1358
		}else {
1517
		}else {
1359
			champs = champs.replaceAll(":lieu-dit", "");
1518
			champs = champs.replaceAll(":lieu-dit", "");
1360
		}
1519
		}
1361
		
1520
		
1362
		if(stationModifiee) {
1521
		if(stationModifiee) {
1363
			stationM = station.getText();
1522
			stationM = station.getText();
1364
		}else {
1523
		}else {
1365
			champs = champs.replaceAll(":station", "");
1524
			champs = champs.replaceAll(":station", "");
1366
		}
1525
		}
1367
 
1526
 
1368
		if(milieuModifie) {
1527
		if(milieuModifie) {
1369
			milieuM = milieu.getText();
1528
			milieuM = milieu.getText();
1370
		}else {
1529
		}else {
1371
			champs = champs.replaceAll(":milieu", "");
1530
			champs = champs.replaceAll(":milieu", "");
1372
		}
1531
		}
1373
 
1532
 
1374
		if(dateModifiee && !date.getRawValue().equals(VALEURS_MULTIPLES)) {
1533
		if(dateModifiee && !date.getRawValue().equals(VALEURS_MULTIPLES)) {
1375
			dateM = date.getRawValue();
1534
			dateM = date.getRawValue();
1376
			dateM = Util.remplacerSeparateursDateFormatCel(dateM);
1535
			dateM = Util.remplacerSeparateursDateFormatCel(dateM);
1377
		}else {
1536
		}else {
1378
			champs = champs.replaceAll(":date", "");
1537
			champs = champs.replaceAll(":date", "");
1379
		}
1538
		}
1380
 
1539
 
1381
		if(especeModifiee) {
1540
		if(especeModifiee) {
1382
			especeM = espece.getText();
1541
			especeM = espece.getText();
1383
			numNomSelM = numeroNom;
1542
			numNomSelM = numeroNom;
1384
		}else {
1543
		}else {
1385
			champs = champs.replaceAll(":espece", "");
1544
			champs = champs.replaceAll(":espece", "");
1386
		}
1545
		}
1387
 
1546
 
1388
		if(commModifie) {
1547
		if(commModifie) {
1389
			commM = comment.getText();
1548
			commM = comment.getText();
1390
		}else {
1549
		}else {
1391
			champs = champs.replaceAll(":commentaire", "");
1550
			champs = champs.replaceAll(":commentaire", "");
1392
		}
1551
		}
1393
		
1552
		
1394
		if(latModifiee) {
1553
		if(latModifiee) {
1395
			latM = latitude.getText();
1554
			latM = latitude.getText();
1396
		}else {
1555
		}else {
1397
			champs = champs.replaceAll(":latitude", "");
1556
			champs = champs.replaceAll(":latitude", "");
1398
		}
1557
		}
1399
		
1558
		
1400
		if(longModifiee) {
1559
		if(longModifiee) {
1401
			longM = longitude.getText();
1560
			longM = longitude.getText();
1402
		}else {
1561
		}else {
1403
			champs = champs.replaceAll(":longitude", "");
1562
			champs = champs.replaceAll(":longitude", "");
1404
		}
1563
		}
-
 
1564
		
-
 
1565
		if(abondanceModifiee && !selecteurAbondance.getRawValue().equals(VALEURS_MULTIPLES)) {
-
 
1566
			abondanceM = getAbondance();
-
 
1567
		} else {
-
 
1568
			champs = champs.replaceAll(":abondance", "");
-
 
1569
		}
-
 
1570
		
-
 
1571
		if(certitudeModifiee && !selecteurCertitude.getRawValue().equals(VALEURS_MULTIPLES)) {
-
 
1572
			certitudeM = getCertitude();
-
 
1573
		} else {
-
 
1574
			champs = champs.replaceAll(":certitude", "");
-
 
1575
		}
1405
		
1576
		
1406
		champs = champs.replaceAll(":",", ");
1577
		champs = champs.replaceAll(":",", ");
1407
		if(champs.startsWith(",")) {
1578
		if(champs.startsWith(",")) {
1408
			champs = champs.replaceFirst(",", "");
1579
			champs = champs.replaceFirst(",", "");
1409
		}
1580
		}
1410
		
1581
		
1411
		String message = "Voulez vous modifier le(s) champ(s) suivant(s) : "+champs+"   pour les observations selectionnées ?" ;
1582
		String message = "Voulez vous modifier le(s) champ(s) suivant(s) : "+champs+"   pour les observations selectionnées ?" ;
1412
		
1583
		
1413
		if(champs.trim().equals("")) {
1584
		if(champs.trim().equals("")) {
1414
			Window.alert("Aucun champ n'a été modifié");
1585
			Window.alert("Aucun champ n'a été modifié");
1415
		} else {
1586
		} else {
1416
			Observation obs = new Observation(especeM,numNomSelM,communeM,departementM,lieuDitM,stationM,milieuM, commM,dateM);
1587
			Observation obs = new Observation(especeM,numNomSelM,communeM,departementM,lieuDitM,stationM,milieuM, commM,dateM);
1417
			obs.setNumeroOrdre(numeroOrdre);
1588
			obs.setNumeroOrdre(numeroOrdre);
1418
			obs.setLatitude(latM);
1589
			obs.setLatitude(latM);
1419
			obs.setLongitude(longM);
1590
			obs.setLongitude(longM);
-
 
1591
			obs.setAbondance(abondanceM);
-
 
1592
			obs.setCertitude(certitudeM);
1420
			if(Window.confirm(message)) {
1593
			if(Window.confirm(message)) {
1421
				observationMediateur.modifierObservationEnMasse(obs);
1594
				observationMediateur.modifierObservationEnMasse(obs);
1422
				reinitialiserValeurModifiees();
1595
				reinitialiserValeurModifiees();
1423
			}
1596
			}
1424
		}
1597
		}
1425
	}
1598
	}
1426
	
1599
	
1427
	private void supprimerObservation() {
1600
	private void supprimerObservation() {
1428
		
1601
		
1429
		observationMediateur.supprimerObservation(this, numeroOrdre);
1602
		observationMediateur.supprimerObservation(this, numeroOrdre);
1430
	}
1603
	}
1431
	
1604
	
1432
	public void afficherDetailsObservation(Observation obs)
1605
	public void afficherDetailsObservation(Observation obs)
1433
	{
1606
	{
1434
		raz() ;
1607
		raz() ;
1435
		String idLoc ;
1608
		String idLoc ;
1436
		if(obs.getIdentifiantLocalite() != VALEURS_MULTIPLES) {
1609
		if(obs.getIdentifiantLocalite() != VALEURS_MULTIPLES) {
1437
			idLoc = obs.getIdentifiantLocalite().replaceAll(" ","/");
1610
			idLoc = obs.getIdentifiantLocalite().replaceAll(" ","/");
1438
			idLoc = idLoc.replaceAll("%","");
1611
			idLoc = idLoc.replaceAll("%","");
1439
			idLoc = idLoc.replaceAll("\"","");
1612
			idLoc = idLoc.replaceAll("\"","");
1440
			idLoc = idLoc.replace('\\',' ');
1613
			idLoc = idLoc.replace('\\',' ');
1441
			idLoc = idLoc.trim();
1614
			idLoc = idLoc.trim();
1442
			if(idLoc.length() == 5) {
1615
			if(idLoc.length() == 5) {
1443
				idLoc = idLoc.substring(0,2);
1616
				idLoc = idLoc.substring(0,2);
1444
			}
1617
			}
1445
		} else {
1618
		} else {
1446
			idLoc = obs.getIdentifiantLocalite();
1619
			idLoc = obs.getIdentifiantLocalite();
1447
			if(idLoc.length() == 5) {
1620
			if(idLoc.length() == 5) {
1448
				idLoc = idLoc.substring(0,2);
1621
				idLoc = idLoc.substring(0,2);
1449
			}
1622
			}
1450
		}
1623
		}
1451
		
1624
		
1452
		if(!obs.getDate().equals("null") && !obs.getDate().equals("000null") && !obs.getDate().equals(VALEURS_MULTIPLES)) {
1625
		if(!obs.getDate().equals("null") && !obs.getDate().equals("000null") && !obs.getDate().equals(VALEURS_MULTIPLES)) {
1453
			String[] dateEtHeure = obs.getDate().split(" ", 2);
1626
			String[] dateEtHeure = obs.getDate().split(" ", 2);
1454
			if(verifierFormatDate(dateEtHeure[0])) {
1627
			if(verifierFormatDate(dateEtHeure[0])) {
1455
				date.setValue(dateEtHeure[0]) ;
1628
				date.setValue(dateEtHeure[0]) ;
1456
			}
1629
			}
1457
			else
1630
			else
1458
			{
1631
			{
1459
				date.setRawValue(""); 
1632
				date.setRawValue(""); 
1460
			}
1633
			}
1461
		} else {
1634
		} else {
1462
			date.setRawValue(VALEURS_MULTIPLES);
1635
			date.setRawValue(VALEURS_MULTIPLES);
1463
			date.clearInvalid();
1636
			date.clearInvalid();
1464
		}
1637
		}
1465
		if(!obs.getLieudit().equals("null") && !obs.getLieudit().equals("000null")) {
1638
		if(!obs.getLieudit().equals("null") && !obs.getLieudit().equals("000null")) {
1466
			lieudit.setValue(obs.getLieudit()) ;
1639
			lieudit.setValue(obs.getLieudit()) ;
1467
		}
1640
		}
1468
		if(!obs.getStation().equals("null") && !obs.getStation().equals("000null")) {
1641
		if(!obs.getStation().equals("null") && !obs.getStation().equals("000null")) {
1469
			station.setValue(obs.getStation()) ;
1642
			station.setValue(obs.getStation()) ;
1470
		}
1643
		}
1471
		if(!obs.getMilieu().equals("null") && !obs.getMilieu().equals("000null")) {
1644
		if(!obs.getMilieu().equals("null") && !obs.getMilieu().equals("000null")) {
1472
			milieu.setValue(obs.getMilieu()) ;
1645
			milieu.setValue(obs.getMilieu()) ;
1473
		}
1646
		}
1474
		if(!obs.getCommentaire().equals("null") && !obs.getCommentaire().equals("000null")) {
1647
		if(!obs.getCommentaire().equals("null") && !obs.getCommentaire().equals("000null")) {
1475
 
1648
 
1476
			comment.setRawValue(Util.remplacerSautsDeligneMalEncodes(obs.getCommentaire()));
1649
			comment.setRawValue(Util.remplacerSautsDeligneMalEncodes(obs.getCommentaire()));
1477
			
1650
			
1478
		}
1651
		}
1479
		if(!obs.getLocalite().equals("null") && !obs.getLocalite().equals("000null")) {
1652
		if(!obs.getLocalite().equals("null") && !obs.getLocalite().equals("000null")) {
1480
			if(!idLoc.equals("000null") && !idLoc.equals("")) {
1653
			if(!idLoc.equals("000null") && !idLoc.equals("")) {
1481
				if(!idLoc.equals(VALEURS_MULTIPLES)) {
1654
				if(!idLoc.equals(VALEURS_MULTIPLES)) {
1482
					commune.setValue(obs.getLocalite()+" ("+idLoc+")") ;
1655
					commune.setValue(obs.getLocalite()+" ("+idLoc+")") ;
1483
				} else {
1656
				} else {
1484
					commune.setValue(VALEURS_MULTIPLES);
1657
					commune.setValue(VALEURS_MULTIPLES);
1485
				}
1658
				}
1486
			}
1659
			}
1487
			else
1660
			else
1488
			{
1661
			{
1489
				commune.setValue(obs.getLocalite());
1662
				commune.setValue(obs.getLocalite());
1490
			}
1663
			}
1491
		}
1664
		}
1492
		if(!obs.getIdentifiantLocalite().equals("null") && !obs.getIdentifiantLocalite().equals("000null")) {
1665
		if(!obs.getIdentifiantLocalite().equals("null") && !obs.getIdentifiantLocalite().equals("000null")) {
1493
			departement = idLoc;
1666
			departement = idLoc;
1494
		}
1667
		}
1495
		if(!obs.getNomSaisi().equals("null") && !obs.getNomSaisi().equals("000null")) {
1668
		if(!obs.getNomSaisi().equals("null") && !obs.getNomSaisi().equals("000null")) {
1496
			espece.setValue(obs.getNomSaisi()) ;
1669
			espece.setValue(obs.getNomSaisi()) ;
1497
		}
1670
		}
1498
		if(!obs.getNumeroNomenclaturalSaisi().equals("null") && !obs.getNumeroNomenclaturalSaisi().equals("000null")) {
1671
		if(!obs.getNumeroNomenclaturalSaisi().equals("null") && !obs.getNumeroNomenclaturalSaisi().equals("000null")) {
1499
			numeroNom = obs.getNumeroNomenclaturalSaisi() ;
1672
			numeroNom = obs.getNumeroNomenclaturalSaisi() ;
1500
		}
1673
		}
1501
		if(!obs.getNumeroOrdre().equals("null") && !obs.getNumeroOrdre().equals("000null")) {
1674
		if(!obs.getNumeroOrdre().equals("null") && !obs.getNumeroOrdre().equals("000null")) {
1502
			numeroOrdre = obs.getNumeroOrdre() ;
1675
			numeroOrdre = obs.getNumeroOrdre() ;
1503
		}
1676
		}
1504
		
1677
		
1505
		if(!obs.getLatitude().equals("null") && !obs.getLatitude().equals("000null")
1678
		if(!obs.getLatitude().equals("null") && !obs.getLatitude().equals("000null")
1506
				&& !obs.getLongitude().equals("null") && !obs.getLongitude().equals("000null")) {
1679
				&& !obs.getLongitude().equals("null") && !obs.getLongitude().equals("000null")) {
1507
			latitude.setValue(obs.getLatitude()) ;
1680
			latitude.setValue(obs.getLatitude()) ;
1508
			longitude.setValue(obs.getLongitude()) ;
1681
			longitude.setValue(obs.getLongitude()) ;
1509
		}
1682
		}
-
 
1683
		
-
 
1684
		selecteurAbondance.getStore().load();
-
 
1685
		selecteurAbondance.setValue(obs.getAbondance());
-
 
1686
		
-
 
1687
		selecteurCertitude.getStore().load();
-
 
1688
		selecteurCertitude.setValue(obs.getCertitude());
1510
	}
1689
	}
1511
	
1690
	
1512
	
1691
	
1513
	public void raz()
1692
	public void raz()
1514
	{
1693
	{
1515
		raz(Champs.TOUT);
1694
		raz(Champs.TOUT);
1516
		
1695
		
1517
	}
1696
	}
1518
	public void raz(Champs champs)
1697
	public void raz(Champs champs)
1519
	{
1698
	{
1520
		switch (champs) {
1699
		switch (champs) {
1521
		
1700
		
1522
		
1701
		
1523
			case DATE:
1702
			case DATE:
1524
				date.reset() ;
1703
				date.reset() ;
1525
				break;
1704
				break;
1526
		
1705
		
1527
			case LIEUDIT:
1706
			case LIEUDIT:
1528
				lieudit.reset() ;
1707
				lieudit.reset() ;
1529
				break;
1708
				break;
1530
		
1709
		
1531
			case STATION:
1710
			case STATION:
1532
				station.reset() ;
1711
				station.reset() ;
1533
				break;
1712
				break;
1534
		
1713
		
1535
			case MILIEU:
1714
			case MILIEU:
1536
				milieu.reset() ;
1715
				milieu.reset() ;
1537
				break;
1716
				break;
1538
		
1717
		
1539
			case COMMENT:
1718
			case COMMENT:
1540
				comment.reset() ;
1719
				comment.reset() ;
1541
				break;
1720
				break;
1542
 
1721
 
1543
 
1722
 
1544
			case COMMUNE:
1723
			case COMMUNE:
1545
				commune.reset() ;
1724
				commune.reset() ;
1546
				departement ="";
1725
				departement ="";
1547
				latitude.reset();
1726
				latitude.reset();
1548
				longitude.reset();
1727
				longitude.reset();
1549
				break;
1728
				break;
1550
				
1729
				
1551
			case ESPECE:
1730
			case ESPECE:
1552
				espece.reset();
1731
				espece.reset();
1553
				numeroNom = "" ;
1732
				numeroNom = "" ;
1554
				numeroOrdre = "";
1733
				numeroOrdre = "";
1555
				break;
1734
				break;
1556
				
1735
				
1557
			case LATITUDE:
1736
			case LATITUDE:
1558
				latitude.reset();
1737
				latitude.reset();
1559
				afficherIndicationCommune(null);
1738
				afficherIndicationCommune(null);
1560
				break;
1739
				break;
1561
				
1740
				
1562
			case LONGITUDE:
1741
			case LONGITUDE:
1563
				longitude.reset();
1742
				longitude.reset();
1564
				afficherIndicationCommune(null);
1743
				afficherIndicationCommune(null);
1565
				break;
1744
				break;
-
 
1745
				
-
 
1746
			case ABONDANCE:
-
 
1747
				selecteurAbondance.setValue("");
-
 
1748
				break;
-
 
1749
				
-
 
1750
			case CERTITUDE:
-
 
1751
				selecteurCertitude.setValue("");
-
 
1752
				break;
1566
				
1753
				
1567
			case TOUT:
1754
			case TOUT:
1568
				commune.reset();
1755
				commune.reset();
1569
				date.reset() ;
1756
				date.reset() ;
1570
				lieudit.reset() ;
1757
				lieudit.reset() ;
1571
				station.reset() ;
1758
				station.reset() ;
1572
				milieu.reset() ;
1759
				milieu.reset() ;
1573
				comment.reset() ;
1760
				comment.reset() ;
1574
				milieu.reset() ;
1761
				milieu.reset() ;
1575
				latitude.reset();
1762
				latitude.reset();
1576
				longitude.reset();
1763
				longitude.reset();
1577
				departement ="";
1764
				departement ="";
1578
				espece.reset();
1765
				espece.reset();
-
 
1766
				selecteurAbondance.clearValue();
-
 
1767
				selecteurCertitude.clearValue();
1579
				numeroNom = "" ;
1768
				numeroNom = "" ;
1580
				numeroOrdre = "";
1769
				numeroOrdre = "";
1581
				afficherIndicationCommune(null);
1770
				afficherIndicationCommune(null);
1582
				break;
1771
				break;
1583
 
1772
 
1584
		}
1773
		}
1585
		
1774
		
1586
	}
1775
	}
1587
	
1776
	
1588
	private void setModification(String mode)
1777
	private void setModification(String mode)
1589
	{
1778
	{
1590
		if(mode.equals("true")) {
1779
		if(mode.equals("true")) {
1591
 
1780
 
1592
			boutonOK.setText("Modifier") ;
1781
			boutonOK.setText("Modifier") ;
1593
			setTitle("Modification") ;
1782
			setTitle("Modification") ;
1594
			boutonAnnuler.setText("Supprimer") ;
1783
			boutonAnnuler.setText("Supprimer") ;
1595
			modification = true ;
1784
			modification = true ;
1596
			selecteurMode.removeClass("x-selec-crea") ;
1785
			selecteurMode.removeClass("x-selec-crea") ;
1597
			selecteurMode.setCls("x-selec-modif") ;
1786
			selecteurMode.setCls("x-selec-modif") ;
1598
			observationMediateur.onModeModification();
1787
			observationMediateur.onModeModification();
1599
		}
1788
		}
1600
		else
1789
		else
1601
		{
1790
		{
1602
			boutonOK.setText("Créer") ;
1791
			boutonOK.setText("Créer") ;
1603
			setTitle("Saisir") ;
1792
			setTitle("Saisir") ;
1604
			boutonAnnuler.setText("Réinitialiser") ;
1793
			boutonAnnuler.setText("Réinitialiser") ;
1605
			modification = false ;
1794
			modification = false ;
1606
			selecteurMode.removeClass("x-selec-modif") ;
1795
			selecteurMode.removeClass("x-selec-modif") ;
1607
			selecteurMode.setCls("x-selec-crea") ;
1796
			selecteurMode.setCls("x-selec-crea") ;
1608
			observationMediateur.onModeCreation();
1797
			observationMediateur.onModeCreation();
1609
		}	
1798
		}	
1610
	}
1799
	}
1611
	
1800
	
1612
	/**
1801
	/**
1613
	 * renvoie vrai si on est en mode modification, faux si on est en mode création
1802
	 * renvoie vrai si on est en mode modification, faux si on est en mode création
1614
	 * @return
1803
	 * @return
1615
	 */
1804
	 */
1616
	public boolean getModification()
1805
	public boolean getModification()
1617
	{
1806
	{
1618
		return modification ;
1807
		return modification ;
1619
	}
1808
	}
1620
	
1809
	
1621
	/**
1810
	/**
1622
	 * renvoie vrai si on est en mode modification de masse, faux sinon
1811
	 * renvoie vrai si on est en mode modification de masse, faux sinon
1623
	 * @return
1812
	 * @return
1624
	 */
1813
	 */
1625
	public boolean getMasseModification()
1814
	public boolean getMasseModification()
1626
	{
1815
	{
1627
		return masseModification ;
1816
		return masseModification ;
1628
	}
1817
	}
1629
	
1818
	
1630
	public boolean verifierFormatDate(String date) {
1819
	public boolean verifierFormatDate(String date) {
1631
		
1820
		
1632
		String regex = "[1-9][0-9]{3}-[0-9]{2}-[0-9]{2}" ;
1821
		String regex = "[1-9][0-9]{3}-[0-9]{2}-[0-9]{2}" ;
1633
		if(date.matches(regex) && !date.equals("0000-00-00")) {
1822
		if(date.matches(regex) && !date.equals("0000-00-00")) {
1634
			return true ;
1823
			return true ;
1635
		}
1824
		}
1636
		else {
1825
		else {
1637
			return false;
1826
			return false;
1638
		}
1827
		}
1639
	}
1828
	}
1640
 
1829
 
1641
	public void setMasseModification(boolean masseModification) {
1830
	public void setMasseModification(boolean masseModification) {
1642
		this.masseModification = masseModification;
1831
		this.masseModification = masseModification;
1643
		if(masseModification) {
1832
		if(masseModification) {
1644
			reinitialiserValeurModifiees();
1833
			reinitialiserValeurModifiees();
1645
		}
1834
		}
1646
	}
1835
	}
1647
	
1836
	
1648
	private void calculerAfficherDifferences(ListeObservation listeObs) {
1837
	private void calculerAfficherDifferences(ListeObservation listeObs) {
1649
		
1838
		
1650
		String departement = null;
1839
		String departement = null;
1651
		String commune = null;
1840
		String commune = null;
1652
		String lieuDit = null;
1841
		String lieuDit = null;
1653
		String station = null;
1842
		String station = null;
1654
		String milieu = null;
1843
		String milieu = null;
1655
		String espece = null;
1844
		String espece = null;
1656
		String date = null;
1845
		String date = null;
1657
		String notes = null;
1846
		String notes = null;
1658
		String lat = null;
1847
		String lat = null;
1659
		String lon = null;
1848
		String lon = null;
-
 
1849
		String abondance = null;
-
 
1850
		String certitude = null;
1660
		
1851
		
1661
		String ordreObs = "";
1852
		String ordreObs = "";
1662
		
1853
		
1663
		for(Iterator<String> it = listeObs.keySet().iterator();it.hasNext();) {
1854
		for(Iterator<String> it = listeObs.keySet().iterator();it.hasNext();) {
1664
			Observation obsEnCours = listeObs.get(it.next());
1855
			Observation obsEnCours = listeObs.get(it.next());
1665
			departement = comparerDifferencesChamps(departement, obsEnCours.getIdentifiantLocalite());
1856
			departement = comparerDifferencesChamps(departement, obsEnCours.getIdentifiantLocalite());
1666
			commune = comparerDifferencesChamps(commune, obsEnCours.getLocalite());
1857
			commune = comparerDifferencesChamps(commune, obsEnCours.getLocalite());
1667
			lieuDit = comparerDifferencesChamps(lieuDit, obsEnCours.getLieudit());
1858
			lieuDit = comparerDifferencesChamps(lieuDit, obsEnCours.getLieudit());
1668
			station = comparerDifferencesChamps(station, obsEnCours.getStation());
1859
			station = comparerDifferencesChamps(station, obsEnCours.getStation());
1669
			milieu = comparerDifferencesChamps(milieu, obsEnCours.getMilieu());
1860
			milieu = comparerDifferencesChamps(milieu, obsEnCours.getMilieu());
1670
			espece = comparerDifferencesChamps(espece, obsEnCours.getNomSaisi()); 
1861
			espece = comparerDifferencesChamps(espece, obsEnCours.getNomSaisi()); 
1671
			date = comparerDifferencesChamps(date, obsEnCours.getDate());
1862
			date = comparerDifferencesChamps(date, obsEnCours.getDate());
1672
			notes = comparerDifferencesChamps(notes, obsEnCours.getCommentaire());
1863
			notes = comparerDifferencesChamps(notes, obsEnCours.getCommentaire());
1673
			lat = comparerDifferencesChamps(lat, obsEnCours.getLatitude());
1864
			lat = comparerDifferencesChamps(lat, obsEnCours.getLatitude());
1674
			lon = comparerDifferencesChamps(lon, obsEnCours.getLongitude());
1865
			lon = comparerDifferencesChamps(lon, obsEnCours.getLongitude());
-
 
1866
			abondance = comparerDifferencesChamps(abondance, obsEnCours.getAbondance());
-
 
1867
			certitude = comparerDifferencesChamps(certitude, obsEnCours.getCertitude());
1675
			
1868
			
1676
			ordreObs += obsEnCours.getNumeroOrdre()+",";
1869
			ordreObs += obsEnCours.getNumeroOrdre()+",";
1677
		}
1870
		}
1678
		
1871
		
1679
		Observation obs=new Observation(espece,numeroNom,commune,departement,lieuDit,station,milieu, notes,date);
1872
		Observation obs=new Observation(espece,numeroNom,commune,departement,lieuDit,station,milieu, notes,date);
1680
		obs.setNumeroOrdre(ordreObs);
1873
		obs.setNumeroOrdre(ordreObs);
1681
		obs.setLatitude(lat);
1874
		obs.setLatitude(lat);
1682
		obs.setLongitude(lon);
1875
		obs.setLongitude(lon);
-
 
1876
		obs.setAbondance(abondance);
-
 
1877
		obs.setCertitude(certitude);
1683
		rafraichir(obs, false);
1878
		rafraichir(obs, false);	
1684
		
-
 
1685
	}
1879
	}
1686
	
1880
	
1687
	private String comparerDifferencesChamps(String valeurActuelle, String nouvelleValeur) {
1881
	private String comparerDifferencesChamps(String valeurActuelle, String nouvelleValeur) {
1688
		
1882
		
1689
		String retour = "000null";
1883
		String retour = "000null";
1690
		
1884
		
1691
			if(valeurActuelle == null) {
1885
			if(valeurActuelle == null) {
1692
				retour = nouvelleValeur;
1886
				retour = nouvelleValeur;
1693
			} else {
1887
			} else {
1694
				if(valeurActuelle.equals(nouvelleValeur)) {
1888
				if(valeurActuelle.equals(nouvelleValeur)) {
1695
					retour = valeurActuelle;
1889
					retour = valeurActuelle;
1696
				} else {
1890
				} else {
1697
					retour = VALEURS_MULTIPLES;
1891
					retour = VALEURS_MULTIPLES;
1698
				}
1892
				}
1699
			}
1893
			}
1700
		return retour;
1894
		return retour;
1701
	}
1895
	}
1702
	
1896
	
1703
	private void reinitialiserValeurModifiees() {
-
 
1704
		
1897
	private void reinitialiserValeurModifiees() {	
1705
		communeModifiee = false;
1898
		communeModifiee = false;
1706
		lieuDitModifie = false;
1899
		lieuDitModifie = false;
1707
		stationModifiee = false;
1900
		stationModifiee = false;
1708
		milieuModifie = false;
1901
		milieuModifie = false;
1709
		dateModifiee = false;
1902
		dateModifiee = false;
1710
		especeModifiee = false;
1903
		especeModifiee = false;
1711
		commModifie = false;
1904
		commModifie = false;
1712
		latModifiee = false;
1905
		latModifiee = false;
1713
		longModifiee = false;
1906
		longModifiee = false;
-
 
1907
		abondanceModifiee = false;
-
 
1908
		certitudeModifiee = false;
1714
	}
1909
	}
1715
	
1910
	
1716
	public void saisieTabindex()
1911
	public void saisieTabindex()
1717
	{
1912
	{
1718
		
1913
		
1719
		selecteurMode.setTabIndex(0);
1914
		selecteurMode.setTabIndex(0);
1720
		commune.setTabIndex(1);
1915
		commune.setTabIndex(1);
1721
		lieudit.setTabIndex(3);
1916
		lieudit.setTabIndex(3);
1722
		station.setTabIndex(4);
1917
		station.setTabIndex(4);
1723
		milieu.setTabIndex(5);
1918
		milieu.setTabIndex(5);
1724
		coordonnees.setTabIndex(-1);
1919
		coordonnees.setTabIndex(-1);
1725
		coordonnees.addListener(new TextFieldListenerAdapter() {
1920
		coordonnees.addListener(new TextFieldListenerAdapter() {
1726
 
1921
 
1727
			@Override
1922
			@Override
1728
			public void onFocus(Field field) {
1923
			public void onFocus(Field field) {
1729
				if(coordPanel.isVisible()) {
1924
				if(coordPanel.isVisible()) {
1730
					latitude.focus();
1925
					latitude.focus();
1731
				} else {
1926
				} else {
1732
					Ext.get("lien_carto").focus();
1927
					Ext.get("lien_carto").focus();
1733
				}
1928
				}
1734
			}	
1929
			}	
1735
		});
1930
		});
1736
			
1931
			
1737
		latitude.setTabIndex(8);
1932
		latitude.setTabIndex(8);
1738
		longitude.setTabIndex(9);
1933
		longitude.setTabIndex(9);
1739
		comment.setTabIndex(10);
1934
		comment.setTabIndex(10);
1740
		date.setTabIndex(11);
1935
		date.setTabIndex(11);
1741
		espece.setTabIndex(12);
1936
		espece.setTabIndex(12);
-
 
1937
		selecteurAbondance.setTabIndex(13);
-
 
1938
		selecteurCertitude.setTabIndex(14);
1742
		boutonOK.setTabIndex(13);
1939
		boutonOK.setTabIndex(15);
1743
		boutonAnnuler.setTabIndex(14);
1940
		boutonAnnuler.setTabIndex(16);
1744
		
1941
		
1745
	}
1942
	}
1746
	
1943
	
1747
	private void obtenirInformationCoord() {
1944
	private void obtenirInformationCoord() {
1748
		if(coordonneesValides() != null) {
1945
		if(coordonneesValides() != null) {
1749
			observationMediateur.obtenirInformationCoord(LatLng.newInstance(coordonneesValides()[0],coordonneesValides()[1]));
1946
			observationMediateur.obtenirInformationCoord(LatLng.newInstance(coordonneesValides()[0],coordonneesValides()[1]));
1750
		} else {
1947
		} else {
1751
			observationMediateur.afficherFenetreCarto();
1948
			observationMediateur.afficherFenetreCarto();
1752
		}
1949
		}
1753
 
1950
 
1754
	}
1951
	}
1755
	
1952
	
1756
	private void obtenirInformationCommune() {
1953
	private void obtenirInformationCommune() {
1757
		observationMediateur.obtenirInformationCommune(getCommuneSansDepartement(), obtenirDepartementAPartirChampCommune());
1954
		observationMediateur.obtenirInformationCommune(getCommuneSansDepartement(), obtenirDepartementAPartirChampCommune());
1758
	}
1955
	}
1759
	
1956
	
1760
	public double[] coordonneesValides() {
1957
	public double[] coordonneesValides() {
1761
		
1958
		
1762
		try {
1959
		try {
1763
						
1960
						
1764
			double lat = Double.parseDouble(latitude.getValueAsString().replaceAll(",", "."));
1961
			double lat = Double.parseDouble(latitude.getValueAsString().replaceAll(",", "."));
1765
			double lon = Double.parseDouble(longitude.getValueAsString().replaceAll(",", "."));
1962
			double lon = Double.parseDouble(longitude.getValueAsString().replaceAll(",", "."));
1766
			
1963
			
1767
			double[] coord = {lat, lon};
1964
			double[] coord = {lat, lon};
1768
			return coord;
1965
			return coord;
1769
			
1966
			
1770
		} catch (NumberFormatException ne) {
1967
		} catch (NumberFormatException ne) {
1771
			return null;
1968
			return null;
1772
		}
1969
		}
1773
	}
1970
	}
1774
	
1971
	
1775
	private String[] getValeurCoordonnees() {
1972
	private String[] getValeurCoordonnees() {
1776
		double[] coDouble = coordonneesValides();
1973
		double[] coDouble = coordonneesValides();
1777
		
1974
		
1778
		if(coDouble != null) {
1975
		if(coDouble != null) {
1779
			String[] coord = {coDouble[0]+"",coDouble[1]+""};
1976
			String[] coord = {coDouble[0]+"",coDouble[1]+""};
1780
			return coord;
1977
			return coord;
1781
		} else {
1978
		} else {
1782
			String[] coord = {"000null","000null" };
1979
			String[] coord = {"000null","000null" };
1783
			return coord;
1980
			return coord;
1784
		}
1981
		}
1785
	}
1982
	}
1786
	
1983
	
1787
	private String obtenirDepartementAPartirChampCommune() {
1984
	private String obtenirDepartementAPartirChampCommune() {
1788
		
1985
		
1789
		String dep = "";
1986
		String dep = "";
1790
		
1987
		
1791
		if(departement == null) {
1988
		if(departement == null) {
1792
			departement = "";
1989
			departement = "";
1793
		}
1990
		}
1794
		
1991
		
1795
		if(departement.equals("000null") || departement.equals("")) {
1992
		if(departement.equals("000null") || departement.equals("")) {
1796
					
1993
					
1797
			String[] depCom = commune.getText().split(" ");
1994
			String[] depCom = commune.getText().split(" ");
1798
			if(depCom.length > 1) {
1995
			if(depCom.length > 1) {
1799
				dep = depCom[1].replace('(', ' ');
1996
				dep = depCom[1].replace('(', ' ');
1800
			} else {
1997
			} else {
1801
				dep = "";
1998
				dep = "";
1802
			}
1999
			}
1803
		} else {
2000
		} else {
1804
			dep = departement;
2001
			dep = departement;
1805
		}
2002
		}
1806
		
2003
		
1807
		dep = dep.replace(')', ' ');
2004
		dep = dep.replace(')', ' ');
1808
		dep = dep.trim();
2005
		dep = dep.trim();
1809
		dep = dep.replace('\\',' ');
2006
		dep = dep.replace('\\',' ');
1810
		dep = dep.trim();
2007
		dep = dep.trim();
1811
		
2008
		
1812
		try
2009
		try
1813
		{
2010
		{
1814
			int nDep = Integer.parseInt(dep);
2011
			int nDep = Integer.parseInt(dep);
1815
			if(nDep > 0 && nDep < 110) {
2012
			if(nDep > 0 && nDep < 110) {
1816
				departement = dep ;
2013
				departement = dep ;
1817
			}
2014
			}
1818
			
2015
			
1819
			if(departement.length() == 4) {
2016
			if(departement.length() == 4) {
1820
				departement = "0"+departement;
2017
				departement = "0"+departement;
1821
			}
2018
			}
1822
			
2019
			
1823
			departement = departement.substring(0,2);
2020
			departement = departement.substring(0,2);
1824
		}
2021
		}
1825
		catch(NumberFormatException e)
2022
		catch(NumberFormatException e)
1826
		{
2023
		{
1827
			departement = "" ;
2024
			departement = "" ;
1828
		}
2025
		}
1829
		
2026
		
1830
		return departement;
2027
		return departement;
1831
	}
2028
	}
1832
	
2029
	
1833
	public String getCommune() {
2030
	public String getCommune() {
1834
		
2031
		
1835
		String valeurCommune = "";
2032
		String valeurCommune = "";
1836
		
2033
		
1837
		if(commune.getValue() != null) {
2034
		if(commune.getValue() != null) {
1838
			valeurCommune = commune.getValue(); 
2035
			valeurCommune = commune.getValue(); 
1839
		}
2036
		}
1840
		return valeurCommune;
2037
		return valeurCommune;
1841
	}
2038
	}
1842
	
2039
	
1843
	public String getDepartement() {
2040
	public String getDepartement() {
1844
		return obtenirDepartementAPartirChampCommune();
2041
		return obtenirDepartementAPartirChampCommune();
1845
	}
2042
	}
1846
	 
2043
	 
1847
	public String getCommuneSansDepartement() {
2044
	public String getCommuneSansDepartement() {
1848
		return Util.supprimerNumDepartementChaineLocalite(getCommune());
2045
		return Util.supprimerNumDepartementChaineLocalite(getCommune());
1849
	}
2046
	}
-
 
2047
	
-
 
2048
	//TODO fusionner les deux fonctions et les objets qu'elles utilisent 
-
 
2049
	// car leur code est à 99% identique
-
 
2050
	public String getAbondance() {
-
 
2051
		String valeurAbondance = selecteurAbondance.getValue();
-
 
2052
		String valeurAbondanceBrute = selecteurAbondance.getRawValue();
-
 
2053
		
-
 
2054
		// Test idiot qui permet de savoir si l'on utilise la valeur saisie directement ou bien la valeur
-
 
2055
		// selectionnee car lors du setValue sur le keypress, gwtext ne prends pas en compte le dernier 
-
 
2056
		// caractère
-
 
2057
		if(valeurAbondance.equals(valeurAbondanceBrute.substring(0, valeurAbondanceBrute.length() -1))) {
-
 
2058
			valeurAbondance = selecteurAbondance.getRawValue();
-
 
2059
		}
-
 
2060
		
-
 
2061
		return valeurAbondance;
-
 
2062
	}
-
 
2063
	
-
 
2064
	public String getCertitude() {
-
 
2065
		String valeurCertitude = selecteurCertitude.getValue();
-
 
2066
		String valeurCertitudeBrute = selecteurCertitude.getRawValue();
-
 
2067
		
-
 
2068
		// Test idiot qui permet de savoir si l'on utilise la valeur saisie directement ou bien la valeur
-
 
2069
		// selectionnee car lors du setValue sur le keypress, gwtext ne prends pas en compte le dernier 
-
 
2070
		// caractère
-
 
2071
		if(valeurCertitude.equals(valeurCertitudeBrute.substring(0, valeurCertitudeBrute.length() -1))) {
-
 
2072
			valeurCertitude = selecteurCertitude.getRawValue();
-
 
2073
		}
-
 
2074
		
-
 
2075
		return valeurCertitude;
-
 
2076
	}
1850
 
2077
 
1851
	public boolean communeInitialisee() {
2078
	public boolean communeInitialisee() {
1852
		return communeModifiee;
2079
		return communeModifiee;
1853
	}
2080
	}
1854
	
2081
	
1855
	public void redimensionnerFormulaire() {
2082
	public void redimensionnerFormulaire() {
1856
		afficherFormulaireLatLon.setWidth(panneauIntermediaire.getWidth()+"px");
2083
		afficherFormulaireLatLon.setWidth(panneauIntermediaire.getWidth()+"px");
1857
		panneauPremierColonne.doLayout();
2084
		panneauPremierColonne.doLayout();
1858
		panneauSecondeColonne.doLayout();
2085
		panneauSecondeColonne.doLayout();
1859
		panneauIntermediaire.doLayout();
2086
		panneauIntermediaire.doLayout();
1860
		
2087
		
1861
		doLayout();
2088
		doLayout();
1862
	}
2089
	}
1863
}
2090
}