Subversion Repositories eFlore/Archives.cel-v1

Rev

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

Rev 11 Rev 12
1
/*
1
/*
2
 * Copyright 2006 Google Inc.
2
 * Copyright 2006 Google Inc.
3
 * 
3
 * 
4
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
4
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5
 * use this file except in compliance with the License. You may obtain a copy of
5
 * use this file except in compliance with the License. You may obtain a copy of
6
 * the License at
6
 * the License at
7
 * 
7
 * 
8
 * http://www.apache.org/licenses/LICENSE-2.0
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 * 
9
 * 
10
 * Unless required by applicable law or agreed to in writing, software
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
 * License for the specific language governing permissions and limitations under
13
 * License for the specific language governing permissions and limitations under
14
 * the License.
14
 * the License.
15
 */
15
 */
16
package org.tela_botanica.client;
16
package org.tela_botanica.client;
17
 
17
 
18
import java.util.Iterator;
18
import java.util.Iterator;
19
import java.util.Vector;
19
import java.util.Vector;
20
 
20
 
21
import com.google.gwt.json.client.JSONArray;
21
import com.google.gwt.json.client.JSONArray;
22
import com.google.gwt.json.client.JSONNumber;
22
import com.google.gwt.json.client.JSONNumber;
23
import com.google.gwt.json.client.JSONParser;
23
import com.google.gwt.json.client.JSONParser;
24
import com.google.gwt.json.client.JSONString;
24
import com.google.gwt.json.client.JSONString;
25
import com.google.gwt.json.client.JSONValue;
25
import com.google.gwt.json.client.JSONValue;
26
import com.google.gwt.user.client.HTTPRequest;
26
import com.google.gwt.user.client.HTTPRequest;
27
import com.google.gwt.user.client.ResponseTextHandler;
27
import com.google.gwt.user.client.ResponseTextHandler;
28
import com.google.gwt.user.client.ui.Composite;
28
import com.google.gwt.user.client.ui.Composite;
29
import com.google.gwt.user.client.ui.FlexTable;
29
import com.google.gwt.user.client.ui.FlexTable;
30
import com.google.gwt.user.client.ui.Grid;
30
import com.google.gwt.user.client.ui.Grid;
31
import com.google.gwt.user.client.ui.HTML;
31
import com.google.gwt.user.client.ui.HTML;
32
import com.google.gwt.user.client.ui.HorizontalPanel;
32
import com.google.gwt.user.client.ui.HorizontalPanel;
33
import com.google.gwt.user.client.ui.VerticalPanel;
33
import com.google.gwt.user.client.ui.VerticalPanel;
34
import com.google.gwt.user.client.ui.DockPanel;
34
import com.google.gwt.user.client.ui.DockPanel;
35
import com.google.gwt.user.client.ui.Button;
35
import com.google.gwt.user.client.ui.Button;
36
import com.google.gwt.user.client.ui.CheckBox;
36
import com.google.gwt.user.client.ui.CheckBox;
37
import com.google.gwt.user.client.ui.Widget;
37
import com.google.gwt.user.client.ui.Widget;
38
import com.google.gwt.user.client.ui.ClickListener;
38
import com.google.gwt.user.client.ui.ClickListener;
39
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
39
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
40
import com.google.gwt.user.client.ui.HasVerticalAlignment;
40
import com.google.gwt.user.client.ui.HasVerticalAlignment;
41
import com.google.gwt.user.client.ui.Label;
41
import com.google.gwt.user.client.ui.Label;
42
 
42
 
43
/*
43
/*
44
 * Le retour de getUser appelle updateCount qui appelle update pour veiller à une
44
 * Le retour de getUser appelle updateCount qui appelle update pour veiller à une
45
 * initialisation correcte
45
 * initialisation correcte
46
 * 
46
 * 
47
 */
47
 */
48
 
48
 
49
public class InventoryItemList extends Composite implements
49
public class InventoryItemList extends Composite implements
50
		AutoCompleteAsyncTextBoxListener {
50
		AutoCompleteAsyncTextBoxListener {
51
 
51
 
52
	// Barre de navigation
52
	// Barre de navigation
53
 
53
 
54
	private class NavBar extends Composite implements ClickListener {
54
	private class NavBar extends Composite implements ClickListener {
55
 
55
 
56
		public final DockPanel bar = new DockPanel();
56
		public final DockPanel bar = new DockPanel();
57
 
57
 
58
		public final Button gotoFirst = new Button("<<", this);
58
		public final Button gotoFirst = new Button("<<", this);
59
 
59
 
60
		public final Button gotoNext = new Button(">", this);
60
		public final Button gotoNext = new Button(">", this);
61
 
61
 
62
		public final Button gotoPrev = new Button("<", this);
62
		public final Button gotoPrev = new Button("<", this);
63
 
63
 
64
		public final Button gotoEnd = new Button(">>", this);
64
		public final Button gotoEnd = new Button(">>", this);
-
 
65
		
65
 
66
		 
66
		public final HTML status = new HTML();
67
		public final HTML status = new HTML();
67
		
68
		
68
 
69
 
69
		public NavBar() {
70
		public NavBar() {
-
 
71
			
-
 
72
			
70
			initWidget(bar);
73
			initWidget(bar);
71
			bar.setStyleName("navbar");
74
			bar.setStyleName("navbar");
72
			status.setStyleName("status");
75
			status.setStyleName("status");
73
			
76
			
74
			HorizontalPanel buttons = new HorizontalPanel();
77
			HorizontalPanel buttons = new HorizontalPanel();
75
			
78
			
76
			buttons.add(status);
79
			buttons.add(status);
77
			buttons.setCellHorizontalAlignment(status,
80
			buttons.setCellHorizontalAlignment(status,
78
					HasHorizontalAlignment.ALIGN_RIGHT);
81
					HasHorizontalAlignment.ALIGN_RIGHT);
79
			buttons.setCellVerticalAlignment(status,
82
			buttons.setCellVerticalAlignment(status,
80
					HasVerticalAlignment.ALIGN_MIDDLE);
83
					HasVerticalAlignment.ALIGN_MIDDLE);
81
			buttons.setCellWidth(status, "100%");
84
			buttons.setCellWidth(status, "100%");
82
 
85
 
83
 
86
 
84
			buttons.add(gotoFirst);
87
			buttons.add(gotoFirst);
85
			buttons.add(gotoPrev);
88
			buttons.add(gotoPrev);
86
			buttons.add(gotoNext);
89
			buttons.add(gotoNext);
87
			buttons.add(gotoEnd);
90
			buttons.add(gotoEnd);
88
			bar.add(buttons, DockPanel.EAST);
91
			bar.add(buttons, DockPanel.EAST);
89
			bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_RIGHT);
92
			bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_RIGHT);
90
			
93
			
91
			
94
			
92
			bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_LEFT);
95
			bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_LEFT);
93
 
96
 
94
			bar.setVerticalAlignment(DockPanel.ALIGN_MIDDLE);
97
			bar.setVerticalAlignment(DockPanel.ALIGN_MIDDLE);
95
			
98
			
96
			
99
			
97
			
100
			
98
			VerticalPanel actions = new VerticalPanel();
101
			VerticalPanel actions = new VerticalPanel();
-
 
102
			
99
			
103
			
-
 
104
			HorizontalPanel actionButton = new HorizontalPanel();
-
 
105
			
-
 
106
			HTML addButton = new HTML("Nouvelle observation");
-
 
107
			addButton.setStyleName("html_button");
-
 
108
		    addButton.addClickListener(
-
 
109
		    
-
 
110
		    		new ClickListener() {
-
 
111
		    			
-
 
112
		    			public void onClick(Widget w) {
-
 
113
		    				 openEntryPanel();
-
 
114
		    			}
-
 
115
		    			
-
 
116
		    		}
-
 
117
		    
-
 
118
		    
-
 
119
		    );
-
 
120
 
-
 
121
			
100
			HorizontalPanel actionButton = new HorizontalPanel();
122
		    actionButton.add(addButton);
101
			
123
			
102
			HTML delButton=new HTML("Suppression");
124
			HTML delButton=new HTML("Suppression");
103
			delButton.setStyleName("html_button");
125
			delButton.setStyleName("html_button");
104
			delButton.addClickListener(
126
			delButton.addClickListener(
105
			    	new ClickListener() {
127
			    	new ClickListener() {
106
			    		public void onClick(Widget sender) {
128
			    		public void onClick(Widget sender) {
107
			    			mediator.getInventoryItemList().deleteElement();
129
			    			mediator.getInventoryItemList().deleteElement();
108
			    		}
130
			    		}
109
			     	}
131
			     	}
110
			);		
132
			);		
111
			
133
			
112
			actionButton.add(delButton);
134
			actionButton.add(delButton);
113
		
135
		
114
			HTML exportButton=new HTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" +mediator.getUser()+"\">"+"Tout exporter</a>");
136
			HTML exportButton=new HTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" +mediator.getUser()+"\">"+"Tout exporter</a>");
