Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 107 Rev 110
1
package org.tela_botanica.client.vues;
1
package org.tela_botanica.client.vues;
2
 
2
 
3
 
3
 
4
 
4
 
5
import java.util.Iterator;
5
import java.util.Iterator;
6
 
6
 
7
import org.tela_botanica.client.interfaces.Rafraichissable;
7
import org.tela_botanica.client.interfaces.Rafraichissable;
8
import org.tela_botanica.client.modeles.ListeReferentielCommune;
8
import org.tela_botanica.client.modeles.ListeReferentielCommune;
9
import org.tela_botanica.client.modeles.ListeReferentielNom;
9
import org.tela_botanica.client.modeles.ListeReferentielNom;
10
import org.tela_botanica.client.modeles.Observation;
10
import org.tela_botanica.client.modeles.Observation;
11
import org.tela_botanica.client.modeles.ReferentielCommune;
11
import org.tela_botanica.client.modeles.ReferentielCommune;
12
import org.tela_botanica.client.modeles.ReferentielNom;
12
import org.tela_botanica.client.modeles.ReferentielNom;
13
import org.tela_botanica.client.observation.ObservationMediateur;
13
import org.tela_botanica.client.observation.ObservationMediateur;
14
 
-
 
15
 
-
 
16
import com.google.gwt.user.client.Window;
14
import com.google.gwt.user.client.Window;
17
import com.gwtext.client.core.EventCallback;
15
import com.gwtext.client.core.EventCallback;
18
import com.gwtext.client.core.EventObject;
16
import com.gwtext.client.core.EventObject;
19
import com.gwtext.client.core.ListenerConfig;
17
import com.gwtext.client.core.ListenerConfig;
20
import com.gwtext.client.core.Position;
18
import com.gwtext.client.core.Position;
21
import com.gwtext.client.core.Template;
19
import com.gwtext.client.core.Template;
22
import com.gwtext.client.data.ArrayReader;
20
import com.gwtext.client.data.ArrayReader;
23
import com.gwtext.client.data.FieldDef;
21
import com.gwtext.client.data.FieldDef;
24
import com.gwtext.client.data.MemoryProxy;
22
import com.gwtext.client.data.MemoryProxy;
25
import com.gwtext.client.data.RecordDef;
23
import com.gwtext.client.data.RecordDef;
26
import com.gwtext.client.data.SimpleStore;
24
import com.gwtext.client.data.SimpleStore;
27
import com.gwtext.client.data.Store;
25
import com.gwtext.client.data.Store;
28
import com.gwtext.client.data.StringFieldDef;
26
import com.gwtext.client.data.StringFieldDef;
29
import com.gwtext.client.widgets.Button;
27
import com.gwtext.client.widgets.Button;
30
import com.gwtext.client.widgets.Panel;
28
import com.gwtext.client.widgets.Panel;
31
import com.gwtext.client.widgets.Toolbar;
29
import com.gwtext.client.widgets.Toolbar;
32
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
30
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
33
import com.gwtext.client.widgets.form.ComboBox;
31
import com.gwtext.client.widgets.form.ComboBox;
34
import com.gwtext.client.widgets.form.DateField;
32
import com.gwtext.client.widgets.form.DateField;
35
import com.gwtext.client.widgets.form.FormPanel;
33
import com.gwtext.client.widgets.form.FormPanel;
36
import com.gwtext.client.widgets.form.Hidden;
34
import com.gwtext.client.widgets.form.Hidden;
-
 
35
import com.gwtext.client.widgets.form.TextArea;
37
import com.gwtext.client.widgets.form.TextField;
36
import com.gwtext.client.widgets.form.TextField;
38
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
37
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
39
import com.gwtext.client.widgets.layout.ColumnLayout;
38
import com.gwtext.client.widgets.layout.ColumnLayout;
40
import com.gwtext.client.widgets.layout.ColumnLayoutData;
39
import com.gwtext.client.widgets.layout.ColumnLayoutData;
41
import com.gwtext.client.widgets.layout.FormLayout;
40
import com.gwtext.client.widgets.layout.FormLayout;
42
import com.gwtext.client.data.Record;
41
import com.gwtext.client.data.Record;
43
 
42
 
44
/**
43
/**
45
 * Panneau contenant les infos, les métadonnées et l'arbre des mots clés, il implémente l'interface rafraichissable
44
 * Panneau contenant les infos, les métadonnées et l'arbre des mots clés, il implémente l'interface rafraichissable
46
 * @author aurelien
45
 * @author aurelien
47
 *
46
 *
48
 */
47
 */
