Subversion Repositories eFlore/Archives.cel-v1

Rev

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

Rev 13 Rev 14
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.Date;
18
import java.util.Date;
19
 
19
 
20
import com.google.gwt.json.client.JSONArray;
20
import com.google.gwt.json.client.JSONArray;
-
 
21
import com.google.gwt.json.client.JSONNull;
21
import com.google.gwt.json.client.JSONParser;
22
import com.google.gwt.json.client.JSONParser;
22
import com.google.gwt.json.client.JSONString;
23
import com.google.gwt.json.client.JSONString;
23
import com.google.gwt.json.client.JSONValue;
24
import com.google.gwt.json.client.JSONValue;
24
import com.google.gwt.user.client.HTTPRequest;
25
import com.google.gwt.user.client.HTTPRequest;
-
 
26
import com.google.gwt.user.client.History;
25
import com.google.gwt.user.client.ResponseTextHandler;
27
import com.google.gwt.user.client.ResponseTextHandler;
-
 
28
import com.google.gwt.user.client.Window;
26
import com.google.gwt.user.client.ui.Button;
29
import com.google.gwt.user.client.ui.Button;
27
import com.google.gwt.user.client.ui.ChangeListener;
30
import com.google.gwt.user.client.ui.ChangeListener;
28
import com.google.gwt.user.client.ui.CheckBox;
31
import com.google.gwt.user.client.ui.CheckBox;
29
import com.google.gwt.user.client.ui.ClickListener;
32
import com.google.gwt.user.client.ui.ClickListener;
30
import com.google.gwt.user.client.ui.Composite;
33
import com.google.gwt.user.client.ui.Composite;
31
import com.google.gwt.user.client.ui.Grid;
34
import com.google.gwt.user.client.ui.Grid;
32
import com.google.gwt.user.client.ui.HTML;
35
import com.google.gwt.user.client.ui.HTML;
33
import com.google.gwt.user.client.ui.HorizontalPanel;
36
import com.google.gwt.user.client.ui.HorizontalPanel;
34
import com.google.gwt.user.client.ui.KeyboardListener;
37
import com.google.gwt.user.client.ui.KeyboardListener;
35
import com.google.gwt.user.client.ui.PopupPanel;
38
import com.google.gwt.user.client.ui.PopupPanel;
36
import com.google.gwt.user.client.ui.TextBox;
39
import com.google.gwt.user.client.ui.TextBox;
37
import com.google.gwt.user.client.ui.VerticalPanel;
40
import com.google.gwt.user.client.ui.VerticalPanel;
38
import com.google.gwt.user.client.ui.Widget;
41
import com.google.gwt.user.client.ui.Widget;
39
 
42
 
40
/**
43
/**
41
 * Composite permet de wrapper des Widget pour creer un nouveau Widget cf methode initWidget()
44
 * Composite permet de wrapper des Widget pour creer un nouveau Widget cf methode initWidget()
42
 */
45
 */
43
 
46
 