115
			actionButton.add(exportButton);
137
			actionButton.add(exportButton);
116
			exportButton.setStyleName("html_button");
138
			exportButton.setStyleName("html_button");
117
 
139
 
118
			actionButton.setSpacing(5);
140
			actionButton.setSpacing(5);
119
 
141
 
120
			actions.add(actionButton);
142
			actions.add(actionButton);
-
 
143
 
-
 
144
			
-
 
145
			HorizontalPanel selections = new HorizontalPanel();
-
 
146
			
-
 
147
			selections.setSpacing(3);
-
 
148
			
-
 
149
 
-
 
150
			selections.add(new HTML("S&eacute;lection : "));
-
 
151
			
-
 
152
			Label allLabel = new Label("Tous");
-
 
153
			Label separatorLabel = new Label(",");
-
 
154
			Label noneLabel = new Label("Aucun");
-
 
155
			
-
 
156
			allLabel.setStyleName("selection_label");
-
 
157
			noneLabel.setStyleName("selection_label");
-
 
158
			
-
 
159
			selections.add(allLabel);
-
 
160
			allLabel.addClickListener(
-
 
161
				    	new ClickListener() {
-
 
162
				    		public void onClick(Widget sender) {
-
 
163
				    			selectAll();
-
 
164
				    		}
-
 
165
				     	}
-
 
166
			);		
-
 
167
			
-
 
168
			selections.add(separatorLabel);
-
 
169
			
-
 
170
			selections.add(noneLabel);
-
 
171
			noneLabel.addClickListener(
-
 
172
				    	new ClickListener() {
-
 
173
				    		public void onClick(Widget sender) {
-
 
174
				    			deselectAll();
-
 
175
				    		}
-
 
176
				     	}
-
 
177
			);		
-
 
178
			
-
 
179
 
-
 
180
			actionButton.add(selections);
-
 
181
			
-
 
182
 
121
 
183
			
122
 
184
 
123
			bar.add(actions, DockPanel.WEST);
185
			bar.add(actions, DockPanel.WEST);
124
 
186
 
-
 
187
			
125
			
188
		
126
			
189
			
127
			
190
			
128
		}
191
		}
-
 
192
		
-
 
193
		  
-
 
194
		private void openEntryPanel() {
-
 
195
 
-
 
196
		             mediator.onEntryClick();
-
 
197
 
-
 
198
		}
-
 
199
 
-
 
200
		
129
 
201
 
130
		public void onClick(Widget sender) {
202
		public void onClick(Widget sender) {
131
			if (sender == gotoNext) {
203
			if (sender == gotoNext) {
132
				// Move forward a page.
204
				// Move forward a page.
133
				startIndex += VISIBLE_TAXON_COUNT;
205
				startIndex += VISIBLE_TAXON_COUNT;
134
				if (startIndex >= count)
206
				if (startIndex >= count)
135
					startIndex -= VISIBLE_TAXON_COUNT;
207
					startIndex -= VISIBLE_TAXON_COUNT;
136
			} else {
208
			} else {
137
				if (sender == gotoPrev) {
209
				if (sender == gotoPrev) {
138
					// Move back a page.
210
					// Move back a page.
139
					startIndex -= VISIBLE_TAXON_COUNT;
211
					startIndex -= VISIBLE_TAXON_COUNT;
140
					if (startIndex < 0)
212
					if (startIndex < 0)
141
						startIndex = 0;
213
						startIndex = 0;
142
				} else {
214
				} else {
143
					if (sender == gotoEnd) {
215
					if (sender == gotoEnd) {
144
						gotoEnd();
216
						gotoEnd();
145
					} else {
217
					} else {
146
						if (sender == gotoFirst) {
218
						if (sender == gotoFirst) {
147
							startIndex = 0;
219
							startIndex = 0;
148
						}
220
						}
149
					}
221
					}
150
				}
222
				}
151
			}
223
			}
152
			update();
224
			update();
153
		}
225
		}