49
public class FormulaireSaisieObservationVue extends Panel implements Rafraichissable  {
48
public class FormulaireSaisieObservationVue extends Panel implements Rafraichissable  {
50
 
49
 
51
 
50
 
52
	/**
51
	/**
53
	 * Le médiateur associé à la vue
52
	 * Le médiateur associé à la vue
54
	 */
53
	 */
55
	private ObservationMediateur	observationMediateur		= null;
54
	private ObservationMediateur	observationMediateur		= null;
56
	
55
	
57
	
56
	
58
 
57
 
59
	private DateField date = null;
58
	private DateField date = null;
60
	private TextField lieudit = null;
59
	private TextField lieudit = null;
61
	private TextField station = null;
60
	private TextField station = null;
62
	private TextField milieu = null;
61
	private TextField milieu = null;
63
	private TextField comment = null;
62
	private TextField comment = null;
64
	private ComboBox  commune = null;
63
	private ComboBox  commune = null;
65
	private String departement = null;
64
	private String departement = null;
66
	private ComboBox  espece = null;
65
	private ComboBox  espece = null;
67
	private String numeroNom = null;
66
	private String numeroNom = null;
68
	private String numeroOrdre = null;
67
	private String numeroOrdre = null;
-
 
68
	private TextArea motsCles = null;
-
 
69
 
69
 
70
	private String formatDate = null ;
70
 
71
	
71
	private Button boutonOK = new Button("Créer");
72
	private Button boutonOK = new Button("Créer");
72
	private Button boutonAnnuler = new Button("Réinitialiser");
73
	private Button boutonAnnuler = new Button("Réinitialiser");
73
 
74
 
74
	private boolean selectionCommune=false;
75
	private boolean selectionCommune=false;
75
	private boolean selectionEspece=false;
76
	private boolean selectionEspece=false;
76
	
77
	
77
	private boolean modification = false ;
78
	private boolean modification = false ;
78
	private Toolbar bt = null ;
79
	private Toolbar bt = null ;
79
	
80
	
80
	private final int KEY_ALT = 18;
81
	private final int KEY_ALT = 18;
81
	private final int KEY_BACKSPACE = 8;
82
	private final int KEY_BACKSPACE = 8;
82
	private final int KEY_CTRL = 17;
83
	private final int KEY_CTRL = 17;
83
	private final int KEY_DELETE = 46;
84
	private final int KEY_DELETE = 46;
84
	private final int KEY_DOWN = 40;
85
	private final int KEY_DOWN = 40;
85
	private final int KEY_END = 35;
86
	private final int KEY_END = 35;
86
	private final int KEY_ENTER = 13;
87
	private final int KEY_ENTER = 13;
87
	private final int KEY_ESCAPE = 27;
88
	private final int KEY_ESCAPE = 27;
88
	private final int KEY_HOME = 36;
89
	private final int KEY_HOME = 36;
89
	private final int KEY_LEFT = 37;
90
	private final int KEY_LEFT = 37;
90
	private final int KEY_PAGEDOWN = 34;
91
	private final int KEY_PAGEDOWN = 34;
91
	private final int KEY_PAGEUP = 33;
92
	private final int KEY_PAGEUP = 33;
92
	private final int KEY_RIGHT = 39;
93
	private final int KEY_RIGHT = 39;
93
	private final int KEY_SHIFT = 16;
94
	private final int KEY_SHIFT = 16;
94
	private final int KEY_TAB = 9;
95
	private final int KEY_TAB = 9;
95
	private final int KEY_UP = 38;
96
	private final int KEY_UP = 38;
96
	
97
	
97
	/**
98
	/**
98
	 * Combobox permettant de selectionner le mode
99
	 * Combobox permettant de selectionner le mode
99
	 * modification ou bien création
100
	 * modification ou bien création
100
	 */
101
	 */
101
	private ComboBox selecteurMode = new ComboBox();
102
	private ComboBox selecteurMode = new ComboBox();
102
	
103
	
103
	Store storeMode = null ;
104
	Store storeMode = null ;
104
 
105
 
105
	/**
106
	/**
106
	 * Booleen d'instanciation
107
	 * Booleen d'instanciation
107
	 */
108
	 */
108
	boolean estInstancie = false ;
109
	boolean estInstancie = false ;
109
	
110
	
110
	/**
111
	/**
111
	 * Constructeur sans argument (privé car ne doit pas être utilisé)
112
	 * Constructeur sans argument (privé car ne doit pas être utilisé)
112
	 */
113
	 */
113
	@SuppressWarnings("unused")
114
	@SuppressWarnings("unused")
114
	private FormulaireSaisieObservationVue()
115
	private FormulaireSaisieObservationVue()
115
	{
116
	{
116
		super() ;
117
		super() ;
117
	}
118
	}
118
	
119
	
119
	/**
120
	/**
120
	 * Constructeur avec argument
121
	 * Constructeur avec argument
121
	 * @param im
122
	 * @param im
122
	 */
123
	 */
123
	public FormulaireSaisieObservationVue(ObservationMediateur obs)
124
	public FormulaireSaisieObservationVue(ObservationMediateur obs)
124
	{
125
	{
125
 
126
 
126
		
127
		
127
		// on associe le médiateur
128
		// on associe le médiateur
128
		observationMediateur = obs ;
129
		observationMediateur = obs ;
129
		
130
		
130
		
131
		
131
		setHeader(true);
132
		setHeader(true);
132
		
133
		
133
		FormPanel panneauFormulaire = new FormPanel(Position.RIGHT);
134
		FormPanel panneauFormulaire = new FormPanel(Position.RIGHT);
134
		panneauFormulaire.setBorder(false);
135
		panneauFormulaire.setBorder(false);
135
		
136
		
136
		// Panneau intermediaire qui contient deux colonnes de formulaire
137
		// Panneau intermediaire qui contient deux colonnes de formulaire
137
		
138
		
138
		Panel panneauIntermediaire = new Panel();  
139
		Panel panneauIntermediaire = new Panel();  
139
		panneauIntermediaire.setLayout(new ColumnLayout());  
140
		panneauIntermediaire.setLayout(new ColumnLayout());  
140
		panneauIntermediaire.setBorder(false);
141
		panneauIntermediaire.setBorder(false);
141
		   
142
		   
142
		//create first panel and add fields to it  
143
		//create first panel and add fields to it  
143
		Panel panneauPremierColonne = new Panel();  
144
		Panel panneauPremierColonne = new Panel();  
144
		panneauPremierColonne.setLayout(new FormLayout());  
145
		panneauPremierColonne.setLayout(new FormLayout());  
145
		panneauPremierColonne.setBorder(false);
146
		panneauPremierColonne.setBorder(false);
146
 
147
 
147
		//create second panel and add fields to it  
148
		//create second panel and add fields to it  
148
	    Panel panneauSecondeColonne = new Panel();  
149
	    Panel panneauSecondeColonne = new Panel();  
149
		panneauSecondeColonne.setLayout(new FormLayout());  
150
		panneauSecondeColonne.setLayout(new FormLayout());  
150
		panneauSecondeColonne.setBorder(false);
151
		panneauSecondeColonne.setBorder(false);
151
		
152
		
152
		this.setPaddings(5) ;
153
		this.setPaddings(5) ;
153
	
154
	
154
 
155
 
155
 
156
 
156
		commune=new ComboBox("Commune","commune",275 );  
157
		commune=new ComboBox("Commune","commune",275 );  
157
		
158
		
158
		
159
		
159
		final String resultTplCommune = "<div class=\"search-item-commune\">{commune}</div>";  
160
		final String resultTplCommune = "<div class=\"search-item-commune\">{commune}</div>";  
160
 
161
 
161
		
162
		
162
		commune.setTpl(resultTplCommune);
163
		commune.setTpl(resultTplCommune);
163
		commune.setMode(ComboBox.REMOTE);
164
		commune.setMode(ComboBox.REMOTE);
164
		// commune.setPageSize(10); // Ne fonctionne pas 
165
		// commune.setPageSize(10); // Ne fonctionne pas 
165
		commune.setItemSelector("div.search-item-commune");
166
		commune.setItemSelector("div.search-item-commune");
166
		commune.setTypeAhead(true);  
167
		commune.setTypeAhead(true);  
167
		commune.setLoadingText("Recherche...");  
168
		commune.setLoadingText("Recherche...");  
168
		  
169
		  
169
		commune.setHideTrigger(true);
170
		commune.setHideTrigger(true);
170
		
171
		
171
		
172
		
172
     
173
     
173
 
174
 
174
 
175
 
175
	    panneauPremierColonne.add(commune);  
176
	    panneauPremierColonne.add(commune);  
176
 
177
 
177
		
178
		
178
	    
179
	    
179
	    station = new TextField("Station", "station", 275);  
180
	    station = new TextField("Station", "station", 275);  
180
	    station.setAllowBlank(true);  
181
	    station.setAllowBlank(true);  
181
	    panneauPremierColonne.add(station);  
182
	    panneauPremierColonne.add(station);  
182
	    
183
	    
183
	    date = new DateField("Date", "date", 100);  
184
	    date = new DateField("Date", "date", 100);  
184
	    date.setAllowBlank(true);
185
	    date.setAllowBlank(true);
-
 
186
	    formatDate = "d/m/Y";
185
	    date.setFormat("d/m/Y") ;
187
	    date.setFormat(formatDate) ;
186
	    panneauPremierColonne.add(date);  
188
	    panneauPremierColonne.add(date);  
187
 
189
 
188
	 	
190
	 	
189
		espece=new ComboBox("Espèce","nom",275 );  
191
		espece=new ComboBox("Espèce","nom",275 );  
190
		
192
		
191
		
193
		
192
		final String resultTplEspece = "<div class=\"search-item-espece\">{nom}</div>";  
194
		final String resultTplEspece = "<div class=\"search-item-espece\">{nom}</div>";  
193
 
195
 
194
		
196
		
195
		espece.setTpl(resultTplEspece);
197
		espece.setTpl(resultTplEspece);
196
		espece.setMode(ComboBox.REMOTE);
198
		espece.setMode(ComboBox.REMOTE);
197
		// commune.setPageSize(10); // Ne fonctionne pas 
199
		// commune.setPageSize(10); // Ne fonctionne pas 
198
		espece.setItemSelector("div.search-item-espece");
200
		espece.setItemSelector("div.search-item-espece");
199
		espece.setTypeAhead(true);  
201
		espece.setTypeAhead(true);  
200
		espece.setLoadingText("Recherche...");  
202
		espece.setLoadingText("Recherche...");  
201
		  
203
		  
202
		espece.setHideTrigger(true);
204
		espece.setHideTrigger(true);
203
		
205
		
204
 
206
 
205
 
207
 
206
	    panneauPremierColonne.add(espece);  
208
	    panneauPremierColonne.add(espece);  
207
	    
209
	    
208
	    comment = new TextField("Notes", "comment", 275);  
210
	    comment = new TextField("Notes", "comment", 275);  
209
	    comment.setAllowBlank(true);  
211
	    comment.setAllowBlank(true);  
210
	    panneauPremierColonne.add(comment); 
212
	    panneauPremierColonne.add(comment); 
211
	    
213
	    
212
	    
214
	    
213
	    lieudit = new TextField("Lieu-dit", "lieudit", 275);  
215
	    lieudit = new TextField("Lieu-dit", "lieudit", 275);  
214
	    lieudit.setAllowBlank(true);  
216
	    lieudit.setAllowBlank(true);  
215
	    panneauSecondeColonne.add(lieudit);  
217
	    panneauSecondeColonne.add(lieudit);  
216
	       
218
	       
217
	
219
	
218
	    milieu = new TextField("Milieu", "milieu", 275);  
220
	    milieu = new TextField("Milieu", "milieu", 275);  
219
	    milieu.setAllowBlank(true);  
221
	    milieu.setAllowBlank(true);  
220
	    panneauSecondeColonne.add(milieu);  
222
	    panneauSecondeColonne.add(milieu);
-
 
223
	   
-
 
224
	    motsCles = new TextArea("Mots clés","motscles") ;
-
 
225
	    motsCles.setAllowBlank(true);
-
 
226
	    motsCles.setWidth(275);
-
 
227
	    panneauSecondeColonne.add(motsCles);
221
	   
-
 
222
	 
-
 
223
		
228
	   
224
		panneauIntermediaire.add(panneauPremierColonne, new ColumnLayoutData(.5));
229
		panneauIntermediaire.add(panneauPremierColonne, new ColumnLayoutData(.5));
225
		panneauIntermediaire.add(panneauSecondeColonne, new ColumnLayoutData(.5));
230
		panneauIntermediaire.add(panneauSecondeColonne, new ColumnLayoutData(.5));
226
		
231
		
227
		panneauFormulaire.add(panneauIntermediaire);
232
		panneauFormulaire.add(panneauIntermediaire);
228
		
233
		
229
		Object[][] mode = {{"création",false} , {"modification", true} };
234
		Object[][] mode = {{"création",false} , {"modification", true} };
230
		storeMode = new SimpleStore(new String[] { "nom_mode", "mode" },
235
		storeMode = new SimpleStore(new String[] { "nom_mode", "mode" },
231
				mode);
236
				mode);
232
		storeMode.load();
237
		storeMode.load();
233
		selecteurMode.setStore(storeMode);
238
		selecteurMode.setStore(storeMode);
234
		selecteurMode.setDisplayField("nom_mode") ;
239
		selecteurMode.setDisplayField("nom_mode") ;
235
		selecteurMode.setLabel("mode ") ;
240
		selecteurMode.setLabel("mode ") ;
236
		selecteurMode.setForceSelection(true) ;
241
		selecteurMode.setForceSelection(true) ;
237
		selecteurMode.setValue("création") ;
242
		selecteurMode.setValue("création") ;
238
		selecteurMode.setEditable(false) ;
243
		selecteurMode.setEditable(false) ;
239
		selecteurMode.setCls("x-selec-crea") ;
244
		selecteurMode.setCls("x-selec-crea") ;
240
		
245
		
241
		bt = new Toolbar() ;
246
		bt = new Toolbar() ;
242
		bt.addSpacer() ;
247
		bt.addSpacer() ;
243
		bt.addText("Mode de saisie ") ;
248
		bt.addText("Mode de saisie ") ;
244
		bt.addField(selecteurMode) ;
249
		bt.addField(selecteurMode) ;
245
		
250
		
246
		
251
		
247
		
252
		
248
		
253
		
249
		panneauFormulaire.addButton(boutonOK);
254
		panneauFormulaire.addButton(boutonOK);
250
		    
255
		    
251
		panneauFormulaire.addButton(boutonAnnuler);
256
		panneauFormulaire.addButton(boutonAnnuler);
252
		
257
		
253
		selecteurMode.addListener(new ComboBoxListenerAdapter() {
258
		selecteurMode.addListener(new ComboBoxListenerAdapter() {
254
 
259
 
255
			public void onSelect(ComboBox comboBox, Record record, int index) {
260
			public void onSelect(ComboBox comboBox, Record record, int index) {
256
				
261
				
257
				// et on met la valeur à jour dans la combobox
262
				// et on met la valeur à jour dans la combobox
258
				comboBox.setValue(record.getAsString("nom_mode"));
263
				comboBox.setValue(record.getAsString("nom_mode"));
259
				setModification(record.getAsString("mode")) ;
264
				setModification(record.getAsString("mode")) ;
260
			}
265
			}
261
 
266
 
262
		});
267
		});
263
	
268
	
264
		this.add(panneauFormulaire) ;
269
		this.add(panneauFormulaire) ;
265
		this.setTopToolbar(bt) ;
270
		this.setTopToolbar(bt) ;
266
		
271
		
267
		
272
		
268
		this.setAutoHeight(true);
273
		this.setAutoHeight(true);
269
	
274
	
270
	
275
	
271
		// on ajoute les listeners
276
		// on ajoute les listeners
272
		ajouterListeners() ;
277
		ajouterListeners() ;
273
		
278
		
274
		
279
		
275
 
280
 
276
	}
281
	}
277
	
282
	
278
	private void ajouterListeners()
283
	private void ajouterListeners()
279
	{	
284
	{	
280
		// Listener completion communne 
285
		// Listener completion communne 
281
		
286
		
282
		   commune.addListener(new ComboBoxListenerAdapter() {  
287
		   commune.addListener(new ComboBoxListenerAdapter() {  
283
	             public void onSelect(ComboBox comboBox, Record record, int index) {  
288
	             public void onSelect(ComboBox comboBox, Record record, int index) {  
284
	                 commune.setValue(record.getAsString("commune"));
289
	                 commune.setValue(record.getAsString("commune"));
285
	                 departement=record.getAsString("departement");
290
	                 departement=record.getAsString("departement");
286
	                 selectionCommune=true;
291
	                 selectionCommune=true;
287
	             }  
292
	             }  
288
	         });  
293
	         });  
289
	         
294
	         
290
	        
295
	        
291
			ListenerConfig listenerConfigCommune=new ListenerConfig();
296
			ListenerConfig listenerConfigCommune=new ListenerConfig();
292
			listenerConfigCommune.setDelay(10);
297
			listenerConfigCommune.setDelay(10);
293
			listenerConfigCommune.setStopPropagation(false);
298
			listenerConfigCommune.setStopPropagation(false);
294
			listenerConfigCommune.setStopEvent(false);
299
			listenerConfigCommune.setStopEvent(false);
295
			
300
			
296
 
301
 
297
		
302
		
298
		    commune.addKeyPressListener(new EventCallback()	{
303
		    commune.addKeyPressListener(new EventCallback()	{
299
		    	
304
		    	
300
		    	    public void execute(EventObject e) {
305
		    	    public void execute(EventObject e) {
301
		    	    	
306
		    	    	
302
		    	    		  
307
		    	    		  
303
		    	    		  switch(e.getKey()) {
308
		    	    		  switch(e.getKey()) {
304
		    	    	      	    		  
309
		    	    	      	    		  
305
		    	    		  
310
		    	    		  
306
		    	    		  case KEY_ALT:
311
		    	    		  case KEY_ALT:
307
		    	    	      case KEY_CTRL:
312
		    	    	      case KEY_CTRL:
308
		    	    	      case KEY_DOWN:
313
		    	    	      case KEY_DOWN:
309
		    	    	      case KEY_END:
314
		    	    	      case KEY_END:
310
		    	    	      case KEY_ESCAPE:
315
		    	    	      case KEY_ESCAPE:
311
		    	    	      case KEY_HOME:
316
		    	    	      case KEY_HOME:
312
		    	    	      case KEY_LEFT:
317
		    	    	      case KEY_LEFT:
313
		    	    	      case KEY_PAGEDOWN:
318
		    	    	      case KEY_PAGEDOWN:
314
		    	    	      case KEY_PAGEUP:
319
		    	    	      case KEY_PAGEUP:
315
		    	    	      case KEY_RIGHT:
320
		    	    	      case KEY_RIGHT:
316
		    	    	      case KEY_SHIFT:
321
		    	    	      case KEY_SHIFT:
317
		    	    	      case KEY_TAB:
322
		    	    	      case KEY_TAB:
318
		    	    	      case KEY_UP:
323
		    	    	      case KEY_UP:
319
		    	    	    	
324
		    	    	    	
320
		    	    	        break;
325
		    	    	        break;
321
		    	    	      
326
		    	    	      
322
		    	    	      case KEY_ENTER:
327
		    	    	      case KEY_ENTER:
323
		    	    	    	  
328
		    	    	    	  
324
		    	    	    	 if (selectionCommune) {
329
		    	    	    	 if (selectionCommune) {
325
		    	    	    		 selectionCommune=false;
330
		    	    	    		 selectionCommune=false;
326
		    	    	    	 }
331
		    	    	    	 }
327
		    	    	    	 else {
332
		    	    	    	 else {
328
		    	    	    		// lancer mise a jour 	    	    	    		 
333
		    	    	    		// lancer mise a jour 	    	    	    		 
329
		    	    	    	 }
334
		    	    	    	 }
330
		    	    	    	
335
		    	    	    	
331
		    	    	    	
336
		    	    	    	
332
		    	    	    	  break;
337
		    	    	    	  break;
333
		    	    	       
338
		    	    	       
334
		    	    	      default:
339
		    	    	      default:
335
		    	    	    	  
340
		    	    	    	  
336
		    	    	    	  departement="";
341
		    	    	    	  departement="";
337
		    	    	    	  obtenirListeReferentielCommune();
342
		    	    	    	  obtenirListeReferentielCommune();
338
		    	    	    	  	    	    	        
343
		    	    	    	  	    	    	        
339
		    	    	        break;
344
		    	    	        break;
340
		    	    	    }
345
		    	    	    }
341
 
346
 
342
		    	    	 
347
		    	    	 
343
		    	    	
348
		    	    	
344
		     		}
349
		     		}
345
		    	 
350
		    	 
346
		    		},    listenerConfigCommune
351
		    		},    listenerConfigCommune
347
		    	
352
		    	
348
			);
353
			);
349
		    
354
		    
350
			// Listener completion espece 
355
			// Listener completion espece 
351
 
356
 
352
			
357
			
353
			espece.addListener(new ComboBoxListenerAdapter() {  
358
			espece.addListener(new ComboBoxListenerAdapter() {  
354
	             public void onSelect(ComboBox comboBox, Record record, int index) {  
359
	             public void onSelect(ComboBox comboBox, Record record, int index) {  
355
	            	 espece.setValue(record.getAsString("nom"));
360
	            	 espece.setValue(record.getAsString("nom"));
356
	            	 numeroNom=record.getAsString("numeroNom");
361
	            	 numeroNom=record.getAsString("numeroNom");
357
	                 selectionEspece=true;
362
	                 selectionEspece=true;
358
	             }  
363
	             }  
359
	         });  
364
	         });  
360
	         
365
	         
361
 
366
 
362
			ListenerConfig listenerConfigEspece=new ListenerConfig();
367
			ListenerConfig listenerConfigEspece=new ListenerConfig();
363
			listenerConfigEspece.setDelay(10);
368
			listenerConfigEspece.setDelay(10);
364
			listenerConfigEspece.setStopPropagation(false);
369
			listenerConfigEspece.setStopPropagation(false);
365
			listenerConfigEspece.setStopEvent(false);			
370
			listenerConfigEspece.setStopEvent(false);			
366
 
371
 
367
		
372
		
368
			espece.addKeyPressListener(new EventCallback()	{
373
			espece.addKeyPressListener(new EventCallback()	{
369
		    	
374
		    	
370
		    	    public void execute(EventObject e) {
375
		    	    public void execute(EventObject e) {
371
		    	    	
376
		    	    	
372
		    	    		  
377
		    	    		  
373
		    	    		  switch(e.getKey()) {
378
		    	    		  switch(e.getKey()) {
374
		    	    	      	    		  
379
		    	    	      	    		  
375
		    	    		  
380
		    	    		  
376
		    	    		  case KEY_ALT:
381
		    	    		  case KEY_ALT:
377
		    	    	      case KEY_CTRL:
382
		    	    	      case KEY_CTRL:
378
		    	    	      case KEY_DOWN:
383
		    	    	      case KEY_DOWN:
379
		    	    	      case KEY_END:
384
		    	    	      case KEY_END:
380
		    	    	      case KEY_ESCAPE:
385
		    	    	      case KEY_ESCAPE:
381
		    	    	      case KEY_HOME:
386
		    	    	      case KEY_HOME:
382
		    	    	      case KEY_LEFT:
387
		    	    	      case KEY_LEFT:
383
		    	    	      case KEY_PAGEDOWN:
388
		    	    	      case KEY_PAGEDOWN:
384
		    	    	      case KEY_PAGEUP:
389
		    	    	      case KEY_PAGEUP:
385
		    	    	      case KEY_RIGHT:
390
		    	    	      case KEY_RIGHT:
386
		    	    	      case KEY_SHIFT:
391
		    	    	      case KEY_SHIFT:
387
		    	    	      case KEY_TAB:
392
		    	    	      case KEY_TAB:
388
		    	    	      case KEY_UP:
393
		    	    	      case KEY_UP:
389
		    	    	    	
394
		    	    	    	
390
		    	    	        break;
395
		    	    	        break;
391
		    	    	      
396
		    	    	      
392
		    	    	      case KEY_ENTER:
397
		    	    	      case KEY_ENTER:
393
		    	    	    	  
398
		    	    	    	  
394
		    	    	    	 if (selectionEspece) {
399
		    	    	    	 if (selectionEspece) {
395
		    	    	    		 selectionEspece=false;
400
		    	    	    		 selectionEspece=false;
396
		    	    	    	 }
401
		    	    	    	 }
397
		    	    	    	 else {
402
		    	    	    	 else {
398
		    	    	    		// lancer mise a jour 	    	    	    		 
403
		    	    	    		// lancer mise a jour 	    	    	    		 
399
		    	    	    	 }
404
		    	    	    	 }
400
		    	    	    	
405
		    	    	    	
401
		    	    	    	
406
		    	    	    	
402
		    	    	    	  break;
407
		    	    	    	  break;
403
		    	    	       
408
		    	    	       
404
		    	    	      default:
409
		    	    	      default:
405
		    	    	    	  
410
		    	    	    	  
406
		    	    	    	  numeroNom="";
411
		    	    	    	  numeroNom="";
407
		    	    	    	  obtenirListeReferentielNom();
412
		    	    	    	  obtenirListeReferentielNom();
408
		    	    	    	  	    	    	        
413
		    	    	    	  	    	    	        
409
		    	    	        break;
414
		    	    	        break;
410
		    	    	    }
415
		    	    	    }
411
 
416
 
412
		    	    	 
417
		    	    	 
413
		    	    	
418
		    	    	
414
		     		}
419
		     		}
415
		    	 
420
		    	 
416
		    		},    listenerConfigEspece
421
		    		},    listenerConfigEspece
417
		    	
422
		    	
418
			);
423
			);
419
		    
424
		    
420
 
425
 
421
		  
426
		  
422
 
427
 
423
		boutonOK.addListener(new ButtonListenerAdapter() {
428
		boutonOK.addListener(new ButtonListenerAdapter() {
424
			
429
			
425
			public void onClick(Button button, EventObject e) {
430
			public void onClick(Button button, EventObject e) {
426
				
431
				
427
				if(modification)
432
				if(modification)
428
				{
433
				{
429
					modifierObservation() ;
434
					modifierObservation() ;
430
				}
435
				}
431
				else
436
				else
432
				{
437
				{
433
					ajouterObservation();
438
					ajouterObservation();
434
				}
439
				}
435
				
440
				
436
				
441
				
437
			}
442
			}
438
			
443
			
439
		});
444
		});
440
		
445
		
441
		boutonAnnuler.addListener(new ButtonListenerAdapter() {
446
		boutonAnnuler.addListener(new ButtonListenerAdapter() {
442
			
447
			
443
			public void onClick(Button button, EventObject e) {
448
			public void onClick(Button button, EventObject e) {
444
				
449
				
445
				if(modification)
450
				if(modification)
446
				{
451
				{
447
					supprimerObservation() ;
452
					supprimerObservation() ;
448
				}
453
				}
449
				else
454
				else
450
				{
455
				{
451
					raz();
456
					raz();
452
				}
457
				}
453
				
458
				
454
				
459
				
455
			}
460
			}
456
			
461
			
457
		});
462
		});
458
	
463
	
459
	
464
	
460
	}
465
	}
461
	
466
	
462
	/**
467
	/**
463
	 * Desactive visuellement ce panneau
468
	 * Desactive visuellement ce panneau
464
	 */
469
	 */
465
	public void desactiverPanneau()
470
	public void desactiverPanneau()
466
	{
471
	{
467
		this.setDisabled(true) ;
472
		this.setDisabled(true) ;
468
	}
473
	}
469
	
474
	
470
	/**
475
	/**
471
	 * Active visuellement ce panneau
476
	 * Active visuellement ce panneau
472
	 */
477
	 */
473
	public void activerPanneau()
478
	public void activerPanneau()
474
	{
479
	{
475
		this.setDisabled(false) ;
480
		this.setDisabled(false) ;
476
	}
481
	}
477
 
482
 
478
	public void rafraichir(Object nouvelleDonnees, boolean repandreRaffraichissement) {
483
	public void rafraichir(Object nouvelleDonnees, boolean repandreRaffraichissement) {
479
		
484
		
480
		// si l'on a reçu une liste du referentiel commune (completion referentiel commune)
485
		// si l'on a reçu une liste du referentiel commune (completion referentiel commune)
481
			if(nouvelleDonnees instanceof ListeReferentielCommune)
486
			if(nouvelleDonnees instanceof ListeReferentielCommune)
482
			{
487
			{
483
				
488
				
484
					ListeReferentielCommune data = (ListeReferentielCommune) nouvelleDonnees ;
489
					ListeReferentielCommune data = (ListeReferentielCommune) nouvelleDonnees ;
485
					Object[][] communeData = new Object[data.size()][2];
490
					Object[][] communeData = new Object[data.size()][2];
486
					int i = 0 ;
491
					int i = 0 ;
487
				
492
				
488
					// on la parse et on récupère les informations quiç nous interessent
493
					// on la parse et on récupère les informations quiç nous interessent
489
					for (Iterator it = data.keySet().iterator(); it.hasNext();) 
494
					for (Iterator it = data.keySet().iterator(); it.hasNext();) 
490
					{
495
					{
491
						
496
						
492
						ReferentielCommune ref=(ReferentielCommune) data.get(it.next());
497
						ReferentielCommune ref=(ReferentielCommune) data.get(it.next());
493
						
498
						
494
						communeData[i][0]= ref.getCommune();
499
						communeData[i][0]= ref.getCommune();
495
						communeData[i][1]= ref.getDepartement();
500
						communeData[i][1]= ref.getDepartement();
496
						
501
						
497
																	
502
																	
498
						i++ ;
503
						i++ ;
499
					}
504
					}
500
					
505
					
501
					   //	  creation du store
506
					   //	  creation du store
502
					FieldDef defCommune = new StringFieldDef("commune");
507
					FieldDef defCommune = new StringFieldDef("commune");
503
					FieldDef defDepartement = new StringFieldDef("departement");
508
					FieldDef defDepartement = new StringFieldDef("departement");
504
					
509
					
505
					
510
					
506
					FieldDef[] defTab = { defCommune, defDepartement};
511
					FieldDef[] defTab = { defCommune, defDepartement};
507
					
512
					
508
					RecordDef rd = new RecordDef(defTab);
513
					RecordDef rd = new RecordDef(defTab);
509
					
514
					
510
					final MemoryProxy dataProxy = new MemoryProxy(communeData);
515
					final MemoryProxy dataProxy = new MemoryProxy(communeData);
511
					final ArrayReader reader = new ArrayReader(rd);		
516
					final ArrayReader reader = new ArrayReader(rd);		
512
					
517
					
513
					Store store=new Store(dataProxy,reader);
518
					Store store=new Store(dataProxy,reader);
514
					store.load() ;
519
					store.load() ;
515
		
520
		
516
					commune.setStore(store);					
521
					commune.setStore(store);					
517
							
522
							
518
			}
523
			}
519
			
524
			
520
			//			 si l'on a reçu une liste du référentiel nom (complétion referentiel nom)
525
			//			 si l'on a reçu une liste du référentiel nom (complétion referentiel nom)
521
			
526
			
522
			if(nouvelleDonnees instanceof ListeReferentielNom)
527
			if(nouvelleDonnees instanceof ListeReferentielNom)
523
			{
528
			{
524
				
529
				
525
					ListeReferentielNom data = (ListeReferentielNom) nouvelleDonnees ;
530
					ListeReferentielNom data = (ListeReferentielNom) nouvelleDonnees ;
526
					Object[][] nomData = new Object[data.size()][2];
531
					Object[][] nomData = new Object[data.size()][2];
527
					int i = 0 ;
532
					int i = 0 ;
528
				
533
				
529
					// on la parse et on récupère les informations quiç nous interessent
534
					// on la parse et on récupère les informations quiç nous interessent
530
					for (Iterator it = data.keySet().iterator(); it.hasNext();) 
535
					for (Iterator it = data.keySet().iterator(); it.hasNext();) 
531
					{
536
					{
532
						
537
						
533
						ReferentielNom ref=(ReferentielNom) data.get(it.next());
538
						ReferentielNom ref=(ReferentielNom) data.get(it.next());
534
						
539
						
535
						nomData[i][0]= ref.getNom();
540
						nomData[i][0]= ref.getNom();
536
						nomData[i][1]= ref.getNumeroNom();
541
						nomData[i][1]= ref.getNumeroNom();
537
						
542
						
538
																	
543
																	
539
						i++ ;
544
						i++ ;
540
					}
545
					}
541
					
546
					
542
					   //	  creation du store
547
					   //	  creation du store
543
					FieldDef defNom = new StringFieldDef("nom");
548
					FieldDef defNom = new StringFieldDef("nom");
544
					FieldDef defNumeroNom = new StringFieldDef("numeroNom");
549
					FieldDef defNumeroNom = new StringFieldDef("numeroNom");
545
					
550
					
546
					
551
					
547
					FieldDef[] defTab = { defNom, defNumeroNom};
552
					FieldDef[] defTab = { defNom, defNumeroNom};
548
					
553
					
549
					RecordDef rd = new RecordDef(defTab);
554
					RecordDef rd = new RecordDef(defTab);
550
					
555
					
551
					final MemoryProxy dataProxy = new MemoryProxy(nomData);
556
					final MemoryProxy dataProxy = new MemoryProxy(nomData);
552
					final ArrayReader reader = new ArrayReader(rd);		
557
					final ArrayReader reader = new ArrayReader(rd);		
553
					
558
					
554
					Store store=new Store(dataProxy,reader);
559
					Store store=new Store(dataProxy,reader);
555
					store.load() ;
560
					store.load() ;
556
		
561
		
557
					espece.setStore(store);
562
					espece.setStore(store);
558
				
563
				
559
					
564
					
560
							
565
							
561
			}
566
			}
562
			
567
			
563
			// On recoit une observation dont on veut afficher le detail 
568
			// On recoit une observation dont on veut afficher le detail 
564
			
569
			
565
			if(nouvelleDonnees instanceof Observation)
570
			if(nouvelleDonnees instanceof Observation)
566
			{
571
			{
567
				Observation obs = (Observation)nouvelleDonnees ;
572
				Observation obs = (Observation)nouvelleDonnees ;
568
				afficherDetailsObservation(obs) ;
573
				afficherDetailsObservation(obs) ;
569
			}
574
			}
570
			
575
			
571
			// Sur Mise à jour ou suppression d'une suppression ?
576
			// Sur Mise à jour ou suppression d'une suppression ?
572
			
577
			
573
			if(nouvelleDonnees instanceof String)
578
			if(nouvelleDonnees instanceof String)
574
			{
579
			{
575
				String str = (String)nouvelleDonnees ;
580
				String str = (String)nouvelleDonnees ;
576
				observationMediateur.obtenirNombreObservation() ;
581
				observationMediateur.obtenirNombreObservation() ;
577
			}
582
			}
578
 
583
 
579
	}
584
	}
580
	
585
	
581
 
586
 
582
	public void obtenirListeReferentielCommune() {
587
	public void obtenirListeReferentielCommune() {
583
		
588
		
584
	 String com=commune.getText().replaceAll(" ","/");
589
	 String com=commune.getText().replaceAll(" ","/");
585
	 com=com.replaceAll("%","");
590
	 com=com.replaceAll("%","");
586
		  
591
		  
587
	 observationMediateur.obtenirListeReferentielCommune(this,com);
592
	 observationMediateur.obtenirListeReferentielCommune(this,com);
588
	 
593
	 
589
	}
594
	}
590
	
595
	
591
 
596
 
592
	public void obtenirListeReferentielNom() {
597
	public void obtenirListeReferentielNom() {
593
	 
598
	 
594
	  String esp=espece.getText().replaceAll(" ","/");
599
	  String esp=espece.getText().replaceAll(" ","/");
595
	  esp=esp.replaceAll("%","");
600
	  esp=esp.replaceAll("%","");
596
		
601
		
597
	  observationMediateur.obtenirListeReferentielNom(this,esp);
602
	  observationMediateur.obtenirListeReferentielNom(this,esp);
598
	 
603
	 
599
	}
604
	}
600
   
605
   
601
 
606
 
602
	public void ajouterObservation() {
607
	public void ajouterObservation() {
603
 
608
 
604
		Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getRawValue());	
609
		Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getRawValue(),motsCles.getValueAsString());	
605
		observationMediateur.ajouterObservation(obs);
610
		observationMediateur.ajouterObservation(obs);
606
	}
611
	}