44
public class EntryPanel extends Composite   {
47
public class EntryPanel extends Composite   {
45
	
48
	
46
  private NameAssistant nameAssistant = null;
49
  private NameAssistant nameAssistant = null;
47
  private LocationAssistant locationAssistant = null;
50
  private LocationAssistant locationAssistant = null;
48
  TextBox date = new TextBox();
51
  TextBox date = new TextBox();
49
  TextBox complementLocation = new TextBox();
52
  TextBox complementLocation = new TextBox();
50
  TextBox comment = new TextBox();
53
  TextBox comment = new TextBox();
51
  Button dateSelector = new Button("...");
54
  Button dateSelector = new Button("...");
52
  boolean visible=false;
55
  boolean visible=false;
53
  Mediator mediator=null;
56
  Mediator mediator=null;
54
 
57
 
55
  private String serviceBaseUrl = null;
58
  private String serviceBaseUrl = null;
56
  
59
  
57
  private String user= null;
60
  private String user= null;
58
  private String ordre =null;
61
  private String ordre =null;
59
  
62
  
60
  final CalendarWidget calendar = new CalendarWidget();
63
  final CalendarWidget calendar = new CalendarWidget();
61
  
64
  
62
  private PopupPanel choicesPopup = new PopupPanel(true);
65
  private PopupPanel choicesPopup = new PopupPanel(true);
63
 
66
 
64
  public EntryPanel(final Mediator med) {
67
  public EntryPanel(final Mediator med) {
65
	 
68
	 
66
	  
69
	  
67
   mediator=med;
70
   mediator=med;
68
 
71
 
69
   
72
   
70
   
73
   
71
   mediator.registerEntryPanel(this);
74
   mediator.registerEntryPanel(this);
72
   
75
   
73
   mediator.registerDate(date);
76
   mediator.registerDate(date);
74
   mediator.registerComment(comment);
77
   mediator.registerComment(comment);
75
   mediator.registerComplementLocation(complementLocation);
78
   mediator.registerComplementLocation(complementLocation);
76
   
79
   
77
   
80
   
78
   user=mediator.getUser();
81
   user=mediator.getUser();
79
   serviceBaseUrl = mediator.getServiceBaseUrl();
82
   serviceBaseUrl = mediator.getServiceBaseUrl();
80
 
83
 
81
   
84
   
82
   
85
   
83
   VerticalPanel outer = new VerticalPanel();
86
   VerticalPanel outer = new VerticalPanel();
84
   
87
   
85
 
88
 
86
//	outer.add(new HTML("<b>Nouvelle observation:</b>"));
89
	outer.add(new HTML("<b>Saisir&nbsp;un&nbsp;relev&eacute;&nbsp;:</b>"));
87
 
90
 
88
   
91
   
89
   
92
   
90
   Grid inner = new Grid(3,4);
93
   Grid inner = new Grid(3,4);
91
 
94
 
92
   for (int i=0; i<3;i++) {
95
   for (int i=0; i<3;i++) {
93
	inner.getCellFormatter().setWidth(i, 0, "3%");
96
	inner.getCellFormatter().setWidth(i, 0, "3%");
94
	inner.getCellFormatter().setWidth(i, 1, "47%");
97
	inner.getCellFormatter().setWidth(i, 1, "47%");
95
	inner.getCellFormatter().setWidth(i, 2, "3%");
98
	inner.getCellFormatter().setWidth(i, 2, "3%");
96
	inner.getCellFormatter().setWidth(i, 3, "47%");
99
	inner.getCellFormatter().setWidth(i, 3, "47%");
97
   }
100
   }
98
 
101
 
99
 
102
 
100
	nameAssistant = new NameAssistant(mediator);
103
	nameAssistant = new NameAssistant(mediator);
101
	locationAssistant = new LocationAssistant(mediator);
104
	locationAssistant = new LocationAssistant(mediator);
102
	
105
	
-
 
106
 
-
 
107
	
103
 
108
	
104
	// Saisie Nom
109
	// Saisie Nom
105
	
110
	
106
     HTML labelNameAssistant = new HTML("Esp&egrave;ce:&nbsp;");
111
     HTML labelNameAssistant = new HTML("Esp&egrave;ce:&nbsp;");
107
     inner.setWidget(0,0,labelNameAssistant);
112
     inner.setWidget(0,0,labelNameAssistant);
108
     inner.setWidget(0,1,nameAssistant);
113
     inner.setWidget(0,1,nameAssistant);
109
    
114
    
110
     nameAssistant.setWidth("100%");
115
     nameAssistant.setWidth("100%");
111
 
116
 
112
	 // Saisie lieu
117
	 // Saisie lieu
113
	 
118
	 
114
     HTML labelLocationAssistant= new HTML("Commune:&nbsp;");
119
     HTML labelLocationAssistant= new HTML("Commune:&nbsp;");
115
     inner.setWidget(1,0,labelLocationAssistant);
120
     inner.setWidget(1,0,labelLocationAssistant);
116
     inner.setWidget(1,1,locationAssistant);
121
     inner.setWidget(1,1,locationAssistant);
117
 
122
 
118
     locationAssistant.setWidth("100%");
123
     locationAssistant.setWidth("100%");
119
   
124
   
120
     // Saisie Date 
125
     // Saisie Date 
121
	 
126
	 
122
     choicesPopup.add(calendar);
127
     choicesPopup.add(calendar);
123
     
128
     
124
     dateSelector.addClickListener(new ClickListener () {
129
     dateSelector.addClickListener(new ClickListener () {
125
    
130
    
126
       public void onClick(Widget w) {
131
       public void onClick(Widget w) {
127
    	  
132
    	  
128
    	   if (visible) {
133
    	   if (visible) {
129
    		  visible=false; 
134
    		  visible=false; 
130
    		  choicesPopup.hide();
135
    		  choicesPopup.hide();
131
    	   }
136
    	   }
132
    	   else {
137
    	   else {
133
    		visible=true; 
138
    		visible=true; 
134
    	    choicesPopup.show();
139
    	    choicesPopup.show();
135
	        choicesPopup.setPopupPosition(dateSelector.getAbsoluteLeft(),
140
	        choicesPopup.setPopupPosition(dateSelector.getAbsoluteLeft(),
136
	        dateSelector.getAbsoluteTop()  - dateSelector.getOffsetHeight() - choicesPopup.getOffsetHeight());
141
	        dateSelector.getAbsoluteTop()  - dateSelector.getOffsetHeight() - choicesPopup.getOffsetHeight());
137
	        choicesPopup.setWidth(dateSelector.getOffsetWidth() + "px");
142
	        choicesPopup.setWidth(dateSelector.getOffsetWidth() + "px");
138
    	   }
143
    	   }
139
       }
144
       }
140
     
145
     
141
     });
146
     });
142
     
147
     
143
     calendar.addChangeListener(new ChangeListener() {
148
     calendar.addChangeListener(new ChangeListener() {
144
 
149
 
145
     public void onChange(Widget sender) {
150
     public void onChange(Widget sender) {
146
    	 
151
    	 
147
       Date dateSelected=calendar.getDate();
152
       Date dateSelected=calendar.getDate();
148
       date.setText(dateSelected.getDate()+"/"+(dateSelected.getMonth()+1)+"/"+(dateSelected.getYear()+1900));
153
       date.setText(dateSelected.getDate()+"/"+(dateSelected.getMonth()+1)+"/"+(dateSelected.getYear()+1900));
149
       
154
       
150
       visible=false; 
155
       visible=false; 
151
       choicesPopup.hide();
156
       choicesPopup.hide();
152
     }
157
     }
153
     });
158
     });
154
     
159
     
155
    HTML labelDate= new HTML("Date:&nbsp;");
160
    HTML labelDate= new HTML("Date:&nbsp;");
156
    inner.setWidget(2,0,labelDate);
161
    inner.setWidget(2,0,labelDate);
157
    
162
    
158
    HorizontalPanel datePanel = new HorizontalPanel();
163
    HorizontalPanel datePanel = new HorizontalPanel();
159
    datePanel.add(date);
164
    datePanel.add(date);
160
    datePanel.add(dateSelector);
165
    datePanel.add(dateSelector);
161
    inner.setWidget(2,1,datePanel);
166
    inner.setWidget(2,1,datePanel);
162
    
167
    
163
 
168
 
164
    
169
    
165
    
170
    
166
    date.addKeyboardListener( new KeyboardListener() {
171
    date.addKeyboardListener( new KeyboardListener() {
167
 
172
 
168
    		  public void onKeyDown(Widget arg0, char arg1, int arg2) {
173
    		  public void onKeyDown(Widget arg0, char arg1, int arg2) {
169
    			  
174
    			  
170
    			  
175
    			  
171
    			  if(arg1 == KEY_ENTER)
176
    			  if(arg1 == KEY_ENTER)
172
    			    {
177
    			    {
173
    			     mediator.onAddInventoryItem(); 
178
    			     mediator.onAddInventoryItem(); 
174
    			     date.setText("");
179
    			     date.setText("");
175
    			    }
180
    			    }
176
 
181
 
177
    		  }
182
    		  }
178
    		  
183
    		  
179
    		  public void onKeyUp(Widget arg0, char arg1, int arg2) {
184
    		  public void onKeyUp(Widget arg0, char arg1, int arg2) {
180
    		  }
185
    		  }
181
 
186
 
182
    		  public void onKeyPress(Widget arg0, char arg1, int arg2) {
187
    		  public void onKeyPress(Widget arg0, char arg1, int arg2) {
183
    		  }
188
    		  }
184
    		  
189
    		  
185
    		  }
190
    		  }
186
    );
191
    );
187
    
192
    
188
  
193
  
189
 
194
 
190
	 // Saisie Complement lieu 
195
	 // Saisie Complement lieu 
191
	 
196
	 
192
    HTML labelComplementLocation= new HTML("Station:&nbsp;");
197
    HTML labelComplementLocation= new HTML("Station:&nbsp;");
193
    inner.setWidget(1,2,labelComplementLocation);
198
    inner.setWidget(1,2,labelComplementLocation);
194
    inner.setWidget(1,3,complementLocation);
199
    inner.setWidget(1,3,complementLocation);
195
 
200
 
196
    complementLocation.setWidth("100%");
201
    complementLocation.setWidth("100%");
197
 
202
 
198
    
203
    
199
    complementLocation.addKeyboardListener( new KeyboardListener() {
204
    complementLocation.addKeyboardListener( new KeyboardListener() {
200
 
205
 
201
		  public void onKeyDown(Widget arg0, char arg1, int arg2) {
206
		  public void onKeyDown(Widget arg0, char arg1, int arg2) {
202
			  
207
			  
203
			  
208
			  
204
			  if(arg1 == KEY_ENTER)
209
			  if(arg1 == KEY_ENTER)
205
			    {
210
			    {
206
			     mediator.onAddInventoryItem(); 
211
			     mediator.onAddInventoryItem(); 
207
			     complementLocation.setText("");
212
			     complementLocation.setText("");
208
			    }
213
			    }
209
 
214
 
210
		  }
215
		  }
211
		  
216
		  
212
		  public void onKeyUp(Widget arg0, char arg1, int arg2) {
217
		  public void onKeyUp(Widget arg0, char arg1, int arg2) {
213
		  }
218
		  }
214
 
219
 
215
		  public void onKeyPress(Widget arg0, char arg1, int arg2) {
220
		  public void onKeyPress(Widget arg0, char arg1, int arg2) {
216
		  }
221
		  }
217
		  
222
		  
218
		  }
223
		  }
219
    );
224
    );
220
 
225
 
221
    
226
    
222
	 // Saisie Commentaire
227
	 // Saisie Commentaire
223
	 
228
	 
224
    HTML labelComment= new HTML("Notes:&nbsp;");
229
    HTML labelComment= new HTML("Notes:&nbsp;");
225
    inner.setWidget(2,2,labelComment);
230
    inner.setWidget(2,2,labelComment);
226
    inner.setWidget(2,3,comment);
231
    inner.setWidget(2,3,comment);
227
 
232
 
228
    comment.setWidth("100%");
233
    comment.setWidth("100%");
229
 
234
 
230
   
235
   
231
    comment.addKeyboardListener( new KeyboardListener() {
236
    comment.addKeyboardListener( new KeyboardListener() {
232
 
237
 
233
		  public void onKeyDown(Widget arg0, char arg1, int arg2) {
238
		  public void onKeyDown(Widget arg0, char arg1, int arg2) {
234
			  
239
			  
235
			  
240
			  
236
			  if(arg1 == KEY_ENTER)
241
			  if(arg1 == KEY_ENTER)
237
			    {
242
			    {
238
			     mediator.onAddInventoryItem(); 
243
			     mediator.onAddInventoryItem(); 
239
			     comment.setText("");
244
			     comment.setText("");
240
			    }
245
			    }
241
 
246
 
242
		  }
247
		  }
243
		  
248
		  
244
		  public void onKeyUp(Widget arg0, char arg1, int arg2) {
249
		  public void onKeyUp(Widget arg0, char arg1, int arg2) {
245
		  }
250
		  }
246
 
251
 
247
		  public void onKeyPress(Widget arg0, char arg1, int arg2) {
252
		  public void onKeyPress(Widget arg0, char arg1, int arg2) {
248
		  }
253
		  }
249
		  
254
		  
250
		  }
255
		  }
251
  );
256
  );
252
 
257
 
253
   
258
   
254
    Button addButton = new Button("Ajout");
259
    Button addButton = new Button("Ajout");
255
    Button updateButton = new Button("Modification");
260
    Button updateButton = new Button("Modification");
256
 
261
 
257
    addButton.addClickListener(
262
    addButton.addClickListener(
258
    
263
    
259
    		new ClickListener() {
264
    		new ClickListener() {
260
    			
265
    			
261
    			  public void onClick(Widget w) {
266
    			  public void onClick(Widget w) {
262
    				     mediator.onAddInventoryItem(); 
267
    				     mediator.onAddInventoryItem(); 
263
    			  }
268
    			  }
264
    		}
269
    		}
265
    );
270
    );
266
    
271
    
267
    HorizontalPanel buttonPanel = new HorizontalPanel();
272
    HorizontalPanel buttonPanel = new HorizontalPanel();
268
   
273
   
269
    
274
    
270
    updateButton.addClickListener(
275
    updateButton.addClickListener(
271
    	    
276
    	    
272
    		new ClickListener() {
277
    		new ClickListener() {
273
    			
278
    			
274
    			  public void onClick(Widget w) {
279
    			  public void onClick(Widget w) {
275
    				     mediator.onModifyInventoryItem(ordre); 
280
    				     mediator.onModifyInventoryItem(ordre); 
276
    			  }
281
    			  }
277
    		}
282
    		}
278
    );
283
    );
279
    
284
    
280
    
285
    
281
    buttonPanel.add(addButton);
286
    buttonPanel.add(addButton);
282
    buttonPanel.add(updateButton);
287
    buttonPanel.add(updateButton);
283
    
288
    
284
 
289
 
285
	 inner.setWidth("100%");
290
	 inner.setWidth("100%");
286
 
291
 
287
	 outer.add(inner);
292
	 outer.add(inner);
288
	 outer.setCellWidth(inner, "100%");
293
	 outer.setCellWidth(inner, "100%");
289
	 outer.setSpacing(20);
294
	 outer.setSpacing(10);
290
	 
295
	 
291
	outer.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
296
	outer.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
292
    outer.add(buttonPanel);
297
    outer.add(buttonPanel);
293
 
298
 
-
 
299
 
-
 
300
    // Initialisation si provenance d'un lien
-
 
301
    
-
 
302
    if (History.getToken().length()>0) {
-
 
303
 
-
 
304
    	final String anum=History.getToken();
-
 
305
 
-
 
306
		HTTPRequest.asyncGet(serviceBaseUrl + "/Name/" + anum,
-
 
307
				new ResponseTextHandler() {
-
 
308
 
-
 
309
					public void onCompletion(String strcomplete) {
-
 
310
 
-
 
311
						JSONValue jsonValue = JSONParser.parse(strcomplete);
-
 
312
						JSONArray jsonArray;
-
 
313
 
-
 
314
						if ((jsonArray = jsonValue.isArray()) != null) {
-
 
315
		
-
 
316
								String aname = ((JSONString) jsonArray.get(0)).stringValue();
-
 
317
								
-
 
318
								// Nom  
-
 
319
							
-
 
320
								if (aname.compareTo("null")!=0) {
-
 
321
									nameAssistant.setText(((JSONString) jsonArray.get(0)).stringValue());
-
 
322
							
-
 
323
									// Numero nomenclatural 
-
 
324
							
-
 
325
									nameAssistant.setValue(anum);
-
 
326
									
-
 
327
								}
-
 
328
							
-
 
329
						}
-
 
330
					}
-
 
331
 
-
 
332
				});
-
 
333
 
-
 
334
    	
-
 
335
    }
294
 
336
	 
295
 
337
 
296
	 
338
	 
297
    initWidget(outer);
339
    initWidget(outer);
298
   
340
   
299
    
341
    
300
  }
342
  }
301
 
343
 
302
	/*
344
	/*
303
	 * Numero d'ordre du relevé affiché
345
	 * Numero d'ordre du relevé affiché
304
	 * 
346
	 * 
305
	 */
347
	 */
306
	
348
	
307
	public void setOrdre(String ordre) {
349
	public void setOrdre(String ordre) {
308
		this.ordre = ordre;
350
		this.ordre = ordre;
309
	}
351
	}
310
 
352
 
311
 
353
 
312
	/*
354
	/*
313
	 * Numero d'ordre du relevé affiché
355
	 * Numero d'ordre du relevé affiché
314
	 * 
356
	 * 
315
	 */
357
	 */
316
	
358
	
317
	public String getOrdre() {
359
	public String getOrdre() {
318
		return this.ordre;
360
		return this.ordre;
319
	}
361
	}
320
 
362
 
321
 
363
 
322
  
364
  
323
  /**
365
  /**
324
	 * Mise a jour de l'affichage a partir de données deja saisie
366
	 * Mise a jour de l'affichage a partir de données deja saisie
325
	 * 
367
	 * 
326
	 */
368
	 */
327
 
369
 
328
	public void update() {
370
	public void update() {
329
 
371
 
330
		HTTPRequest.asyncGet(serviceBaseUrl + "/Inventory/" + user + "/" + ordre, 
372
		HTTPRequest.asyncGet(serviceBaseUrl + "/Inventory/" + user + "/" + ordre, 
331
 
373
 
332
		new ResponseTextHandler() {
374
		new ResponseTextHandler() {
333
 
375
 
334
			public void onCompletion(String str) {
376
			public void onCompletion(String str) {
335
 
377
 
336
				JSONValue jsonValue = JSONParser.parse(str);
378
				JSONValue jsonValue = JSONParser.parse(str);
337
				JSONArray jsonArray;
379
				JSONArray jsonArray;
338
				
380
				
339
				
381
				
340
				if ((jsonArray = jsonValue.isArray()) != null) {
382
				if ((jsonArray = jsonValue.isArray()) != null) {
341
							// Nom saisi
383
							// Nom saisi
342
							nameAssistant.setText(((JSONString) jsonArray.get(0)).stringValue());
384
							nameAssistant.setText(((JSONString) jsonArray.get(0)).stringValue());
343
							
385
							
344
							// Numero nomenclatural
386
							// Numero nomenclatural
345
						
387
						
346
							String ann=((JSONString) jsonArray .get(3)).stringValue();
388
							String ann=((JSONString) jsonArray .get(3)).stringValue();
347
							
389
							
348
							if (ann.compareTo("0")!=0) {
390
							if (ann.compareTo("0")!=0) {
349
								nameAssistant.setValue(ann);
391
								nameAssistant.setValue(ann);
350
							}
392
							}
351
							
393
							
352
							// Commune
394
							// Commune
353
							String aloc=((JSONString) jsonArray .get(6)).stringValue();
395
							String aloc=((JSONString) jsonArray .get(6)).stringValue();
354
							
396
							
355
							if (aloc.compareTo("000null")!=0) {
397
							if (aloc.compareTo("000null")!=0) {
356
								locationAssistant.setText(aloc);
398
								locationAssistant.setText(aloc);
357
							}
399
							}
358
							else { 
400
							else { 
359
								locationAssistant.setText("");
401
								locationAssistant.setText("");
360
							}
402
							}
361
							
403
							
362
							String adate=((JSONString) jsonArray .get(8)).stringValue();
404
							String adate=((JSONString) jsonArray .get(8)).stringValue();
363
							
405
							
364
//							Date 
406
//							Date 
365
							if (adate.compareTo("0000-00-00 00:00:00")!=0) {
407
							if (adate.compareTo("0000-00-00 00:00:00")!=0) {
366
								date.setText(adate); 
408
								date.setText(adate); 
367
							}
409
							}
368
							else {
410
							else {
369
								date.setText(""); 
411
								date.setText(""); 
370
							}
412
							}
371
 
413
 
372
 
414
 
373
							String astation=((JSONString) jsonArray .get(9)).stringValue();
415
							String astation=((JSONString) jsonArray .get(9)).stringValue();
374
							
416
							
375
//							Station 
417
//							Station 
376
							if (astation.compareTo("null")!=0) {
418
							if (astation.compareTo("000null")!=0) {
377
								complementLocation.setText(astation); 
419
								complementLocation.setText(astation); 
378
							}
420
							}
379
							else {
421
							else {
380
								complementLocation.setText(""); 
422
								complementLocation.setText(""); 
381
							}
423
							}
382
							
424
							
383
 
425
 
384
							String acomment=((JSONString) jsonArray .get(10)).stringValue();
426
							String acomment=((JSONString) jsonArray .get(10)).stringValue();
385
//							Notes
427
//							Notes
386
							if (acomment.compareTo("null")!=0) {
428
							if (acomment.compareTo("null")!=0) {
387
								comment.setText(acomment); 
429
								comment.setText(acomment); 
388
							}
430
							}
389
							else {
431
							else {
390
								comment.setText(""); 
432
								comment.setText(""); 
391
							}
433
							}
392
							
434
							
393
				}
435
				}
394
 
436
 
395
				
437
				
396
				
438
				
397
			}
439
			}
398
		});
440
		});
399
 
441
 
400
	}
442
	}
-
 
443
 
-
 
444
	public void setUser(String user) {
-
 
445
		this.user = user;
401
 
446
	}
402
 
447
 
403
}
448
}