154
 
226
 
155
	}
227
	}
156
 
228
 
157
	private void setStatusText(String text) {
229
	private void setStatusText(String text) {
158
		navBar.status.setText(text);
230
		navBar.status.setText(text);
159
	}
231
	}
160
 
232
 
161
	private static final int VISIBLE_TAXON_COUNT = 15;
233
	private static final int VISIBLE_TAXON_COUNT = 15;
162
 
234
 
163
	private Grid header = new Grid(1, 7);
235
	private Grid header = new Grid(1, 7);
164
 
236
 
165
	private FlexTable table = new FlexTable();
237
	private FlexTable table = new FlexTable();
166
 
238
 
167
	private VerticalPanel panel = new VerticalPanel();
239
	private VerticalPanel panel = new VerticalPanel();
168
 
240
 
169
	private int startIndex = 0;
241
	private int startIndex = 0;
170
 
242
 
171
	private String serviceBaseUrl = null;
243
	private String serviceBaseUrl = null;
172
 
244
 
173
	private int count = 65000;
245
	private int count = 65000;
174
 
246
 
175
	private String user;
247
	private String user;
176
 
248
 
177
	private NavBar navBar=null;
249
	private NavBar navBar=null;
178
	
250
	
179
	private Mediator mediator = null;
251
	private Mediator mediator = null;
180
	
-
 
181
	// Optimization
-
 
182
	int sizeChecked=0;
-
 
183
	int itemDeleted=0;
-
 
184
	
-
 
185
	
-
 
186
	// Données alimentant la saisie : texte et valeur localité, texte et valeur communes
-
 
187
	
-
 
188
 	private String nameText=null;
-
 
189
 	private String nameValue=null;
-
 
190
 	private String locationText=null;
-
 
191
 	private String locationValue=null;
-
 
192
 
-
 
193
 	// 
-
 
194
 	
252
 
-
 
253
	private String location = "all";
195
	private String location = "all";
254
	private String date = "all";
196
	
255
	
197
	public InventoryItemList(Mediator med) {
256
	public InventoryItemList(Mediator med) {
198
 
257
 
199
		mediator=med;
258
		mediator=med;
200
		
259
		
201
	    mediator.registerInventoryItemList(this);
260
	    mediator.registerInventoryItemList(this);
202
		
261
		
203
		user=mediator.getUser();
262
		user=mediator.getUser();
204
	    serviceBaseUrl = mediator.getServiceBaseUrl();
263
	    serviceBaseUrl = mediator.getServiceBaseUrl();
205
	
264
	
206
		navBar = new NavBar();
265
		navBar = new NavBar();
207
		
266
		
208
 
267
 
209
		// Information complementaire : un tableau associe au retour de
268
		// Information complementaire : un tableau associe au retour de
210
		// l'assistant de saisie
269
		// l'assistant de saisie
211
 
270
 
212
		// Mise en forme du header
271
		// Mise en forme du header
213
 
272
 
214
		header.setCellSpacing(0);
273
		header.setCellSpacing(0);
215
		header.setCellPadding(2);
274
		header.setCellPadding(2);
216
		header.setWidth("100%");
275
		header.setWidth("100%");
217
 
276
 
218
		header.setStyleName("taxon-ListHeader");
277
		header.setStyleName("inventoryItem-ListHeader");
219
 
278
 
220
		header.setText(0, 0, "");
279
		header.setText(0, 0, "");
221
		header.setText(0, 1, "Nom saisi");
280
		header.setHTML(0, 1, "Plante observ&eacute;e");
222
		header.setText(0, 2, "Nom retenu");
281
		header.setHTML(0, 2, "R&eacute;f&eacute;rence retenue");
223
		header.setHTML(0, 3, "Code<br>Nomenclatural");
282
		header.setHTML(0, 3, "R&eacute;f&eacute;rence<br>Nomenclaturale");
224
		header.setHTML(0, 4, "Code<br>Taxonomique");
283
		header.setHTML(0, 4, "R&eacute;f&eacute;rence<br>Taxonomique");
225
		header.setText(0, 5, "Famille");
284
		header.setText(0, 5, "Famille");
226
		header.setText(0, 6, "Localisation");
285
		header.setText(0, 6, "Commune");
227
 
286
 
228
		header.getCellFormatter().setWidth(0, 0, "2%");
287
		header.getCellFormatter().setWidth(0, 0, "2%");
229
		header.getCellFormatter().setWidth(0, 1, "31%");
288
		header.getCellFormatter().setWidth(0, 1, "31%");
230
		header.getCellFormatter().setWidth(0, 2, "31%");
289
		header.getCellFormatter().setWidth(0, 2, "31%");
231
		header.getCellFormatter().setWidth(0, 3, "9%");
290
		header.getCellFormatter().setWidth(0, 3, "9%");
232
		header.getCellFormatter().setWidth(0, 4, "9%");
291
		header.getCellFormatter().setWidth(0, 4, "9%");
233
		header.getCellFormatter().setWidth(0, 5, "9%");
292
		header.getCellFormatter().setWidth(0, 5, "9%");
234
		header.getCellFormatter().setWidth(0, 6, "9%");
293
		header.getCellFormatter().setWidth(0, 6, "9%");
235
 
294
 
236
		// Mise en forme de la table.
295
		// Mise en forme de la table.
237
 
296
 
238
		table.setCellSpacing(0);
297
		table.setCellSpacing(0);
239
		table.setBorderWidth(0);
298
		table.setBorderWidth(0);
240
		table.setCellPadding(2);
299
		table.setCellPadding(2);
241
		table.setWidth("100%");
300
		table.setWidth("100%");
242
 
301
 
243
		// Mise en forme barre navigation
302
		// Mise en forme barre navigation
244
 
303
 
245
		navBar.setWidth("100%");
304
		navBar.setWidth("100%");
246
 
305
 
247
		table.setStyleName("taxon-List");
306
		table.setStyleName("inventoryItem-List");
248
 
307
 
249
		panel.add(navBar);
308
		panel.add(navBar);
250
		panel.add(header);
309
		panel.add(header);
251
		panel.add(table);
310
		panel.add(table);
252
 
-
 
253
		HorizontalPanel selections = new HorizontalPanel();
-
 
254
		
-
 
255
		selections.setSpacing(3);
-
 
256
		
-
 
257
 
-
 
258
		selections.add(new HTML("S&eacute;lection : "));
-
 
259
		
-
 
260
		Label allLabel = new Label("Tous");
-
 
261
		Label separatorLabel = new Label(",");
-
 
262
		Label noneLabel = new Label("Aucun");
-
 
263
		
-
 
264
		allLabel.setStyleName("selection_label");
-
 
265
		noneLabel.setStyleName("selection_label");
-
 
266
		
-
 
267
		selections.add(allLabel);
-
 
268
		allLabel.addClickListener(
-
 
269
			    	new ClickListener() {
-
 
270
			    		public void onClick(Widget sender) {
-
 
271
			    			selectAll();
-
 
272
			    		}
-
 
273
			     	}
-
 
274
		);		
-
 
275
		
-
 
276
		selections.add(separatorLabel);
-
 
277
		
-
 
278
		selections.add(noneLabel);
-
 
279
		noneLabel.addClickListener(
-
 
280
			    	new ClickListener() {
-
 
281
			    		public void onClick(Widget sender) {
-
 
282
			    			deselectAll();
-
 
283
			    		}
-
 
284
			     	}
-
 
285
		);		
-
 
286
		
-
 
287
 
-
 
288
		panel.add(selections);
-
 
289
		
311
 
290
		
312
				
291
		updateCount();
313
		//updateCount();
292
		// update()
314
		// update()
293
 
315
 
294
		
316
		
295
		initWidget(panel);
317
		initWidget(panel);
296
 
318
 
297
 
319
 
298
	}
320
	}