607
	
612
	
608
	private void modifierObservation() {
613
	private void modifierObservation() {
609
		
614
		
610
		Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getText());
615
		Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),date.getText(),motsCles.getValueAsString());
611
		obs.setNumeroOrdre(numeroOrdre);
616
		obs.setNumeroOrdre(numeroOrdre);
612
		observationMediateur.modifierObservation(obs);
617
		observationMediateur.modifierObservation(obs);
613
		
618
		
614
	}
619
	}
615
	
620
	
616
	private void supprimerObservation() {
621
	private void supprimerObservation() {
617
		
622
		
618
			observationMediateur.supprimerObservation(this, numeroOrdre);
623
			observationMediateur.supprimerObservation(this, numeroOrdre);
619
	}
624
	}
620
 
625
 
621
	
626
	
622
	public void afficherDetailsObservation(Observation obs)
627
	public void afficherDetailsObservation(Observation obs)
623
	{
628
	{
624
		raz() ;
629
		raz() ;
625
		
630
		
626
		if(!obs.getDate().equals("null") && !obs.getDate().equals("000null")) {
631
		if(!obs.getDate().equals("null") && !obs.getDate().equals("000null")) {
627
			String[] dateEtHeure = obs.getDate().split(" ", 2);
632
			String[] dateEtHeure = obs.getDate().split(" ", 2);
-
 
633
			if(verifierFormatDate(dateEtHeure[0])) {
628
			date.setValue(dateEtHeure[0]) ;
634
				date.setValue(dateEtHeure[0]) ;
-
 
635
			}
-
 
636
			else
-
 
637
			{
-
 
638
				date.setRawValue(""); 
-
 
639
			}
629
		}
640
		}
630
		if(!obs.getLieudit().equals("null") && !obs.getLieudit().equals("000null")) {
641
		if(!obs.getLieudit().equals("null") && !obs.getLieudit().equals("000null")) {
631
			lieudit.setValue(obs.getLieudit()) ;
642
			lieudit.setValue(obs.getLieudit()) ;
632
		}
643
		}
633
		if(!obs.getStation().equals("null") && !obs.getStation().equals("000null")) {
644
		if(!obs.getStation().equals("null") && !obs.getStation().equals("000null")) {
634
			station.setValue(obs.getStation()) ;
645
			station.setValue(obs.getStation()) ;
635
		}
646
		}
636
		if(!obs.getMilieu().equals("null") && !obs.getMilieu().equals("000null")) {
647
		if(!obs.getMilieu().equals("null") && !obs.getMilieu().equals("000null")) {
637
			milieu.setValue(obs.getMilieu()) ;
648
			milieu.setValue(obs.getMilieu()) ;
638
		}
649
		}
639
		if(!obs.getCommentaire().equals("null") && !obs.getCommentaire().equals("000null")) {
650
		if(!obs.getCommentaire().equals("null") && !obs.getCommentaire().equals("000null")) {
640
			comment.setValue(obs.getCommentaire()) ;
651
			comment.setValue(obs.getCommentaire()) ;
641
		}
652
		}
642
		if(!obs.getLocalite().equals("null") && !obs.getLocalite().equals("000null")) {
653
		if(!obs.getLocalite().equals("null") && !obs.getLocalite().equals("000null")) {
643
			commune.setValue(obs.getLocalite()) ;
654
			commune.setValue(obs.getLocalite()) ;
644
		}
655
		}
645
		if(!obs.getIdentifiantLocalite().equals("null") && !obs.getIdentifiantLocalite().equals("000null")) {
656
		if(!obs.getIdentifiantLocalite().equals("null") && !obs.getIdentifiantLocalite().equals("000null")) {
646
			departement = obs.getIdentifiantLocalite();
657
			departement = obs.getIdentifiantLocalite();
647
		}
658
		}
648
		if(!obs.getNomSaisi().equals("null") && !obs.getNomSaisi().equals("000null")) {
659
		if(!obs.getNomSaisi().equals("null") && !obs.getNomSaisi().equals("000null")) {
649
			espece.setValue(obs.getNomSaisi()) ;
660
			espece.setValue(obs.getNomSaisi()) ;
650
		}
661
		}
651
		if(!obs.getNumeroNomenclaturalSaisi().equals("null") && !obs.getNumeroNomenclaturalSaisi().equals("000null")) {
662
		if(!obs.getNumeroNomenclaturalSaisi().equals("null") && !obs.getNumeroNomenclaturalSaisi().equals("000null")) {
652
			numeroNom = obs.getNumeroNomenclaturalSaisi() ;
663
			numeroNom = obs.getNumeroNomenclaturalSaisi() ;
653
		}
664
		}
654
		if(!obs.getNumeroOrdre().equals("null") && !obs.getNumeroOrdre().equals("000nu2ll")) {
665
		if(!obs.getNumeroOrdre().equals("null") && !obs.getNumeroOrdre().equals("000nu2ll")) {
655
			numeroOrdre = obs.getNumeroOrdre() ;
666
			numeroOrdre = obs.getNumeroOrdre() ;
656
		}
667
		}
-
 
668
		if(!obs.getMotsCles().equals("null") && !obs.getMotsCles().equals("000null")) {
-
 
669
			motsCles.setValue(obs.getMotsCles());
-
 
670
		}
657
		
671
		
658
	}
672
	}
