Subversion Repositories eFlore/Applications.cel

Rev

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

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