-
 
321
	
-
 
322
	
-
 
323
	  
-
 
324
 
-
 
325
	
299
 
326
 
300
	/**
327
	/**
301
	 * Action lancee par la selection d'un nom dans l'assistant de saisie. Lance
328
	 * Action lancee par la selection d'un nom dans l'assistant de saisie. Lance
302
	 * la recherche d'informations complémentaires (famille, numero
329
	 * la recherche d'informations complémentaires (famille, numero
303
	 * nomenclaturaux etc) et met a jour l'inventaire (addelement())
330
	 * nomenclaturaux etc) et met a jour l'inventaire (addelement())
304
	 * 
331
	 * 
305
	 * @return void
332
	 * @return void
306
	 */
333
	 */
307
	public void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender,
334
	public void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender,
308
			  String str, String value) {
335
			  String str, String value) {
-
 
336
	
309
	
337
 
310
	// Le nom de plante est requis 
-
 
311
		
-
 
312
	 if (mediator.getNameAssistant().getText().compareTo("")==0) {
338
	mediator.onAddInventoryItem();
-
 
339
		
313
		 return;
340
	}
314
	 }
-
 
315
 
341
	
316
		nameText=(mediator.getNameAssistant()).getText();
342
	
317
		nameValue=(mediator.getNameAssistant()).getValue();
-
 
-
 
343
	public void addelement() {
318
	
344
	
319
		locationText=(mediator.getLocationAssistant()).getText();
345
	
320
		locationValue=(mediator.getLocationAssistant()).getValue();
346
	if (mediator.inventoryItemIsValid()) {
321
	 
-
 
322
		 // Suppresion indication departementale (on pourrait faire mieux !!)
-
 
323
		 int pos=locationText.indexOf(" (" );
-
 
324
		 if (pos>=0) {
-
 
325
			 locationText=locationText.substring(0,pos);
347
	
326
		 }
348
		final InventoryItem inventoryItem=mediator.getInventoryItem();
327
	 
349
	
328
				setStatusDisabled();
350
		setStatusDisabled();
329
		
351
		
330
				// On met a jour rapidement l'affichage puis on lance la requete  ....
352
				// On met a jour rapidement l'affichage puis on lance la requete  ....
331
				
353
				
332
		/*		int row = table.insertRow(table.getRowCount());
354
		/*		int row = table.insertRow(table.getRowCount());
333
				// Case a cocher
355
				// Case a cocher
334
				table.setWidget(row, 0, new CheckBox());
356
				table.setWidget(row, 0, new CheckBox());
335
				// Nom saisi
357
				// Nom saisi
336
				table.setText(row, 1, nameText);
358
				table.setText(row, 1, nameText);
337
				
359
				
338
				table.getFlexCellFormatter().setWidth(row, 0, "2%");
360
				table.getFlexCellFormatter().setWidth(row, 0, "2%");
339
				table.getFlexCellFormatter()
361
				table.getFlexCellFormatter()
340
						.setWidth(row, 1, "31%");*/
362
						.setWidth(row, 1, "31%");*/
341
				
363
				
342
				// Recherche complement d'information
364
				// Recherche complement d'information
343
		
365
		
344
				if (nameValue !=null) {
366
				if (inventoryItem.getNomenclaturalNumber() !=null) {
345
		
367
		
346
					HTTPRequest.asyncGet(serviceBaseUrl + "/NameValid/" + nameValue,
368
					HTTPRequest.asyncGet(serviceBaseUrl + "/NameValid/" + inventoryItem.getNomenclaturalNumber(),
347
							new ResponseTextHandler() {
369
							new ResponseTextHandler() {
348
		
370
		
349
								public void onCompletion(String strcomplete) {
371
								public void onCompletion(String strcomplete) {
350
		
372
		
351
									JSONValue jsonValue = JSONParser.parse(strcomplete);
373
									JSONValue jsonValue = JSONParser.parse(strcomplete);
352
									JSONArray jsonArray;
374
									JSONArray jsonArray;
353
		
375
		
354
									if ((jsonArray = jsonValue.isArray()) != null) {
376
									if ((jsonArray = jsonValue.isArray()) != null) {
355
										// Nom retenu, Num Nomen nom retenu, Num Taxon,
377
										// Nom retenu, Num Nomen nom retenu, Num Taxon,
356
										// Famille
378
										// Famille
357
										addElement(nameText, nameValue,
379
										addElement(inventoryItem.getName(), inventoryItem.getNomenclaturalNumber(),
358
												((JSONString) jsonArray.get(0))
380
												((JSONString) jsonArray.get(0))
359
														.stringValue(),
381
														.stringValue(),
360
												((JSONString) jsonArray.get(1))
382
												((JSONString) jsonArray.get(1))
361
														.stringValue(),
383
														.stringValue(),
362
												((JSONString) jsonArray.get(2))
384
												((JSONString) jsonArray.get(2))
363
														.stringValue(),
385
														.stringValue(),
364
												((JSONString) jsonArray.get(3))
386
												((JSONString) jsonArray.get(3))
365
														.stringValue(),
387
														.stringValue(),
366
														locationText,locationValue);
388
														inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getComplementlocation(),inventoryItem.getComment());
367
									}
389
									}
368
								}
390
								}
369
		
391
		
370
							});
392
							});
371
				}
393
				}
372
				// Saisie libre
394
				// Saisie libre
373
				else {
395
				else {
374
					addElement(nameText, " ", " ", " ", " ", " ",locationText,locationValue);
396
					addElement(inventoryItem.getName(), " ", " ", " ", " ", " ",inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getComplementlocation(),inventoryItem.getComment());
375
				}
397
				}
-
 
398
			
-
 
399
		}
-
 
400
	else {
376
			
401
		return;
377
			
402
	}
378
	}
