Subversion Repositories eFlore/Applications.cel

Rev

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

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