659
	
673
	
660
	public void raz()
674
	public void raz()
661
	{
675
	{
662
 
676
 
663
		date.reset() ;
677
		date.reset() ;
664
		lieudit.reset() ;
678
		lieudit.reset() ;
665
		station.reset() ;
679
		station.reset() ;
666
		milieu.reset();
680
		milieu.reset();
667
		comment.reset();
681
		comment.reset();
668
		commune.reset();
682
		commune.reset();
-
 
683
		motsCles.reset();
669
		departement = "";
684
		departement = "";
670
		espece.reset();
685
		espece.reset();
671
		numeroNom = "" ;
686
		numeroNom = "" ;
672
		numeroOrdre = "";
687
		numeroOrdre = "";
673
		
688
		
674
	}
689
	}
675
	
690
	
676
	private void setModification(String mode)
691
	private void setModification(String mode)
677
	{
692
	{
678
		if(mode.equals("true")) {
693
		if(mode.equals("true")) {
679
 
694
 
680
			boutonOK.setText("Modifier") ;
695
			boutonOK.setText("Modifier") ;
681
			setTitle("Modification") ;
696
			setTitle("Modification") ;
682
			boutonAnnuler.setText("Supprimer") ;
697
			boutonAnnuler.setText("Supprimer") ;
683
			modification = true ;
698
			modification = true ;
684
			selecteurMode.removeClass("x-selec-crea") ;
699
			selecteurMode.removeClass("x-selec-crea") ;
685
			selecteurMode.setCls("x-selec-modif") ;
700
			selecteurMode.setCls("x-selec-modif") ;
686
			
701
			
687
		}
702
		}
688
		else
703
		else
689
		{
704
		{
690
 
705
 
691
			boutonOK.setText("Créer") ;
706
			boutonOK.setText("Créer") ;
692
			setTitle("Saisir") ;
707
			setTitle("Saisir") ;
693
			boutonAnnuler.setText("Réinitialiser") ;
708
			boutonAnnuler.setText("Réinitialiser") ;
694
			modification = false ;
709
			modification = false ;
695
			selecteurMode.removeClass("x-selec-modif") ;
710
			selecteurMode.removeClass("x-selec-modif") ;
696
			selecteurMode.setCls("x-selec-crea") ;
711
			selecteurMode.setCls("x-selec-crea") ;
697
			
712
			
698
		}
713
		}
699
		
714
		
700
	}
715
	}
701
	
716
	
702
	
717
	
703
	/**
718
	/**
704
	 * renvoie vrai si on est en mode modification, faux si on est en mode création
719
	 * renvoie vrai si on est en mode modification, faux si on est en mode création
705
	 * @return
720
	 * @return
706
	 */
721
	 */
707
	public boolean getModification()
722
	public boolean getModification()
708
	{
723
	{
709
		return modification ;
724
		return modification ;
710
	}
725
	}
-
 
726
	
-
 
727
	public boolean verifierFormatDate(String date) {
-
 
728
		
-
 
729
		String regex = "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" ;
-
 
730
		if(date.matches(regex) && !date.equals("0000-00-00")) {
-
 
731
			return true ;
-
 
732
		}
-
 
733
		else {
-
 
734
			return false;
-
 
735
		}
-
 
736
	}
711
 
737
 
712
}
738
}