403
	}
379
 
404
 
380
	/**
405
	/**
381
	 * Ajoute un element à l'inventaire
406
	 * Ajoute un element à l'inventaire
382
	 * 
407
	 * 
383
	 * @param nom_sel :
408
	 * @param nom_sel :
384
	 *            nom selectionne
409
	 *            nom selectionne
385
	 * @param num_nom_sel :
410
	 * @param num_nom_sel :
386
	 *            numero nomenclatural nom selectionne
411
	 *            numero nomenclatural nom selectionne
387
	 * @param nom_ret :
412
	 * @param nom_ret :
388
	 *            nom retenu
413
	 *            nom retenu
389
	 * @param num_nom_ret :
414
	 * @param num_nom_ret :
390
	 *            numero nomenclaturel nom retenu
415
	 *            numero nomenclaturel nom retenu
391
	 * @param num_taxon :
416
	 * @param num_taxon :
392
	 *            numero taxonomique
417
	 *            numero taxonomique
393
	 * @param famille :
418
	 * @param famille :
394
	 *            famille
419
	 *            famille
395
	 */
420
	 */
396
 
421
 
397
	public void addElement(String nom_sel, String num_nom_sel, String nom_ret,
422
	private void addElement(String nom_sel, String num_nom_sel, String nom_ret,
398
			String num_nom_ret, String num_taxon, String famille,final String loc, String id_location) {
423
			String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String complementLocation, String comment) {
399
 
424
 
400
		// Calcul du nouveau numéro d'ordre
425
		// Calcul du nouveau numéro d'ordre
401
 
426
 
402
		count++;
427
		count++;
403
		HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/", "identifiant="
428
		HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/", "identifiant="
404
				+ user + "&nom_sel=" + nom_sel + "&num_nom_sel=" + num_nom_sel
429
				+ user + "&nom_sel=" + nom_sel + "&num_nom_sel=" + num_nom_sel
405
				+ "&nom_ret=" + nom_ret + "&num_nom_ret=" + num_nom_ret
430
				+ "&nom_ret=" + nom_ret + "&num_nom_ret=" + num_nom_ret
406
				+ "&num_taxon=" + num_taxon + "&famille=" + famille + "&location=" + loc + "&id_location=" + id_location,
431
				+ "&num_taxon=" + num_taxon + "&famille=" + famille + "&location=" + loc + "&id_location=" + id_location + "&date_observation=" + dat
-
 
432
				+ "&station="+ complementLocation + "&commentaire="+ comment,
407
 
433
 
408
		new ResponseTextHandler() {
434
		new ResponseTextHandler() {
409
 
435
 
410
			public void onCompletion(String str) {
436
			public void onCompletion(String str) {
411
					location=loc;
437
					location=loc;
-
 
438
					if (location.compareTo("")==0) {
-
 
439
						location="000null";
-
 
440
					}
412
					updateCount();
441
					updateCount();
413
			}
442
			}
414
		});
443
		});
415
	}
444
	}
416
 
445
 
417
	/**
446
	/**
418
	 * Suppression d'un element lde l'inventaire, a partir de son numero d'ordre
447
	 * Suppression d'un element lde l'inventaire, a partir de son numero d'ordre
419
	 * 
448
	 * 
420
	 */
449
	 */
421
 
450
 
422
	public void deleteElement() {
451
	public void deleteElement() {
423
 
452
 
424
		setStatusDisabled();
453
		setStatusDisabled();
425
		boolean checked = false;
454
		boolean checked = false;
426
		Vector parseChecked = new Vector();
455
		Vector parseChecked = new Vector();
-
 
456
 
427
 
457
		// TODO : optimiser
428
		// Lifo ...
458
		// Lifo ...
-
 
459
		for (int i = table.getRowCount() - 1; i >= 0; i--) {
429
		for (int i = table.getRowCount() - 1; i >= 0; i--) {
460
			 if (table.getWidget(i, 0)!=null) {
430
			if (((CheckBox) table.getWidget(i, 0)).isChecked()) {
461
				 if (((CheckBox) table.getWidget(i, 0)).isChecked()) {
431
				checked = true;
462
					 checked = true;
432
				// Numero ordre
463
					 // Numero ordre
433
				parseChecked.add(table.getText(i, 7));
464
					 parseChecked.add(table.getText(i, 7));
-
 
465
					 count--;
434
				count--;
466
				 }
435
			}
467
			 }
436
		}
468
		}
437
		sizeChecked=parseChecked.size();
-
 
438
		itemDeleted=0;
469
		StringBuffer ids=new StringBuffer();
439
		for (Iterator it = parseChecked.iterator(); it.hasNext();) {
470
		for (Iterator it = parseChecked.iterator(); it.hasNext();) {
-
 
471
			ids.append((String)it.next());
-
 
472
			if (it.hasNext()) ids.append(",");
440
			itemDeleted++;
473
		}
441
			HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user
474
		HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user
442
						+ "/" + (String) it.next(), "action=DELETE",
475
						+ "/" + ids.toString(), "action=DELETE",
443
						
476
						
444
						new ResponseTextHandler() {
477
						new ResponseTextHandler() {
445
							public void onCompletion(String str) {
478
							public void onCompletion(String str) {
446
								// Optimisation : on ne lance la suppression qu'a la fin
-
 
447
								    if (itemDeleted==sizeChecked) { 
-
 
448
										updateCount();
479
										updateCount();
449
								    }
-
 
450
							}
480
							}
451
						});
481
						});
452
 
-
 
453
		}
482
 
454
		if (!checked) {
483
		if (!checked) {
455
			setStatusEnabled();
484
			setStatusEnabled();
456
		}
485
		}
457
	}
486
	}
458
	
487
	
459
	/**
488
	/**
460
	 * Selection de l'ensemble des elements affichés
489
	 * Selection de l'ensemble des elements affichés
461
	 * 
490
	 * 
462
	 */
491
	 */
463
 
492
 
464
	public void selectAll() {
493
	public void selectAll() {
-
 
494
 
465
 
495
		// TODO : optimiser ...
-
 
496
		for (int i = table.getRowCount() - 1; i >= 0; i--) {
466
		for (int i = table.getRowCount() - 1; i >= 0; i--) {
497
			 if (table.getWidget(i, 0)!=null)
467
			 ((CheckBox) table.getWidget(i, 0)).setChecked(true); 
498
			 ((CheckBox) table.getWidget(i, 0)).setChecked(true); 
468
		}
499
		}
469
	}
500
	}
470
 
501
 
471
	public void deselectAll() {
502
	public void deselectAll() {
-
 
503
	
472
	
504
		// TODO : optimiser ...
-
 
505
		for (int i = table.getRowCount() - 1; i >= 0; i--) {
473
		for (int i = table.getRowCount() - 1; i >= 0; i--) {
506
			 if (table.getWidget(i, 0)!=null)
474
			((CheckBox) table.getWidget(i, 0)).setChecked(false); 
507
			((CheckBox) table.getWidget(i, 0)).setChecked(false); 
475
		}
508
		}
476
	}
509
	}
477
 
510
 
478
 
511
 
479
 
512
 
480
	/**
513
	/**
481
	 * Recherche nombre d'enregistrement pour l'utilisateur et la localite en cours
514
	 * Recherche nombre d'enregistrement pour l'utilisateur et la localite en cours
482
	 * 
515
	 * 
483
	 */
516
	 */
484
	public void updateCount() {
517
	public void updateCount() {
485
		
518
		
486
		setStatusDisabled();
519
		setStatusDisabled();
-
 
520
		
-
 
521
		String adate="all";
-
 
522
		if (date.compareTo("all")!=0) {
-
 
523
			adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00";
-
 
524
		}
487
 
525
 
488
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + location,
526
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + location + "/" + adate , 
489
				new ResponseTextHandler() {
527
				new ResponseTextHandler() {
490
 
528
 
491
					public void onCompletion(String str) {
529
					public void onCompletion(String str) {
492
 
530
 
493
						JSONValue jsonValue = JSONParser.parse(str);
531
						JSONValue jsonValue = JSONParser.parse(str);
494
						JSONNumber jsonNumber;
532
						JSONNumber jsonNumber;
495
						if ((jsonNumber = jsonValue.isNumber()) != null) {
533
						if ((jsonNumber = jsonValue.isNumber()) != null) {
496
							count = (int) jsonNumber.getValue();
534
							count = (int) jsonNumber.getValue();
497
							/*
535
							/*
498
							if (count==0) {
536
							if (count==0) {
499
								location="all";
537
								location="all";
500
							}
538
							}
501
							*/
539
							*/
502
							if (location.compareTo("")==0)
540
							if (location.compareTo("")==0)
503
								location="000null";
541
								location="000null";
504
							mediator.onInventoryItemUpdate(location);
542
							mediator.onInventoryItemUpdate(location);
505
							gotoEnd(); // Derniere page
543
							gotoEnd(); // Derniere page
506
							update();
544
							update();
507
						}
545
						}
508
					}
546
					}
509
				});
547
				});
510
 
548
 
511
	}
549
	}
512
 
550
 
513
	/**
551
	/**
514
	 * Mise a jour de l'affichage, à partir des données d'inventaire deja
552
	 * Mise a jour de l'affichage, à partir des données d'inventaire deja
515
	 * saisies. La valeur de this.startIndex permet de determiner quelles
553
	 * saisies. La valeur de this.startIndex permet de determiner quelles
516
	 * données seront affichées
554
	 * données seront affichées
517
	 * 
555
	 * 
518
	 *  @param deep : force une mise a jour totale
556
	 *  @param deep : force une mise a jour totale
519
	 */
557
	 */
520
 
558
 
521
	public void update() {
559
	public void update() {
522
 
560
 
523
		setStatusDisabled();
561
		setStatusDisabled();
-
 
562
 
-
 
563
		String adate="all";
-
 
564
		if (date.compareTo("all")!=0) {
-
 
565
			adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00";
-
 
566
		}
524
 
567
			
525
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + location +"/"
568
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + location +"/" + adate + "/"+
526
				+ startIndex + "/" + VISIBLE_TAXON_COUNT,
569
				+ startIndex + "/" + VISIBLE_TAXON_COUNT,
527
 
570
 
528
		new ResponseTextHandler() {
571
		new ResponseTextHandler() {
529
 
572
 
530
			public void onCompletion(String str) {
573
			public void onCompletion(String str) {
531
 
574
 
532
				JSONValue jsonValue = JSONParser.parse(str);
575
				JSONValue jsonValue = JSONParser.parse(str);
533
				JSONArray jsonArray;
576
				JSONArray jsonArray;
534
				JSONArray jsonArrayNested;
577
				JSONArray jsonArrayNested;
-
 
578
 
535
 
579
				
536
				int row=0;
580
				int row=0;
537
				int i=0;
581
				int i=0;
538
				if ((jsonArray = jsonValue.isArray()) != null) {
582
				if ((jsonArray = jsonValue.isArray()) != null) {
539
					int arraySize = jsonArray.size();
583
					int arraySize = jsonArray.size();
540
					for (i = 0; i < arraySize; ++i) {
584
					for (i = 0; i < arraySize; ++i) {
541
						if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) {
585
						if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) {
542
							if (i>=table.getRowCount()) {
586
							if (i>=table.getRowCount()) {
543
								 row = table.insertRow(table.getRowCount());
587
								 row = table.insertRow(table.getRowCount());
544
							}
588
							}
545
							else {
589
							else {
546
								row = i;
590
								row = i;
547
							}
591
							}
-
 
592
 
548
							// Case a cocher
593
							// Case a cocher
549
							table.setWidget(row, 0, new CheckBox());
594
							table.setWidget(row, 0, new CheckBox());
550
							// Nom saisi
595
							// Nom saisi
-
 
596
							
551
							table.setText(row, 1, ((JSONString) jsonArrayNested
597
							table.setText(row, 1, ((JSONString) jsonArrayNested
552
									.get(0)).stringValue());
598
									.get(0)).stringValue());
-
 
599
							
553
							// Nom retenu
600
							// Nom retenu
-
 
601
							String aname=((JSONString) jsonArrayNested .get(2)).stringValue();
-
 
602
							
-
 
603
							if (aname.compareTo("null")==0) {
554
							table.setText(row, 2, ((JSONString) jsonArrayNested
604
								table.setText(row, 2, "");
-
 
605
							}
-
 
606
							else {
555
									.get(2)).stringValue());
607
								table.setText(row, 2, aname);
-
 
608
							}
-
 
609
							
556
							// Num nomenclatural
610
							// Num nomenclatural
-
 
611
							String ann=((JSONString) jsonArrayNested .get(3)).stringValue();
-
 
612
							
-
 
613
							if (ann.compareTo("0")==0) {
557
							table.setText(row, 3, ((JSONString) jsonArrayNested
614
								table.setText(row, 3, "");
-
 
615
							}
-
 
616
							else {
558
									.get(1)).stringValue());
617
								table.setText(row, 3, ann);
-
 
618
							}
-
 
619
 
-
 
620
							
559
							// Num Taxonomique
621
							// Num Taxonomique
-
 
622
							
-
 
623
							String ant=((JSONString) jsonArrayNested .get(4)).stringValue();
-
 
624
							
-
 
625
							if (ant.compareTo("0")==0) {
560
							table.setText(row, 4, ((JSONString) jsonArrayNested
626
								table.setText(row, 4, "");
-
 
627
							}
-
 
628
							else {
561
									.get(4)).stringValue());
629
								table.setText(row, 4, ann);
-
 
630
							}
-
 
631
 
562
							// Famille
632
							// Famille
-
 
633
							String afamily=((JSONString) jsonArrayNested .get(5)).stringValue();
-
 
634
							
-
 
635
							if (afamily.compareTo("null")==0) {
563
							table.setText(row, 5, ((JSONString) jsonArrayNested
636
								table.setText(row, 5, "");
-
 
637
							}
-
 
638
							else {
564
									.get(5)).stringValue());
639
								table.setText(row, 5, afamily);
-
 
640
							}
565
 
641
 
566
							
642
							
567
							table.getFlexCellFormatter().setWidth(row, 0, "2%");
643
							table.getFlexCellFormatter().setWidth(row, 0, "2%");
568
							table.getFlexCellFormatter()
644
							table.getFlexCellFormatter()
569
									.setWidth(row, 1, "31%");
645
									.setWidth(row, 1, "31%");
570
							table.getFlexCellFormatter()
646
							table.getFlexCellFormatter()
571
									.setWidth(row, 2, "31%");
647
									.setWidth(row, 2, "31%");
572
							table.getFlexCellFormatter().setWidth(row, 3, "9%");
-
 
573
							table.getFlexCellFormatter().setWidth(row, 4, "9%");
-
 
574
							table.getFlexCellFormatter().setWidth(row, 5, "9%");
-
 
575
 
648
							
576
						// TODO : Bool ici non ?	
649
						// TODO : Bool ici non ?	
-
 
650
							
-
 
651
							// Affichage contenu commune si tout demandé.
-
 
652
							
-
 
653
							String aloc=((JSONString) jsonArrayNested .get(6)).stringValue();
-
 
654
							
577
							if (location.compareTo("all")==0) {
655
							if (location.compareTo("all")==0) {
578
								
656
								
579
//								Localisation - Lieu
657
//								Localisation - Lieu
580
								String aloc=((JSONString) jsonArrayNested .get(6)).stringValue();
-
 
581
								
658
								
582
								if (aloc.compareTo("000null")==00) {
659
								if (aloc.compareTo("000null")==0) {
583
									table.setText(row, 6, "Inconnu");
660
									table.setText(row, 6, "Inconnu");
584
								}
661
								}
585
								else {
662
								else {
586
									table.setText(row, 6, ((JSONString) jsonArrayNested .get(6)).stringValue());
663
									table.setText(row, 6, aloc );
587
								}
664
								}
-
 
665
								
588
								
666
 
-
 
667
								header.getCellFormatter().setVisible(0, 6,true);
-
 
668
							
-
 
669
								table.getFlexCellFormatter().setWidth(row, 1, "31%");
-
 
670
								table.getFlexCellFormatter().setWidth(row, 2, "31%");
-
 
671
 
-
 
672
								table.getFlexCellFormatter().setWidth(row, 3, "9%");
-
 
673
								table.getFlexCellFormatter().setWidth(row, 4, "9%");
-
 
674
								table.getFlexCellFormatter().setWidth(row, 5, "9%");
589
								header.getCellFormatter().setVisible(0, 6,true);
675
								table.getFlexCellFormatter().setWidth(row, 6, "9%");
590
 
676
 
591
							}
677
							}
592
							else {
678
							else {
593
								header.getCellFormatter().setVisible(0, 6,false);
679
								header.getCellFormatter().setVisible(0, 6,false);
594
								table.getCellFormatter().setVisible(row, 6,false);
680
								table.getCellFormatter().setVisible(row, 6,false);
-
 
681
							
-
 
682
								table.getFlexCellFormatter().setWidth(row, 1, "36%");
-
 
683
								table.getFlexCellFormatter().setWidth(row, 2, "36%");
-
 
684
 
-
 
685
								table.getFlexCellFormatter().setWidth(row, 3, "9%");
-
 
686
								table.getFlexCellFormatter().setWidth(row, 4, "9%");
-
 
687
								table.getFlexCellFormatter().setWidth(row, 5, "8%");
-
 
688
								
595
							}
689
							}
596
							table.getFlexCellFormatter().setWidth(row, 6, "9%");
-
 
597
							
690
							
598
							// Numero d'ordre (caché)
691
							// Numero d'ordre (caché)
599
							table.setText(row, 7, ((JSONString) jsonArrayNested
692
							table.setText(row, 7, ((JSONString) jsonArrayNested
600
									.get(7)).stringValue());
693
									.get(7)).stringValue());
601
 
694
 
602
							table.getCellFormatter().setVisible(row, 7, false);
695
							table.getCellFormatter().setVisible(row, 7, false);
603
 
696
 
604
							
697
							
605
						}
698
						}
606
 
699
 
607
					}
700
					}
608
				}
701
				}
-
 
702
 
-
 
703
				
609
				// Suppression fin ancien affichage
704
				// Suppression fin ancien affichage
610
				if (i<table.getRowCount()-1) {
705
				if (i<table.getRowCount()-1) {
611
					 for (int j = table.getRowCount() - 1; j > i-1; j--) {
706
					 for (int j = table.getRowCount() - 1; j > i-1; j--) {
612
						 table.removeRow(j);
707
						 table.removeRow(j);
613
					 }
708
					 }
614
				}
709
				}
615
 
710
 
616
				setStatusEnabled();
711
				setStatusEnabled();
617
				
712
				
618
			}
713
			}
619
		});
714
		});
620
 
715
 
621
	}
716
	}
622
 
717
 
623
 
718
 
624
	/**
719
	/**
625
	 * Affichage message d'attente et désactivation navigation
720
	 * Affichage message d'attente et désactivation navigation
626
	 * 
721
	 * 
627
	 * @param
722
	 * @param
628
	 * @return void
723
	 * @return void
629
	 */
724
	 */
630
 
725
 
631
	private void setStatusDisabled() {
726
	private void setStatusDisabled() {
632
 
727
 
633
		navBar.gotoFirst.setEnabled(false);
728
		navBar.gotoFirst.setEnabled(false);
634
		navBar.gotoPrev.setEnabled(false);
729
		navBar.gotoPrev.setEnabled(false);
635
		navBar.gotoNext.setEnabled(false);
730
		navBar.gotoNext.setEnabled(false);
636
		navBar.gotoEnd.setEnabled(false);
731
		navBar.gotoEnd.setEnabled(false);
637
 
732
 
638
		setStatusText("Patientez ...");
733
		setStatusText("Patientez ...");
639
	}
734
	}
640
 
735
 
641
	/**
736
	/**
642
	 * Affichage numero de page et gestion de la navigation
737
	 * Affichage numero de page et gestion de la navigation
643
	 * 
738
	 * 
644
	 */
739
	 */
645
 
740
 
646
	private void setStatusEnabled() {
741
	private void setStatusEnabled() {
647
 
742
 
648
		// Il y a forcemment un disabled avant d'arriver ici
743
		// Il y a forcemment un disabled avant d'arriver ici
649
 
744
 
650
		if (count > 0) {
745
		if (count > 0) {
651
 
746
 
652
			if (startIndex >= VISIBLE_TAXON_COUNT) { // Au dela de la
747
			if (startIndex >= VISIBLE_TAXON_COUNT) { // Au dela de la
653
														// premiere page
748
														// premiere page
654
				navBar.gotoPrev.setEnabled(true);
749
				navBar.gotoPrev.setEnabled(true);
655
				navBar.gotoFirst.setEnabled(true);
750
				navBar.gotoFirst.setEnabled(true);
656
				if (startIndex < (count - VISIBLE_TAXON_COUNT)) { // Pas la
751
				if (startIndex < (count - VISIBLE_TAXON_COUNT)) { // Pas la
657
																	// derniere
752
																	// derniere
658
																	// page
753
																	// page
659
					navBar.gotoNext.setEnabled(true);
754
					navBar.gotoNext.setEnabled(true);
660
					navBar.gotoEnd.setEnabled(true);
755
					navBar.gotoEnd.setEnabled(true);
661
					setStatusText((startIndex + 1) + " - "
756
					setStatusText((startIndex + 1) + " - "
662
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count );
757
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count );
663
				} else { // Derniere page
758
				} else { // Derniere page
664
					setStatusText((startIndex + 1) + " - " + count + " sur " + count );
759
					setStatusText((startIndex + 1) + " - " + count + " sur " + count );
665
				}
760
				}
666
			} else { // Premiere page
761
			} else { // Premiere page
667
				if (count > VISIBLE_TAXON_COUNT) { // Des pages derrieres
762
				if (count > VISIBLE_TAXON_COUNT) { // Des pages derrieres
668
					navBar.gotoNext.setEnabled(true);
763
					navBar.gotoNext.setEnabled(true);
669
					navBar.gotoEnd.setEnabled(true);
764
					navBar.gotoEnd.setEnabled(true);
670
					setStatusText((startIndex + 1) + " - "
765
					setStatusText((startIndex + 1) + " - "
671
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count);
766
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count);
672
				} else {
767
				} else {
673
					setStatusText((startIndex + 1) + " - " + count + " sur " + count);
768
					setStatusText((startIndex + 1) + " - " + count + " sur " + count);
674
				}
769
				}
675
			}
770
			}
676
		}
771
		}
677
 
772
 
678
		else { // Pas d'inventaire, pas de navigation
773
		else { // Pas d'inventaire, pas de navigation
679
			setStatusText("0 - 0 sur 0");
774
			setStatusText("0 - 0 sur 0");
680
		}
775
		}
681
	}
776
	}
682
 
777
 
683
	/*
778
	/*
684
	 * Positionnement index de parcours (this.startIndex) pour affichage de la
779
	 * Positionnement index de parcours (this.startIndex) pour affichage de la
685
	 * dernière page
780
	 * dernière page
686
	 * 
781
	 * 
687
	 * @param
782
	 * @param
688
	 * @return void
783
	 * @return void
689
	 */
784
	 */
690
 
785
 
691
	private void gotoEnd() {
786
	private void gotoEnd() {
692
 
787
 
693
		if ((count == 0) || (count % VISIBLE_TAXON_COUNT) > 0) {
788
		if ((count == 0) || (count % VISIBLE_TAXON_COUNT) > 0) {
694
			startIndex = count - (count % VISIBLE_TAXON_COUNT);
789
			startIndex = count - (count % VISIBLE_TAXON_COUNT);
695
		} else {
790
		} else {
696
			startIndex = count - VISIBLE_TAXON_COUNT;
791
			startIndex = count - VISIBLE_TAXON_COUNT;
697
		}
792
		}
698
 
793
 
699
	}
794
	}
700
 
795
 
701
	/*
796
	/*
702
	 * Localite en cours 
797
	 * Localite en cours 
703
	 * 
798
	 * 
704
	 */
799
	 */
705
	
800
	
706
	public void setLocation(String location) {
801
	public void setLocation(String location) {
707
		this.location = location;
802
		this.location = location;
708
	}
803
	}
-
 
804
 
-
 
805
 
-
 
806
 
-
 
807
	public void setDate(String date) {
-
 
808
		this.date = date;
-
 
809
	}
709
	
810
	
710
	
811
	
711
	
812
	
712
	
813
	
713
 
814
 
714
 
815
 
715
}
816
}