1 | package org.medias.eccad.presentation.bean; |
---|
2 | |
---|
3 | import java.util.LinkedList; |
---|
4 | import java.util.List; |
---|
5 | import java.util.Map; |
---|
6 | |
---|
7 | import javax.faces.component.UIInput; |
---|
8 | import javax.faces.component.UIOutput; |
---|
9 | import javax.faces.component.UISelectOne; |
---|
10 | import javax.faces.context.FacesContext; |
---|
11 | import javax.faces.event.ActionEvent; |
---|
12 | import javax.faces.event.ValueChangeEvent; |
---|
13 | import javax.faces.model.SelectItem; |
---|
14 | import javax.servlet.http.HttpSession; |
---|
15 | |
---|
16 | import org.medias.eccad.metier.ServiceMetier; |
---|
17 | import org.medias.eccad.metier.dessinCarte.ServiceCarte; |
---|
18 | import org.medias.eccad.modele.Parametre; |
---|
19 | import org.medias.eccad.modele.Produit; |
---|
20 | import org.medias.eccad.modele.Rcp; |
---|
21 | import org.medias.eccad.modele.Secteur; |
---|
22 | import org.medias.eccad.modele.StatReponse; |
---|
23 | import org.medias.eccad.modele.Visualisation; |
---|
24 | import org.medias.eccad.modele.Zone; |
---|
25 | import org.medias.eccad.presentation.traducteur.TraducteurCarte; |
---|
26 | |
---|
27 | public class CarteBean extends AbstractVueBean { |
---|
28 | |
---|
29 | // private XmlBeanFactory xmlbean; |
---|
30 | |
---|
31 | private String url; |
---|
32 | private ServiceMetier smp; |
---|
33 | private ServiceCarte serv_carte; |
---|
34 | private String parametre; |
---|
35 | private String secteur; |
---|
36 | private String rcp; |
---|
37 | private String produit; |
---|
38 | private String unite; |
---|
39 | private Long colormapDefault; |
---|
40 | private Long classdisDefault; |
---|
41 | private Zone zone_demandee; |
---|
42 | private Zone zone_visible; |
---|
43 | private Zone zone_click; |
---|
44 | private int clicX; |
---|
45 | private int clicY; |
---|
46 | private String visu; |
---|
47 | private String url_legend; |
---|
48 | |
---|
49 | private UIOutput northbc; |
---|
50 | private UIOutput southbc; |
---|
51 | private UIOutput eastbc; |
---|
52 | private UIOutput westbc; |
---|
53 | |
---|
54 | // private boolean gridOn; |
---|
55 | // private boolean statOn; |
---|
56 | private boolean showPosPixel; |
---|
57 | |
---|
58 | private List<SelectItem> liste_colormap; |
---|
59 | private List<SelectItem> liste_classdis; |
---|
60 | private Long colormap_id; |
---|
61 | private String colormap_txt; |
---|
62 | private Long classdis_id; |
---|
63 | private UISelectOne colormapUI; |
---|
64 | private UISelectOne classdisUI; |
---|
65 | |
---|
66 | private List<SelectItem> liste_region; |
---|
67 | private Long region; |
---|
68 | private String regionName; |
---|
69 | private UISelectOne regionUI; |
---|
70 | private List<SelectItem> liste_country; |
---|
71 | private Long country; |
---|
72 | private String countryName; |
---|
73 | private UISelectOne countryUI; |
---|
74 | |
---|
75 | private String mode; |
---|
76 | private UISelectOne modeUI; |
---|
77 | private String statistique; |
---|
78 | private UISelectOne statistiqueUI; |
---|
79 | private String total; |
---|
80 | private UISelectOne totalUI; |
---|
81 | private List<SelectItem> liste_mask; |
---|
82 | private String mask; |
---|
83 | private UISelectOne maskUI; |
---|
84 | |
---|
85 | private int nbrGrille; |
---|
86 | public int nbrAlt; |
---|
87 | |
---|
88 | private String mapTitle; |
---|
89 | private UIOutput mapTitleUI; |
---|
90 | |
---|
91 | private double minParam; |
---|
92 | private UIInput minParamUI; |
---|
93 | private double maxParam; |
---|
94 | private UIInput maxParamUI; |
---|
95 | |
---|
96 | private Long nbrClasses; |
---|
97 | private UISelectOne nbrClassesUI; |
---|
98 | |
---|
99 | private double resolution; |
---|
100 | |
---|
101 | private String pixelCenter; |
---|
102 | private String centerLat; |
---|
103 | private String centerLon; |
---|
104 | private String globalSum; |
---|
105 | private double centerLatClick; |
---|
106 | private double centerLonClick; |
---|
107 | |
---|
108 | private UIOutput pixelCenterUI; |
---|
109 | |
---|
110 | private String typeCodif; |
---|
111 | |
---|
112 | /** |
---|
113 | * Initialisation de la carte |
---|
114 | * |
---|
115 | */ |
---|
116 | public CarteBean() { |
---|
117 | controleSession(); |
---|
118 | CritereBean critereBean = (CritereBean) ((HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
119 | smp = critereBean.getSmp(); |
---|
120 | serv_carte = new ServiceCarte(); |
---|
121 | initStatistiqueList(); |
---|
122 | clicX = -1; |
---|
123 | clicY = -1; |
---|
124 | |
---|
125 | centerLatClick = 0; |
---|
126 | centerLonClick = 0; |
---|
127 | nbrGrille = 0; |
---|
128 | nbrAlt = 0; |
---|
129 | } |
---|
130 | |
---|
131 | /** |
---|
132 | * Dessin de la carte avec les valeurs par défaut |
---|
133 | * Permet de mettre en place la liste des statistiques disponible ainsi que celle des colormap |
---|
134 | * Il détecte également quel est le type de produit visualisé (temporelle, classe, unique) |
---|
135 | * @param event |
---|
136 | */ |
---|
137 | public void dessinCarteInitiale(ActionEvent event) { |
---|
138 | CritereBean critereBean = (CritereBean) ((HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
139 | Produit prod = critereBean.getProduitbean(); |
---|
140 | initStatistiqueList(); |
---|
141 | zone_demandee = new Zone(critereBean.getNorthbc(), critereBean.getSouthbc(), critereBean.getEastbc(), critereBean.getWestbc()); |
---|
142 | // récupération des informations sur les données |
---|
143 | Parametre param = smp.getParametreById(critereBean.getParametre().intValue()); |
---|
144 | parametre = param.getNom(); |
---|
145 | unite = param.getUnite(); |
---|
146 | Secteur sect = smp.getSecteurById((critereBean.getSector()==null?0:critereBean.getSector().intValue())); |
---|
147 | secteur = sect.getNom(); |
---|
148 | Rcp rc = smp.getRcpById(critereBean.getRcp().intValue()); |
---|
149 | rcp = rc.getNom(); |
---|
150 | colormapDefault = new Long(param.getColormapDefault()); |
---|
151 | classdisDefault = new Long(param.getClassdisDefault()); |
---|
152 | critereBean.majAlt(secteur); |
---|
153 | critereBean.majGrille(null); |
---|
154 | //System.out.println("init, date="+critereBean.getDate()+", alt="+critereBean.getAlt()+", grille="+critereBean.getGrille()); |
---|
155 | nbrGrille = critereBean.getListe_grille().size(); |
---|
156 | nbrAlt = (critereBean.getListe_alt()==null?0:critereBean.getListe_alt().size()-1); |
---|
157 | //LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG , "nbr grilles ="+nbrGrille); |
---|
158 | |
---|
159 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG , "secteur int value="+critereBean.getSector().intValue()); |
---|
160 | // secteur=""; |
---|
161 | // if ( critereBean.getSector().intValue() > 0 ) { |
---|
162 | // Secteur sec = smp.getSecteurById(critereBean.getSector().intValue()); |
---|
163 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG , "id secteur="+critereBean.getSector().intValue()); |
---|
164 | // secteur = sec.getNom(); |
---|
165 | // } |
---|
166 | |
---|
167 | produit = prod.getNom(); |
---|
168 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG , "produit="+produit); |
---|
169 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG , "produit type="+prod.getType()); |
---|
170 | |
---|
171 | Visualisation visual = smp.getVisuByTypeProduct(prod.getType()); |
---|
172 | visu = visual.getPage_jsp(); |
---|
173 | critereBean.majDayMonthYear(visual.getTraducteur()); |
---|
174 | typeCodif = smp.getTypeCodif((critereBean.getGrille()==null?0:critereBean.getGrille().longValue())); |
---|
175 | majColorMap(); |
---|
176 | majClassDistribution(); |
---|
177 | // statistique = "moyenneCarte"; |
---|
178 | // if (statistiqueUI != null) |
---|
179 | // statistiqueUI.setValue(statistique); |
---|
180 | // mode = "date"; |
---|
181 | // if (modeUI != null) |
---|
182 | // modeUI.setValue(mode); |
---|
183 | total = "totalYear"; |
---|
184 | if (totalUI != null) |
---|
185 | totalUI.setValue(total); |
---|
186 | if (critereBean.getGrille() == null) { |
---|
187 | url = "/images/nodata.png"; |
---|
188 | } else { |
---|
189 | resolution = serv_carte.getResolution(critereBean.getGrille().longValue()); |
---|
190 | } |
---|
191 | majMask(); |
---|
192 | // mask = "none"; |
---|
193 | // if (maskUI != null) |
---|
194 | // maskUI.setValue(mask); |
---|
195 | majMaskRegion(); |
---|
196 | majMaskCountry(); |
---|
197 | dessinCarte(event); |
---|
198 | } |
---|
199 | |
---|
200 | /** |
---|
201 | * Change le mode de visualisation de statistique en normal |
---|
202 | * @param event |
---|
203 | */ |
---|
204 | // public void stopStatistique(ActionEvent event) { |
---|
205 | // initStatistiqueList(); |
---|
206 | // majColorMap(); |
---|
207 | // majClassDistribution(); |
---|
208 | // CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
209 | // if (critereBean.getGrille() == null) |
---|
210 | // url = "/images/nodata.png"; |
---|
211 | // else |
---|
212 | // setImageURL(false); |
---|
213 | // clicX = -1; |
---|
214 | // clicY = -1; |
---|
215 | // } |
---|
216 | |
---|
217 | /** |
---|
218 | * permet de savoir s'il faut modifier les échelles |
---|
219 | * @param a_tester |
---|
220 | * @return |
---|
221 | */ |
---|
222 | private boolean testChangeScale(String a_tester) { |
---|
223 | return (a_tester.equals("ecartCarte") || a_tester.equals("sommeCarte") |
---|
224 | || a_tester.equals("region") || a_tester.equals("country")); |
---|
225 | } |
---|
226 | |
---|
227 | /** |
---|
228 | * Détermine le mode d'affichage sélectionné |
---|
229 | * @param event |
---|
230 | */ |
---|
231 | public void selectMode(ValueChangeEvent event) { |
---|
232 | if (modeUI.getValue().toString().equals("date")) { |
---|
233 | mode = "date"; |
---|
234 | changeGrille(null); |
---|
235 | } else if (modeUI.getValue().toString().equals("stats")) { |
---|
236 | mode = "stats"; |
---|
237 | changeStatistique(null); |
---|
238 | } else if (modeUI.getValue().toString().equals("totals")) { |
---|
239 | mode = "totals"; |
---|
240 | changeTotal(null); |
---|
241 | } |
---|
242 | // System.out.println("changemode="+mode); |
---|
243 | } |
---|
244 | |
---|
245 | /** |
---|
246 | * Activer lors du changement de la statistique visualisé |
---|
247 | * @param event |
---|
248 | */ |
---|
249 | public void changeStatistique(ValueChangeEvent event) { |
---|
250 | CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
251 | // majColorMap(); |
---|
252 | if (event != null) { |
---|
253 | statistique = (String)event.getNewValue(); |
---|
254 | } |
---|
255 | if (testChangeScale(statistique)) { |
---|
256 | majClassDistributionStat(); |
---|
257 | } else { |
---|
258 | majClassDistribution(); |
---|
259 | } |
---|
260 | |
---|
261 | if (critereBean.getGrille() == null) |
---|
262 | url = "/images/nodata.png"; |
---|
263 | else |
---|
264 | setImageURL(false); |
---|
265 | } |
---|
266 | |
---|
267 | /** |
---|
268 | * Activer lors du changement du total |
---|
269 | * @param event |
---|
270 | */ |
---|
271 | public void changeTotal(ValueChangeEvent event) { |
---|
272 | CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
273 | if (event != null) { |
---|
274 | total = (String)event.getNewValue(); |
---|
275 | } |
---|
276 | majClassDistributionStat(); |
---|
277 | |
---|
278 | if (critereBean.getGrille() == null) |
---|
279 | url = "/images/nodata.png"; |
---|
280 | else |
---|
281 | setImageURL(false); |
---|
282 | } |
---|
283 | |
---|
284 | /** |
---|
285 | * Modification de la grille sélectionnée |
---|
286 | * @param event |
---|
287 | */ |
---|
288 | public void changeGrille(ValueChangeEvent event) { |
---|
289 | CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
290 | // if (mode.equals("stats") && testStatistique(statistique)) { |
---|
291 | // majColorMap(critereBean.getGrille().longValue()); |
---|
292 | majClassDistribution(); |
---|
293 | // } |
---|
294 | |
---|
295 | // zone_affichee = new Zone(critereBean.getNorthbc(), critereBean.getSouthbc(), critereBean.getEastbc(), critereBean.getWestbc()); |
---|
296 | Long idGrille; |
---|
297 | if (event == null) { |
---|
298 | idGrille = critereBean.getGrille(); |
---|
299 | } else { |
---|
300 | idGrille = (Long)event.getNewValue(); |
---|
301 | critereBean.setGrille(idGrille); |
---|
302 | String dateLabel; |
---|
303 | if (critereBean.getProduitbean().getType().equals("temporal")) { |
---|
304 | for (int num = 0; num < critereBean.getListe_grille().size(); num++) { |
---|
305 | if (critereBean.getListe_grille().get(num).getValue().equals(idGrille)) { |
---|
306 | dateLabel = critereBean.getListe_grille().get(num).getLabel(); |
---|
307 | if (dateLabel.length() == 7) { |
---|
308 | dateLabel += "-01"; |
---|
309 | } else if (dateLabel.length() == 4) { |
---|
310 | dateLabel += "-01-01"; |
---|
311 | } |
---|
312 | critereBean.setDate(dateLabel); |
---|
313 | break; |
---|
314 | } |
---|
315 | } |
---|
316 | critereBean.setDay(critereBean.getDate()); |
---|
317 | critereBean.getDayUI().setValue(critereBean.getDay()); |
---|
318 | critereBean.setMonth(critereBean.getDate().substring(0,7)); |
---|
319 | critereBean.getMonthUI().setValue(critereBean.getMonth()); |
---|
320 | critereBean.setYear(new Integer(critereBean.getDate().substring(0,4))); |
---|
321 | critereBean.getYearUI().setValue(critereBean.getYear()); |
---|
322 | } else { |
---|
323 | for (int num = 0; num < critereBean.getListe_grille().size(); num++) { |
---|
324 | if (critereBean.getListe_grille().get(num).getValue().equals(idGrille)) { |
---|
325 | dateLabel = critereBean.getListe_grille().get(num).getLabel(); |
---|
326 | critereBean.setDate(dateLabel); |
---|
327 | break; |
---|
328 | } |
---|
329 | } |
---|
330 | } |
---|
331 | } |
---|
332 | // gridOn = true; |
---|
333 | // statOn = false; |
---|
334 | if (idGrille == null) |
---|
335 | url = "/images/nodata.png"; |
---|
336 | else |
---|
337 | setImageURL(false); |
---|
338 | // System.out.println("changeGrille, nouvelle date="+critereBean.getDate()+", alt="+critereBean.getAlt()+", grille="+critereBean.getGrille()+", day="+critereBean.getDay()+", month="+critereBean.getMonth()+", year="+critereBean.getYear()+", grilleUI="+critereBean.getGrilleUI().getValue()); |
---|
339 | } |
---|
340 | |
---|
341 | /** |
---|
342 | * Modification de l'altitude sélectionnée |
---|
343 | * @param event |
---|
344 | */ |
---|
345 | public void changeAlt(ValueChangeEvent event) { |
---|
346 | CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
347 | |
---|
348 | String alt ; |
---|
349 | if (event == null) { |
---|
350 | alt = critereBean.getAlt(); |
---|
351 | } else { |
---|
352 | alt = (String)event.getNewValue(); |
---|
353 | critereBean.setAlt(alt); |
---|
354 | } |
---|
355 | String date = critereBean.getDate(); |
---|
356 | critereBean.majGrille(date); |
---|
357 | if (critereBean.getGrille() == null) |
---|
358 | url = "/images/nodata.png"; |
---|
359 | else |
---|
360 | setImageURL(false); |
---|
361 | // System.out.println("changeAlt, date="+date+", alt="+critereBean.getAlt()+", grille="+critereBean.getGrille()+", day="+critereBean.getDay()+", month="+critereBean.getMonth()+", year="+critereBean.getYear()); |
---|
362 | } |
---|
363 | |
---|
364 | /** |
---|
365 | * Activer lors du changement du jour |
---|
366 | * @param event |
---|
367 | */ |
---|
368 | public void changeDay(ValueChangeEvent event) { |
---|
369 | CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
370 | if (event != null && mode.equals("totals")) { |
---|
371 | String day = (String)event.getNewValue(); |
---|
372 | critereBean.setDay(day); |
---|
373 | String dateLabel; |
---|
374 | for (int num = 0; num < critereBean.getListe_grille().size(); num++) { |
---|
375 | dateLabel = critereBean.getListe_grille().get(num).getLabel(); |
---|
376 | if (dateLabel.length() == 7) { |
---|
377 | dateLabel += "-01"; |
---|
378 | } else if (dateLabel.length() == 4) { |
---|
379 | dateLabel += "-01-01"; |
---|
380 | } |
---|
381 | if (dateLabel.equals(day)) { |
---|
382 | critereBean.setGrille((Long)critereBean.getListe_grille().get(num).getValue()); |
---|
383 | critereBean.getGrilleUI().setValue(critereBean.getGrille()); |
---|
384 | critereBean.setDate(day); |
---|
385 | break; |
---|
386 | } |
---|
387 | } |
---|
388 | critereBean.setMonth(critereBean.getDate().substring(0,7)); |
---|
389 | critereBean.getMonthUI().setValue(critereBean.getMonth()); |
---|
390 | critereBean.setYear(new Integer(critereBean.getDate().substring(0,4))); |
---|
391 | critereBean.getYearUI().setValue(critereBean.getYear()); |
---|
392 | } |
---|
393 | if (critereBean.getGrille() == null) |
---|
394 | url = "/images/nodata.png"; |
---|
395 | else |
---|
396 | setImageURL(false); |
---|
397 | // System.out.println("changeDay, grille="+critereBean.getGrille()+", day="+critereBean.getDay()+", month="+critereBean.getMonth()+", year="+critereBean.getYear()); |
---|
398 | } |
---|
399 | |
---|
400 | /** |
---|
401 | * Activer lors du changement du mois |
---|
402 | * @param event |
---|
403 | */ |
---|
404 | public void changeMonth(ValueChangeEvent event) { |
---|
405 | CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
406 | if (event != null && mode.equals("totals")) { |
---|
407 | String month = (String)event.getNewValue(); |
---|
408 | critereBean.setMonth(month); |
---|
409 | critereBean.setYear(new Integer(month.substring(0,4))); |
---|
410 | critereBean.getYearUI().setValue(critereBean.getYear()); |
---|
411 | String dateLabel; |
---|
412 | for (int num = 0; num < critereBean.getListe_grille().size(); num++) { |
---|
413 | dateLabel = critereBean.getListe_grille().get(num).getLabel(); |
---|
414 | if (dateLabel.length() == 7) { |
---|
415 | dateLabel += "-01"; |
---|
416 | } else if (dateLabel.length() == 4) { |
---|
417 | dateLabel += "-01-01"; |
---|
418 | } |
---|
419 | if (dateLabel.substring(0,7).equals(month)) { |
---|
420 | critereBean.setDate(dateLabel); |
---|
421 | critereBean.setGrille((Long)critereBean.getListe_grille().get(num).getValue()); |
---|
422 | critereBean.getGrilleUI().setValue(critereBean.getGrille()); |
---|
423 | critereBean.setDay(dateLabel); |
---|
424 | critereBean.getDayUI().setValue(critereBean.getDay()); |
---|
425 | break; |
---|
426 | } |
---|
427 | } |
---|
428 | } |
---|
429 | if (critereBean.getGrille() == null) |
---|
430 | url = "/images/nodata.png"; |
---|
431 | else |
---|
432 | setImageURL(false); |
---|
433 | // System.out.println("changeMonth, grille="+critereBean.getGrille()+", day="+critereBean.getDay()+", month="+critereBean.getMonth()+", year="+critereBean.getYear()); |
---|
434 | } |
---|
435 | |
---|
436 | /** |
---|
437 | * Activer lors du changement de l'année |
---|
438 | * @param event |
---|
439 | */ |
---|
440 | public void changeYear(ValueChangeEvent event) { |
---|
441 | CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
442 | if (event != null && mode.equals("totals")) { |
---|
443 | Integer year = (Integer)event.getNewValue(); |
---|
444 | critereBean.setYear(year); |
---|
445 | String dateLabel; |
---|
446 | for (int num = 0; num < critereBean.getListe_grille().size(); num++) { |
---|
447 | dateLabel = critereBean.getListe_grille().get(num).getLabel(); |
---|
448 | if (dateLabel.length() == 7) { |
---|
449 | dateLabel += "-01"; |
---|
450 | } else if (dateLabel.length() == 4) { |
---|
451 | dateLabel += "-01-01"; |
---|
452 | } |
---|
453 | if (Integer.parseInt(dateLabel.substring(0,4)) == year.intValue()) { |
---|
454 | critereBean.setDate(dateLabel); |
---|
455 | critereBean.setGrille((Long)critereBean.getListe_grille().get(num).getValue()); |
---|
456 | critereBean.getGrilleUI().setValue(critereBean.getGrille()); |
---|
457 | critereBean.setDay(dateLabel); |
---|
458 | critereBean.getDayUI().setValue(critereBean.getDay()); |
---|
459 | critereBean.setMonth(critereBean.getDate().substring(0,7)); |
---|
460 | critereBean.getMonthUI().setValue(critereBean.getMonth()); |
---|
461 | break; |
---|
462 | } |
---|
463 | } |
---|
464 | } |
---|
465 | if (critereBean.getGrille() == null) |
---|
466 | url = "/images/nodata.png"; |
---|
467 | else |
---|
468 | setImageURL(false); |
---|
469 | // System.out.println("changeYear, grille="+critereBean.getGrille()+", day="+critereBean.getDay()+", month="+critereBean.getMonth()+", year="+critereBean.getYear()); |
---|
470 | } |
---|
471 | |
---|
472 | /** |
---|
473 | * Modification du masque |
---|
474 | * @param event |
---|
475 | */ |
---|
476 | public void changeMask(ValueChangeEvent event) { |
---|
477 | CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
478 | if (event != null) { |
---|
479 | mask = (String)event.getNewValue(); |
---|
480 | } |
---|
481 | // if (testChangeScale(mask)) { |
---|
482 | // majClassDistributionStat(); |
---|
483 | // } else { |
---|
484 | // majClassDistribution(); |
---|
485 | // } |
---|
486 | if (mask.equals("region")) { |
---|
487 | majMaskRegion(); |
---|
488 | } else if (mask.equals("country")) { |
---|
489 | majMaskCountry(); |
---|
490 | } |
---|
491 | if (critereBean.getGrille() == null) |
---|
492 | url = "/images/nodata.png"; |
---|
493 | else |
---|
494 | setImageURL(false); |
---|
495 | } |
---|
496 | |
---|
497 | /** |
---|
498 | * Modification de la région sélectionnée |
---|
499 | * @param event |
---|
500 | */ |
---|
501 | public void changeRegion(ValueChangeEvent event) { |
---|
502 | CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
503 | if (event != null) { |
---|
504 | region = (Long)event.getNewValue(); |
---|
505 | for (SelectItem si: liste_region) { |
---|
506 | if (region.equals(si.getValue())) { |
---|
507 | regionName = si.getLabel(); |
---|
508 | break; |
---|
509 | } |
---|
510 | } |
---|
511 | } |
---|
512 | if (critereBean.getGrille() == null) |
---|
513 | url = "/images/nodata.png"; |
---|
514 | else |
---|
515 | setImageURL(false); |
---|
516 | } |
---|
517 | |
---|
518 | /** |
---|
519 | * Modification du pays sélectionné |
---|
520 | * @param event |
---|
521 | */ |
---|
522 | public void changeCountry(ValueChangeEvent event) { |
---|
523 | CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
524 | if (event != null) { |
---|
525 | country = (Long)event.getNewValue(); |
---|
526 | for (SelectItem si: liste_country) { |
---|
527 | if (country.equals(si.getValue())) { |
---|
528 | countryName = si.getLabel(); |
---|
529 | break; |
---|
530 | } |
---|
531 | } |
---|
532 | } |
---|
533 | if (critereBean.getGrille() == null) |
---|
534 | url = "/images/nodata.png"; |
---|
535 | else |
---|
536 | setImageURL(false); |
---|
537 | } |
---|
538 | |
---|
539 | /** |
---|
540 | * Modification de la colormap |
---|
541 | * @param event |
---|
542 | */ |
---|
543 | public void changeColormap(ValueChangeEvent event) { |
---|
544 | if (event != null) { |
---|
545 | colormap_id = (Long)event.getNewValue(); |
---|
546 | } |
---|
547 | CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
548 | if (critereBean.getGrille() == null) |
---|
549 | url = "/images/nodata.png"; |
---|
550 | else |
---|
551 | setImageURL(false); |
---|
552 | clicX = -1; |
---|
553 | clicY = -1; |
---|
554 | } |
---|
555 | |
---|
556 | public void changeClassdis(ValueChangeEvent event) { |
---|
557 | if (event != null) { |
---|
558 | classdis_id = (Long)event.getNewValue(); |
---|
559 | } |
---|
560 | CritereBean critereBean = (CritereBean) ((HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
561 | if (critereBean.getGrille() == null) |
---|
562 | url = "/images/nodata.png"; |
---|
563 | else |
---|
564 | setImageURL(false); |
---|
565 | clicX = -1; |
---|
566 | clicY = -1; |
---|
567 | } |
---|
568 | |
---|
569 | /** |
---|
570 | * Modification de la colormap |
---|
571 | * @param event |
---|
572 | */ |
---|
573 | /* public void changeColormapDynamic(ValueChangeEvent event) { |
---|
574 | CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
575 | if (critereBean.getGrille() == null) |
---|
576 | url = "/images/nodata.png"; |
---|
577 | else |
---|
578 | setImageURL(false); |
---|
579 | clicX = -1; |
---|
580 | clicY = -1; |
---|
581 | }*/ |
---|
582 | |
---|
583 | /** |
---|
584 | * Sur clique sur la carte |
---|
585 | * @param event |
---|
586 | */ |
---|
587 | public void dessinCarte(ActionEvent event) { |
---|
588 | CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
589 | if (critereBean.getGrille() != null) { |
---|
590 | // url = "/images/nodata.png"; |
---|
591 | // } else { |
---|
592 | // init resol |
---|
593 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "get grille value ="+critereBean.getGrille().longValue()); |
---|
594 | // resolution = serv_carte.getResolution(critereBean.getGrille().longValue()); |
---|
595 | //System.out.println("zoom ou unzoom, date="+critereBean.getDate()+", alt="+critereBean.getAlt()+", grille="+critereBean.getGrille()+", day="+critereBean.getDay()+", month="+critereBean.getMonth()+", year="+critereBean.getYear()); |
---|
596 | setImageURL(true); |
---|
597 | } |
---|
598 | |
---|
599 | clicX = -1; |
---|
600 | clicY = -1; |
---|
601 | } |
---|
602 | |
---|
603 | /** |
---|
604 | * permet de charger les types de masques |
---|
605 | */ |
---|
606 | private void majMask() { |
---|
607 | liste_mask = new LinkedList<SelectItem>(); |
---|
608 | liste_mask.add(new SelectItem("none", "None")); |
---|
609 | if (resolution == 0.5) { |
---|
610 | liste_mask.add(new SelectItem("region","Region")); |
---|
611 | liste_mask.add(new SelectItem("country","Country")); |
---|
612 | } |
---|
613 | mask = "none"; |
---|
614 | if (maskUI != null) |
---|
615 | maskUI.setValue(mask); |
---|
616 | } |
---|
617 | |
---|
618 | /** |
---|
619 | * permet de charger les masques des régions |
---|
620 | */ |
---|
621 | private void majMaskRegion() { |
---|
622 | liste_region = smp.getListRegion(); |
---|
623 | if (liste_region.size() != 0) { |
---|
624 | region = (Long)liste_region.get(0).getValue(); |
---|
625 | regionName = liste_region.get(0).getLabel(); |
---|
626 | if (regionUI != null) |
---|
627 | regionUI.setValue(region); |
---|
628 | } |
---|
629 | } |
---|
630 | |
---|
631 | /** |
---|
632 | * permet de charger les masques des pays |
---|
633 | */ |
---|
634 | private void majMaskCountry() { |
---|
635 | liste_country = smp.getListCountry(); |
---|
636 | if (liste_country.size() != 0) { |
---|
637 | country = (Long)liste_country.get(0).getValue(); |
---|
638 | countryName = liste_region.get(0).getLabel(); |
---|
639 | if (countryUI != null) |
---|
640 | countryUI.setValue(country); |
---|
641 | } |
---|
642 | } |
---|
643 | |
---|
644 | /** |
---|
645 | * permet de charger la colormap en fonction de la grille visualisée |
---|
646 | */ |
---|
647 | private void majColorMap() { |
---|
648 | // CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
649 | // if (identifiant == -1 && critereBean.getGrille() != null) |
---|
650 | // identifiant = critereBean.getGrille().intValue(); |
---|
651 | |
---|
652 | liste_colormap = smp.getListMappingColor(); |
---|
653 | |
---|
654 | if (liste_colormap.size() != 0) { |
---|
655 | colormap_id = colormapDefault; |
---|
656 | for (int num_col = 0; num_col < liste_colormap.size(); num_col++) { |
---|
657 | if ( Long.parseLong(liste_colormap.get(num_col).getValue().toString()) == colormap_id.longValue() ) { |
---|
658 | colormap_txt = liste_colormap.get(num_col).getLabel(); |
---|
659 | break; |
---|
660 | } |
---|
661 | } |
---|
662 | // colormap_id = (Long) liste_colormap.get(0).getValue(); |
---|
663 | if (colormapUI != null) |
---|
664 | colormapUI.setValue(colormap_id); |
---|
665 | } |
---|
666 | } |
---|
667 | |
---|
668 | private void majClassDistribution() { |
---|
669 | CritereBean critereBean = (CritereBean) ((HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
670 | |
---|
671 | // récupération des informations sur les données |
---|
672 | Parametre param = smp.getParametreById(critereBean.getParametre().intValue()); |
---|
673 | |
---|
674 | liste_classdis = smp.getListClassDistribution(param.getIdentifiant()); |
---|
675 | |
---|
676 | if (liste_classdis.size() != 0) { |
---|
677 | boolean trouve = false; |
---|
678 | // On recherche l'échelle de valeur déjà sélectionnée dans la liste |
---|
679 | // Si on ne le trouve pas, on prend l'echelle par défaut |
---|
680 | // Si on le trouve, on conserve la même echelle |
---|
681 | for (int i=0; !trouve && i<liste_classdis.size();i++) { |
---|
682 | if (liste_classdis.get(i).getValue().equals(classdis_id)) { |
---|
683 | trouve = true; |
---|
684 | } |
---|
685 | } |
---|
686 | if (!trouve) |
---|
687 | classdis_id = classdisDefault; |
---|
688 | // classdis_id = (Long) liste_classdis.get(0).getValue(); |
---|
689 | if (classdisUI != null) |
---|
690 | classdisUI.setValue(classdis_id); |
---|
691 | } |
---|
692 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "distrib ID !!! :: " + classdis_id); |
---|
693 | } |
---|
694 | |
---|
695 | /** |
---|
696 | * Permet d'obtenir les colormaps disponible pour les statistiques |
---|
697 | * |
---|
698 | */ |
---|
699 | /* private void majColorMapStat() { |
---|
700 | // FIXME : normalement il faudrai que la base de donnée retourne les colormaps qui correspondent au produit utilisé... |
---|
701 | liste_colormap = smp.getListColorDynamique();*/ |
---|
702 | /*SelectItem temp = null; |
---|
703 | if (testStatistique(statistique)) { |
---|
704 | for (SelectItem iterable_element : liste_colormap) { |
---|
705 | if (iterable_element.getLabel().equalsIgnoreCase("logarithm")) |
---|
706 | temp = iterable_element; |
---|
707 | } |
---|
708 | liste_colormap = new LinkedList<SelectItem>(); |
---|
709 | if (temp == null) { |
---|
710 | LoggerPerso.log(CarteBean.class, LoggerPerso.ERROR, "erreur fatale pas de colormap lineaire !!!"); |
---|
711 | throw new RuntimeException("erreur fatale pas de colormap lineaire !!!"); |
---|
712 | } |
---|
713 | liste_colormap.add(temp); |
---|
714 | }*/ |
---|
715 | |
---|
716 | /* if (liste_colormap.size() != 0) { |
---|
717 | colormap_id = colormapDefault; |
---|
718 | // colormap_id = (Long) liste_colormap.get(0).getValue(); |
---|
719 | if (colormapUI != null) |
---|
720 | colormapUI.setValue(colormap_id); |
---|
721 | } |
---|
722 | }*/ |
---|
723 | |
---|
724 | private void majClassDistributionStat() { |
---|
725 | liste_classdis = smp.getListClassDynamique(); |
---|
726 | |
---|
727 | if (liste_classdis.size() != 0) { |
---|
728 | boolean trouve = false; |
---|
729 | for (int i=0; !trouve && i<liste_classdis.size();i++) { |
---|
730 | if (liste_classdis.get(i).getValue().equals(classdis_id)) { |
---|
731 | trouve = true; |
---|
732 | } |
---|
733 | } |
---|
734 | if (!trouve) |
---|
735 | classdis_id = (Long) liste_classdis.get(1).getValue(); |
---|
736 | if (classdisUI != null) |
---|
737 | classdisUI.setValue(classdis_id); |
---|
738 | } |
---|
739 | } |
---|
740 | |
---|
741 | /** |
---|
742 | * Permet d'obtenir un identifiant unique pour générée une image |
---|
743 | * @return un identifiant unique |
---|
744 | */ |
---|
745 | private String getIdUnique() { |
---|
746 | HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false); |
---|
747 | if (session == null) |
---|
748 | return ""; |
---|
749 | String imageID = session.getId() + session.getLastAccessedTime(); |
---|
750 | return imageID; |
---|
751 | } |
---|
752 | |
---|
753 | /** |
---|
754 | * Permet de générer l'image. |
---|
755 | * Cette fonction détecte s'il s'agit d'une statistique ou d'une carte normale, leur traitement sera différent par la suite |
---|
756 | * @param id_grille de la grille |
---|
757 | * @param firstAff détermine si la zone affichée sera mise à jour ou non (zoom, déplacement, etc...) |
---|
758 | */ |
---|
759 | private void setImageURL(boolean firstAff) { |
---|
760 | CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
761 | Long id_grille = critereBean.getGrille(); |
---|
762 | if (smp == null) { |
---|
763 | smp = critereBean.getSmp(); |
---|
764 | } |
---|
765 | setTitleMap(critereBean); |
---|
766 | |
---|
767 | // if (colormapUI != null) |
---|
768 | // colormap_id = (Long) colormapUI.getValue(); |
---|
769 | // if (colormap_id == null) |
---|
770 | // colormap_id = new Long(-1); |
---|
771 | |
---|
772 | // if (classdisUI != null) |
---|
773 | // classdis_id = (Long) classdisUI.getValue(); |
---|
774 | // if (classdis_id == null) |
---|
775 | // classdis_id = new Long(-1); |
---|
776 | //System.out.println("setImageURL->mode="+mode+", modeUI="+(modeUI==null?"null":modeUI.getValue())+", stats="+statistique+", statsUI="+(statistiqueUI==null?"null":statistiqueUI.getValue())+", grille="+id_grille); |
---|
777 | if (mode.equals("stats")) { |
---|
778 | // gridOn = false; |
---|
779 | // statOn = true; |
---|
780 | gestionCarteStat(firstAff); |
---|
781 | } else if (mode.equals("totals")) { |
---|
782 | // gridOn = false; |
---|
783 | // statOn = true; |
---|
784 | gestionCarteTotal(firstAff); |
---|
785 | } else { |
---|
786 | // gridOn = true; |
---|
787 | // statOn = false; |
---|
788 | String idUnique = getIdUnique(); |
---|
789 | boolean zoom = false; |
---|
790 | if (clicX != -1 && clicY != -1) { |
---|
791 | makeZoom(id_grille, idUnique, resolution); |
---|
792 | zoom = true; |
---|
793 | } else { |
---|
794 | // pixelCenterUI.setValue(pixelCenter); |
---|
795 | if (firstAff) { |
---|
796 | centerLatClick = 0; |
---|
797 | centerLonClick = 0; |
---|
798 | } |
---|
799 | } |
---|
800 | StatReponse statReponse = serv_carte.getCarte(id_grille, colormap_id.longValue(), classdis_id.longValue(), zone_demandee, idUnique, produit, critereBean.getSector().longValue(), zoom, firstAff, getMaskId()); |
---|
801 | |
---|
802 | url = statReponse.getUrlImage(); |
---|
803 | url_legend = serv_carte.getLegend(id_grille,colormap_id.longValue(),classdis_id.longValue()); |
---|
804 | |
---|
805 | //System.out.println("*** latclick="+centerLatClick+", lonclick="+centerLonClick); |
---|
806 | zone_click = new Zone(centerLatClick, centerLatClick, centerLonClick, centerLonClick); |
---|
807 | statReponse = serv_carte.getStatReponse(id_grille,colormap_id.longValue(), classdis_id.longValue(), zone_click, produit, critereBean.getSector().longValue(), getMaskId()); |
---|
808 | // On n'affiche la valeur du pixel cliqué que lors d'un clic sur la carte |
---|
809 | //ou bien lors d'un recalcul d'un point déjà cliqué |
---|
810 | if ((clicX != -1 && clicY != -1) || (!firstAff && !pixelCenter.equals(""))) { |
---|
811 | showPosPixel = true; |
---|
812 | String aPixelCenter = Double.toString(statReponse.getCenter()); |
---|
813 | pixelCenter = fixeDecimal(aPixelCenter); |
---|
814 | centerLat = String.valueOf(statReponse.getCenterLat()); |
---|
815 | centerLon = String.valueOf(statReponse.getCenterLon()); |
---|
816 | } else if (firstAff){ |
---|
817 | showPosPixel = false; |
---|
818 | pixelCenter = ""; |
---|
819 | centerLat = ""; |
---|
820 | centerLon = ""; |
---|
821 | } |
---|
822 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "***********pixelCenter :: " + pixelCenter); |
---|
823 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "***********centerLat :: " + centerLat); |
---|
824 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "***********centerLon :: " + centerLon); |
---|
825 | } |
---|
826 | zone_visible = serv_carte.getCarteCoordinate(); |
---|
827 | // System.out.println("zone demandée="+zone_demandee); |
---|
828 | // System.out.println("zone visible="+zone_visible); |
---|
829 | if (northbc != null) { |
---|
830 | northbc.setValue(zone_demandee.getNorthbcN()); |
---|
831 | southbc.setValue(zone_demandee.getSouthbcN()); |
---|
832 | eastbc.setValue(zone_demandee.getEastbcN()); |
---|
833 | westbc.setValue(zone_demandee.getWestbcN()); |
---|
834 | } |
---|
835 | // pixelCenter = serv_carte.getCarte(id_grille, colormap_id, zone_affichee, getIdUnique()+1).getCenter(); |
---|
836 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "pixelCenter zoom :: " + pixelCenter); |
---|
837 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "zone :: " + zone_affichee); |
---|
838 | } |
---|
839 | |
---|
840 | /** |
---|
841 | * Permet de définir le titre de la carte |
---|
842 | */ |
---|
843 | public void setTitleMap(CritereBean critereBean) { |
---|
844 | String modeDisplay = ""; |
---|
845 | if (secteur.equals("Aviation")) { |
---|
846 | modeDisplay += ", "+(critereBean.getAlt().equals("Sum")?"sum altitude":critereBean.getAlt()+" km"); |
---|
847 | } |
---|
848 | if (mode.equals("date")) { |
---|
849 | modeDisplay += ", "+critereBean.getDate(); |
---|
850 | } else if (mode.equals("stats")) { |
---|
851 | modeDisplay += ", statistics"; |
---|
852 | if (statistique.equals("moyenneCarte")) { |
---|
853 | modeDisplay += " - mean"; |
---|
854 | } else if (statistique.equals("ecartCarte")) { |
---|
855 | modeDisplay += " - standard deviation"; |
---|
856 | } else if (statistique.equals("minimumCarte")) { |
---|
857 | modeDisplay += " - minimum"; |
---|
858 | } else if (statistique.equals("maximumCarte")) { |
---|
859 | modeDisplay += " - maximum"; |
---|
860 | } else if (statistique.equals("sommeCarte")) { |
---|
861 | modeDisplay += " - sum"; |
---|
862 | } |
---|
863 | } else { |
---|
864 | modeDisplay += ", totals"; |
---|
865 | if (total.equals("totalDay")) { |
---|
866 | modeDisplay += " over day "+critereBean.getDay(); |
---|
867 | } else if (total.equals("totalMonth")) { |
---|
868 | modeDisplay += " over month "+critereBean.getMonth(); |
---|
869 | } else if (total.equals("totalYear")) { |
---|
870 | modeDisplay += " over year "+critereBean.getYear(); |
---|
871 | } else if (total.equals("totalPeriod")) { |
---|
872 | modeDisplay += " over period from "+critereBean.getBegDate()+" to "+critereBean.getEndDate(); |
---|
873 | } |
---|
874 | } |
---|
875 | if (mask.equals("region")) { |
---|
876 | modeDisplay += ", mask: "+regionName; |
---|
877 | } else if (mask.equals("country")) { |
---|
878 | modeDisplay += ", mask: "+countryName; |
---|
879 | } |
---|
880 | if (produit.equals("IPCC")) { |
---|
881 | if (!rcp.equals("None")) { |
---|
882 | mapTitle = produit+": "+parametre + ", "+secteur + ", RCP "+rcp + modeDisplay; |
---|
883 | } else { |
---|
884 | mapTitle = produit+": "+parametre + ", "+secteur + modeDisplay; |
---|
885 | } |
---|
886 | } else { |
---|
887 | mapTitle = produit+": "+parametre+modeDisplay; |
---|
888 | } |
---|
889 | |
---|
890 | if (mapTitleUI != null) |
---|
891 | mapTitleUI.setValue(mapTitle); |
---|
892 | } |
---|
893 | |
---|
894 | /** |
---|
895 | * Permet de zoomer |
---|
896 | * @param id_grille |
---|
897 | * @param imageID |
---|
898 | */ |
---|
899 | public void makeZoom(long id_grille, String imageID, double resol) { |
---|
900 | |
---|
901 | /* StatReponse statReponse = serv_carte.getCarte(id_grille, colormap_id.longValue(), zone_selection, getIdUnique()); |
---|
902 | pixelCenter = statReponse.getCenter(); |
---|
903 | centerLat = statReponse.getCenterLat(); |
---|
904 | centerLon = statReponse.getCenterLon();*/ |
---|
905 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "-------------------------------------------> clicX :: " + clicX); |
---|
906 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "-------------------------------------------> clicY :: " + clicY); |
---|
907 | |
---|
908 | // Zone aZone = serv_carte.getCarteCoordinate(); |
---|
909 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "-------------------------------------------> getEastbc :: " + aZone.getEastbc()); |
---|
910 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "-------------------------------------------> getNorthbc :: " + aZone.getNorthbc()); |
---|
911 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "-------------------------------------------> getSouthbc :: " + aZone.getSouthbc()); |
---|
912 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "-------------------------------------------> getWestbc :: " + aZone.getWestbc()); |
---|
913 | |
---|
914 | serv_carte.zoomCarte(2, clicX, clicY, resol); |
---|
915 | } |
---|
916 | |
---|
917 | /** |
---|
918 | * Permet de générer une carte statistique |
---|
919 | * @param updateAffiche permet de savoir si la zone visualisé doit être modifié ou non |
---|
920 | */ |
---|
921 | public void gestionCarteStat(boolean firstAff) { |
---|
922 | CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
923 | String alt = (critereBean.getAlt()==null?"0":critereBean.getAlt()); |
---|
924 | /* |
---|
925 | * Traduction des paramÚtres... Bon ça serai mieux de faire ça dans un traducteur dédié quand même :) |
---|
926 | */ |
---|
927 | Map<String, String> critere = new TraducteurCarte().tradCritere2Stat(critereBean, this); |
---|
928 | long id_param = critereBean.getParametre().longValue(); |
---|
929 | long id_produit = critereBean.getProduit().longValue(); |
---|
930 | long id_secteur = (critereBean.getSector()==null?0:critereBean.getSector().longValue()); |
---|
931 | long id_rcp = critereBean.getRcp().longValue(); |
---|
932 | |
---|
933 | StatReponse statReponse; |
---|
934 | String idUnique = getIdUnique(); |
---|
935 | boolean zoom = false; |
---|
936 | if (clicX != -1 && clicY != -1) { // en cas de zoom |
---|
937 | serv_carte.zoomCarte(2, clicX, clicY, resolution); |
---|
938 | zoom = true; |
---|
939 | // } else if (updateAffiche) { // sans zoom mais on fait un update sur la zone affiché (on revient sur la zone sélectionnée) |
---|
940 | // Map<String, String> critere2 = new TraducteurCarte().tradCritere2StatReinit(critereBean, this); |
---|
941 | // statReponse = serv_carte.getCarteStat(critere, id_param, id_produit, colormap_id.longValue(),classdis_id.longValue(), id_secteur, id_rcp, statistique, idUnique, zone_selection); |
---|
942 | // centerLatClick = 0; |
---|
943 | // centerLonClick = 0; |
---|
944 | } else { |
---|
945 | if (firstAff) { |
---|
946 | centerLatClick = 0; |
---|
947 | centerLonClick = 0; |
---|
948 | } |
---|
949 | } |
---|
950 | statReponse = serv_carte.getCarteStat(critere, id_param, id_produit, colormap_id.longValue(),classdis_id.longValue(), id_secteur, id_rcp, alt,statistique, idUnique, zone_demandee, zoom, firstAff, getMaskId()); |
---|
951 | // clicX = -1; |
---|
952 | // clicY = -1; |
---|
953 | |
---|
954 | url = statReponse.getUrlImage(); |
---|
955 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "::CarteBean::ChangeStatistique::ok::\n" + critere + "::" + id_param + "::" + id_produit + "::" + statistique); |
---|
956 | url_legend = serv_carte.getLegendStat(critereBean.getGrille().longValue(), colormap_id.longValue(),classdis_id.longValue(), statistique, idUnique); |
---|
957 | |
---|
958 | ///initialisation du pixel du centre de la zone |
---|
959 | // zone_affichee = serv_carte.getCarteCoordinate(); |
---|
960 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "************DEBUT "); |
---|
961 | CritereBean critereBeanProvisoire = new CritereBean(); |
---|
962 | critereBeanProvisoire.setBegDate(critereBean.getBegDate()); |
---|
963 | critereBeanProvisoire.setEndDate(critereBean.getEndDate()); |
---|
964 | |
---|
965 | Zone zone_click = new Zone(centerLatClick, centerLatClick, centerLonClick, centerLonClick); |
---|
966 | |
---|
967 | critereBeanProvisoire.setEastbc(zone_click.getEastbc()); |
---|
968 | critereBeanProvisoire.setWestbc(zone_click.getWestbc()); |
---|
969 | critereBeanProvisoire.setNorthbc(zone_click.getNorthbc()); |
---|
970 | critereBeanProvisoire.setSouthbc(zone_click.getSouthbc()); |
---|
971 | |
---|
972 | Map<String, String> critereProvisoire = new TraducteurCarte().tradCritere2StatReinit(critereBeanProvisoire, this); |
---|
973 | statReponse = serv_carte.getStatReponse(critereProvisoire, id_param, id_produit, colormap_id.longValue(), classdis_id.longValue(), id_secteur, id_rcp, alt, statistique, getMaskId()); |
---|
974 | |
---|
975 | // On n'affiche la valeur du pixel cliqué que lors d'un clic sur la carte |
---|
976 | //ou bien lors d'un recalcul d'un point déjà cliqué |
---|
977 | if ((clicX != -1 && clicY != -1) || (!firstAff && !pixelCenter.equals(""))) { |
---|
978 | showPosPixel = true; |
---|
979 | String aPixelCenter = Double.toString(statReponse.getCenter()); |
---|
980 | pixelCenter = fixeDecimal(aPixelCenter); |
---|
981 | centerLat = String.valueOf(statReponse.getCenterLat()); |
---|
982 | centerLon = String.valueOf(statReponse.getCenterLon()); |
---|
983 | } else if (firstAff){ |
---|
984 | showPosPixel = false; |
---|
985 | pixelCenter = ""; |
---|
986 | centerLat = ""; |
---|
987 | centerLon = ""; |
---|
988 | } |
---|
989 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "***********pixelCenter stat :: " + pixelCenter); |
---|
990 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "***********centerLat stat :: " + centerLat); |
---|
991 | // LoggerPerso.log(CarteBean.class, LoggerPerso.DEBUG, "***********centerLon stat :: " + centerLon); |
---|
992 | } |
---|
993 | |
---|
994 | /** |
---|
995 | * Permet de générer une carte de totaux |
---|
996 | * @param updateAffiche permet de savoir si la zone visualisé doit être modifié ou non |
---|
997 | */ |
---|
998 | public void gestionCarteTotal(boolean firstAff) { |
---|
999 | CritereBean critereBean = (CritereBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("critereBean"); |
---|
1000 | String alt = (critereBean.getAlt()==null?"0":critereBean.getAlt()); |
---|
1001 | Map<String, String> critere = new TraducteurCarte().tradCritere2Total(critereBean, this); |
---|
1002 | long id_param = critereBean.getParametre().longValue(); |
---|
1003 | long id_produit = critereBean.getProduit().longValue(); |
---|
1004 | long id_secteur = (critereBean.getSector()==null?0:critereBean.getSector().longValue()); |
---|
1005 | long id_rcp = critereBean.getRcp().longValue(); |
---|
1006 | |
---|
1007 | StatReponse statReponse; |
---|
1008 | String idUnique = getIdUnique(); |
---|
1009 | boolean zoom = false; |
---|
1010 | if (clicX != -1 && clicY != -1) { // en cas de zoom |
---|
1011 | serv_carte.zoomCarte(2, clicX, clicY, resolution); |
---|
1012 | zoom = true; |
---|
1013 | } else { |
---|
1014 | if (firstAff) { |
---|
1015 | centerLatClick = 0; |
---|
1016 | centerLonClick = 0; |
---|
1017 | } |
---|
1018 | } |
---|
1019 | statReponse = serv_carte.getCarteStat(critere, id_param, id_produit, colormap_id.longValue(),classdis_id.longValue(), id_secteur, id_rcp, alt, total, idUnique, zone_demandee, zoom, firstAff, getMaskId()); |
---|
1020 | String sumStr = Double.toString(statReponse.getGlobalSum()); |
---|
1021 | globalSum = fixeDecimal(sumStr); |
---|
1022 | url = statReponse.getUrlImage(); |
---|
1023 | url_legend = serv_carte.getLegendStat(critereBean.getGrille().longValue(), colormap_id.longValue(),classdis_id.longValue(), total, idUnique); |
---|
1024 | |
---|
1025 | ///initialisation du pixel du centre de la zone |
---|
1026 | // zone_affichee = serv_carte.getCarteCoordinate(); |
---|
1027 | CritereBean critereBeanProvisoire = new CritereBean(); |
---|
1028 | critereBeanProvisoire.setBegDate(critereBean.getBegDate()); |
---|
1029 | critereBeanProvisoire.setEndDate(critereBean.getEndDate()); |
---|
1030 | |
---|
1031 | Zone zone_click = new Zone(centerLatClick, centerLatClick, centerLonClick, centerLonClick); |
---|
1032 | |
---|
1033 | critereBeanProvisoire.setEastbc(zone_click.getEastbc()); |
---|
1034 | critereBeanProvisoire.setWestbc(zone_click.getWestbc()); |
---|
1035 | critereBeanProvisoire.setNorthbc(zone_click.getNorthbc()); |
---|
1036 | critereBeanProvisoire.setSouthbc(zone_click.getSouthbc()); |
---|
1037 | critereBeanProvisoire.setDay(critereBean.getDay()); |
---|
1038 | critereBeanProvisoire.setMonth(critereBean.getMonth()); |
---|
1039 | critereBeanProvisoire.setYear(critereBean.getYear()); |
---|
1040 | Map<String, String> critereProvisoire = new TraducteurCarte().tradCritere2TotalReinit(critereBeanProvisoire, this); |
---|
1041 | statReponse = serv_carte.getStatReponse(critereProvisoire, id_param, id_produit, getColormap_id(), getClassdis_id(), id_secteur, id_rcp, alt, total, getMaskId()); |
---|
1042 | |
---|
1043 | // On n'affiche la valeur du pixel cliqué que lors d'un clic sur la carte |
---|
1044 | //ou bien lors d'un recalcul d'un point déjà cliqué |
---|
1045 | if ((clicX != -1 && clicY != -1) || (!firstAff && !pixelCenter.equals(""))) { |
---|
1046 | showPosPixel = true; |
---|
1047 | String aPixelCenter = Double.toString(statReponse.getCenter()); |
---|
1048 | pixelCenter = fixeDecimal(aPixelCenter); |
---|
1049 | centerLat = String.valueOf(statReponse.getCenterLat()); |
---|
1050 | centerLon = String.valueOf(statReponse.getCenterLon()); |
---|
1051 | } else if (firstAff){ |
---|
1052 | showPosPixel = false; |
---|
1053 | pixelCenter = ""; |
---|
1054 | centerLat = ""; |
---|
1055 | centerLon = ""; |
---|
1056 | } |
---|
1057 | } |
---|
1058 | |
---|
1059 | /** |
---|
1060 | * Méthode fournissant l'identifiant de la grille correspondant au masque sélectionné |
---|
1061 | * Si aucun masque n'est sélectionné, retourne 0 |
---|
1062 | */ |
---|
1063 | private long getMaskId() { |
---|
1064 | if (mask.equals("region")) return region.longValue(); |
---|
1065 | else if (mask.equals("country")) return country.longValue(); |
---|
1066 | else return 0; |
---|
1067 | } |
---|
1068 | |
---|
1069 | /** |
---|
1070 | * initialise la valeur de statistique sélectionnée |
---|
1071 | * |
---|
1072 | */ |
---|
1073 | private void initStatistiqueList() { |
---|
1074 | // gridOn = true; |
---|
1075 | // statOn = false; |
---|
1076 | statistique = "moyenneCarte"; |
---|
1077 | if (statistiqueUI != null) |
---|
1078 | statistiqueUI.setValue(statistique); |
---|
1079 | mode = "date"; |
---|
1080 | if (modeUI != null) |
---|
1081 | modeUI.setValue(mode); |
---|
1082 | } |
---|
1083 | |
---|
1084 | private String fixeDecimal(String entree) { |
---|
1085 | // LoggerPerso.log(ServiceStatistique.class, LoggerPerso.DEBUG, "-------------------------------------******------>entree "+entree); |
---|
1086 | if (entree == null) |
---|
1087 | return "nc"; |
---|
1088 | int index = entree.lastIndexOf("."); |
---|
1089 | int indexE = entree.lastIndexOf("E"); |
---|
1090 | // LoggerPerso.log(ServiceStatistique.class, LoggerPerso.DEBUG, "entree ----> == "+indexE+" "+index+" "+entree.length()); |
---|
1091 | if (indexE == -1 && index != -1 && entree.length() >= index + 5) { |
---|
1092 | entree = entree.substring(0, entree.lastIndexOf(".")+5); |
---|
1093 | } else if (indexE != -1 && index != -1 && entree.length() >= index + 5) { |
---|
1094 | String aEntree = entree; |
---|
1095 | // LoggerPerso.log(ServiceStatistique.class, LoggerPerso.DEBUG, "aEntree "+aEntree.lastIndexOf("E")+" "+aEntree.length()+" "+aEntree.lastIndexOf("E")+" "+aEntree.length()); |
---|
1096 | aEntree = aEntree.substring(aEntree.lastIndexOf("E"), aEntree.lastIndexOf("E")+aEntree.length()-aEntree.lastIndexOf("E")); |
---|
1097 | entree = entree.substring(0, entree.lastIndexOf(".")+5)+aEntree; |
---|
1098 | } |
---|
1099 | // LoggerPerso.log(ServiceStatistique.class, LoggerPerso.DEBUG, "entree "+entree); |
---|
1100 | return entree; |
---|
1101 | } |
---|
1102 | |
---|
1103 | /*===================================================== |
---|
1104 | * Getter and Setter |
---|
1105 | ======================================================*/ |
---|
1106 | |
---|
1107 | public String getUnite() { |
---|
1108 | controleSession(); |
---|
1109 | return unite; |
---|
1110 | } |
---|
1111 | |
---|
1112 | public void setUnite(String unite) { |
---|
1113 | this.unite = unite; |
---|
1114 | } |
---|
1115 | |
---|
1116 | public String getParametre() { |
---|
1117 | controleSession(); |
---|
1118 | return parametre; |
---|
1119 | } |
---|
1120 | |
---|
1121 | public void setParametre(String parametre) { |
---|
1122 | this.parametre = parametre; |
---|
1123 | } |
---|
1124 | |
---|
1125 | public String getProduit() { |
---|
1126 | return produit; |
---|
1127 | } |
---|
1128 | |
---|
1129 | public void setProduit(String produit) { |
---|
1130 | this.produit = produit; |
---|
1131 | } |
---|
1132 | |
---|
1133 | public String getVisu() { |
---|
1134 | return visu; |
---|
1135 | } |
---|
1136 | |
---|
1137 | public void setVisu(String visu) { |
---|
1138 | this.visu = visu; |
---|
1139 | } |
---|
1140 | |
---|
1141 | public String getUrl_legend() { |
---|
1142 | return url_legend; |
---|
1143 | } |
---|
1144 | |
---|
1145 | public void setUrl_legend(String url_legend) { |
---|
1146 | this.url_legend = url_legend; |
---|
1147 | } |
---|
1148 | |
---|
1149 | public UIOutput getEastbc() { |
---|
1150 | return eastbc; |
---|
1151 | } |
---|
1152 | |
---|
1153 | public void setEastbc(UIOutput eastbc) { |
---|
1154 | this.eastbc = eastbc; |
---|
1155 | } |
---|
1156 | |
---|
1157 | public UIOutput getNorthbc() { |
---|
1158 | return northbc; |
---|
1159 | } |
---|
1160 | |
---|
1161 | public void setNorthbc(UIOutput northbc) { |
---|
1162 | this.northbc = northbc; |
---|
1163 | } |
---|
1164 | |
---|
1165 | public UIOutput getSouthbc() { |
---|
1166 | return southbc; |
---|
1167 | } |
---|
1168 | |
---|
1169 | public void setSouthbc(UIOutput southbc) { |
---|
1170 | this.southbc = southbc; |
---|
1171 | } |
---|
1172 | |
---|
1173 | public UIOutput getWestbc() { |
---|
1174 | return westbc; |
---|
1175 | } |
---|
1176 | |
---|
1177 | public void setWestbc(UIOutput westbc) { |
---|
1178 | this.westbc = westbc; |
---|
1179 | } |
---|
1180 | |
---|
1181 | public UISelectOne getColormapUI() { |
---|
1182 | return colormapUI; |
---|
1183 | } |
---|
1184 | |
---|
1185 | public void setColormapUI(UISelectOne colormapUI) { |
---|
1186 | this.colormapUI = colormapUI; |
---|
1187 | } |
---|
1188 | |
---|
1189 | public UISelectOne getClassdisUI() { |
---|
1190 | return classdisUI; |
---|
1191 | } |
---|
1192 | |
---|
1193 | public void setClassdisUI(UISelectOne classdisUI) { |
---|
1194 | this.classdisUI = classdisUI; |
---|
1195 | } |
---|
1196 | |
---|
1197 | public String getUrl() { |
---|
1198 | return url; |
---|
1199 | } |
---|
1200 | |
---|
1201 | public void setUrl(String url) { |
---|
1202 | this.url = url; |
---|
1203 | } |
---|
1204 | |
---|
1205 | public Long getColormap_id() { |
---|
1206 | return colormap_id; |
---|
1207 | } |
---|
1208 | |
---|
1209 | public void setColormap_id(Long colormap_id) { |
---|
1210 | this.colormap_id = colormap_id; |
---|
1211 | } |
---|
1212 | |
---|
1213 | public Long getClassdis_id() { |
---|
1214 | return classdis_id; |
---|
1215 | } |
---|
1216 | |
---|
1217 | public void setClassdis_id(Long classdis_id) { |
---|
1218 | this.classdis_id = classdis_id; |
---|
1219 | } |
---|
1220 | |
---|
1221 | public List<SelectItem> getListe_colormap() { |
---|
1222 | return liste_colormap; |
---|
1223 | } |
---|
1224 | |
---|
1225 | public void setListe_colormap(List<SelectItem> liste_colormap) { |
---|
1226 | this.liste_colormap = liste_colormap; |
---|
1227 | } |
---|
1228 | |
---|
1229 | public List<SelectItem> getListe_classdis() { |
---|
1230 | return liste_classdis; |
---|
1231 | } |
---|
1232 | |
---|
1233 | public void setListe_classdis(List<SelectItem> liste_classdis) { |
---|
1234 | this.liste_classdis = liste_classdis; |
---|
1235 | } |
---|
1236 | |
---|
1237 | public int getClicX() { |
---|
1238 | return clicX; |
---|
1239 | } |
---|
1240 | |
---|
1241 | public void setClicX(int clicX) { |
---|
1242 | this.clicX = clicX; |
---|
1243 | } |
---|
1244 | |
---|
1245 | public int getClicY() { |
---|
1246 | return clicY; |
---|
1247 | } |
---|
1248 | |
---|
1249 | public void setClicY(int clicY) { |
---|
1250 | this.clicY = clicY; |
---|
1251 | } |
---|
1252 | |
---|
1253 | public Zone getZone_demandee() { |
---|
1254 | return zone_demandee; |
---|
1255 | } |
---|
1256 | |
---|
1257 | public void setZone_demandee(Zone zone_demandee) { |
---|
1258 | this.zone_demandee = zone_demandee; |
---|
1259 | } |
---|
1260 | |
---|
1261 | public String getStatistique() { |
---|
1262 | return statistique; |
---|
1263 | } |
---|
1264 | |
---|
1265 | public void setStatistique(String statistique) { |
---|
1266 | this.statistique = statistique; |
---|
1267 | } |
---|
1268 | |
---|
1269 | public UISelectOne getStatistiqueUI() { |
---|
1270 | return statistiqueUI; |
---|
1271 | } |
---|
1272 | |
---|
1273 | public void setStatistiqueUI(UISelectOne statistiqueUI) { |
---|
1274 | this.statistiqueUI = statistiqueUI; |
---|
1275 | } |
---|
1276 | |
---|
1277 | public int getNbrGrille() { |
---|
1278 | return nbrGrille; |
---|
1279 | } |
---|
1280 | |
---|
1281 | public void setNbrGrille(int nbrGrille) { |
---|
1282 | this.nbrGrille = nbrGrille; |
---|
1283 | } |
---|
1284 | |
---|
1285 | // public boolean isGridOn() { |
---|
1286 | // return gridOn; |
---|
1287 | // } |
---|
1288 | |
---|
1289 | // public void setGridOn(boolean gridOn) { |
---|
1290 | // this.gridOn = gridOn; |
---|
1291 | // } |
---|
1292 | |
---|
1293 | // public boolean isStatOn() { |
---|
1294 | // return statOn; |
---|
1295 | // } |
---|
1296 | |
---|
1297 | // public void setStatOn(boolean statOn) { |
---|
1298 | // this.statOn = statOn; |
---|
1299 | // } |
---|
1300 | |
---|
1301 | public String getMapTitle() { |
---|
1302 | return mapTitle; |
---|
1303 | } |
---|
1304 | |
---|
1305 | public void setMapTitle(String mapTitle) { |
---|
1306 | this.mapTitle = mapTitle; |
---|
1307 | } |
---|
1308 | |
---|
1309 | public UIOutput getMapTitleUI() { |
---|
1310 | return mapTitleUI; |
---|
1311 | } |
---|
1312 | |
---|
1313 | public void setMapTitleUI(UIOutput mapTitleUI) { |
---|
1314 | this.mapTitleUI = mapTitleUI; |
---|
1315 | } |
---|
1316 | |
---|
1317 | public double getMinParam() { |
---|
1318 | return minParam; |
---|
1319 | } |
---|
1320 | |
---|
1321 | public void setMinParam(double aMinParam) { |
---|
1322 | this.minParam = aMinParam; |
---|
1323 | } |
---|
1324 | |
---|
1325 | public UIInput getMinParamUI() { |
---|
1326 | return minParamUI; |
---|
1327 | } |
---|
1328 | |
---|
1329 | public void setMinParamUI(UIInput aMinParamUI) { |
---|
1330 | this.minParamUI = aMinParamUI; |
---|
1331 | } |
---|
1332 | |
---|
1333 | public double getMaxParam() { |
---|
1334 | return maxParam; |
---|
1335 | } |
---|
1336 | |
---|
1337 | public void setMaxParam(double aMaxParam) { |
---|
1338 | this.maxParam = aMaxParam; |
---|
1339 | } |
---|
1340 | |
---|
1341 | public UIInput getMaxParamUI() { |
---|
1342 | return maxParamUI; |
---|
1343 | } |
---|
1344 | |
---|
1345 | public void setMaxParamUI(UIInput aMaxParamUI) { |
---|
1346 | this.maxParamUI = aMaxParamUI; |
---|
1347 | } |
---|
1348 | |
---|
1349 | public Long getNbrClasses() { |
---|
1350 | return nbrClasses; |
---|
1351 | } |
---|
1352 | |
---|
1353 | public void setNbrClasses(Long aNbrClasses) { |
---|
1354 | this.nbrClasses = aNbrClasses; |
---|
1355 | } |
---|
1356 | |
---|
1357 | public UISelectOne getNbrClassesUI() { |
---|
1358 | return nbrClassesUI; |
---|
1359 | } |
---|
1360 | |
---|
1361 | public void setNbrClassesUI(UISelectOne aNbrClassesUI) { |
---|
1362 | this.nbrClassesUI = aNbrClassesUI; |
---|
1363 | } |
---|
1364 | |
---|
1365 | public String getPixelCenter() { |
---|
1366 | return pixelCenter; |
---|
1367 | } |
---|
1368 | |
---|
1369 | public void setPixelCenter(String aPixelCenter) { |
---|
1370 | this.pixelCenter = aPixelCenter; |
---|
1371 | } |
---|
1372 | |
---|
1373 | public String getCenterLon() { |
---|
1374 | return centerLon; |
---|
1375 | } |
---|
1376 | |
---|
1377 | public void setCenterLon(String aCenterLon) { |
---|
1378 | this.centerLon = aCenterLon; |
---|
1379 | } |
---|
1380 | |
---|
1381 | public String getCenterLat() { |
---|
1382 | return centerLat; |
---|
1383 | } |
---|
1384 | |
---|
1385 | public void setCenterLat(String aCenterLat) { |
---|
1386 | this.centerLat = aCenterLat; |
---|
1387 | } |
---|
1388 | |
---|
1389 | public double getCenterLonClick() { |
---|
1390 | return centerLonClick; |
---|
1391 | } |
---|
1392 | |
---|
1393 | public void setCenterLonClick(double aCenterLonClick) { |
---|
1394 | this.centerLonClick = aCenterLonClick; |
---|
1395 | } |
---|
1396 | |
---|
1397 | public double getCenterLatClick() { |
---|
1398 | return centerLatClick; |
---|
1399 | } |
---|
1400 | |
---|
1401 | public void setCenterLatClick(double aCenterLatClick) { |
---|
1402 | this.centerLatClick = aCenterLatClick; |
---|
1403 | } |
---|
1404 | |
---|
1405 | public UIOutput PixelCenterUI() { |
---|
1406 | return pixelCenterUI; |
---|
1407 | } |
---|
1408 | |
---|
1409 | public void setPixelCenterUI(UIOutput aPixelCenterUI) { |
---|
1410 | this.pixelCenterUI = aPixelCenterUI; |
---|
1411 | } |
---|
1412 | |
---|
1413 | public double getResolution() { |
---|
1414 | return resolution; |
---|
1415 | } |
---|
1416 | |
---|
1417 | public void setResolution(double aResolution) { |
---|
1418 | this.resolution = aResolution; |
---|
1419 | } |
---|
1420 | |
---|
1421 | public String getSecteur() { |
---|
1422 | return secteur; |
---|
1423 | } |
---|
1424 | |
---|
1425 | public void setSecteur(String secteur) { |
---|
1426 | this.secteur = secteur; |
---|
1427 | } |
---|
1428 | |
---|
1429 | public String getRcp() { |
---|
1430 | return rcp; |
---|
1431 | } |
---|
1432 | |
---|
1433 | public void setRcp(String rcp) { |
---|
1434 | this.rcp = rcp; |
---|
1435 | } |
---|
1436 | |
---|
1437 | public String getColormap_txt() { |
---|
1438 | return colormap_txt; |
---|
1439 | } |
---|
1440 | |
---|
1441 | public void setColormap_txt(String colormapTxt) { |
---|
1442 | colormap_txt = colormapTxt; |
---|
1443 | } |
---|
1444 | |
---|
1445 | public String getTypeCodif() { |
---|
1446 | return typeCodif; |
---|
1447 | } |
---|
1448 | |
---|
1449 | public void setTypeCodif(String typeCodif) { |
---|
1450 | this.typeCodif = typeCodif; |
---|
1451 | } |
---|
1452 | |
---|
1453 | public String getMode() { |
---|
1454 | return mode; |
---|
1455 | } |
---|
1456 | |
---|
1457 | public void setMode(String mode) { |
---|
1458 | this.mode = mode; |
---|
1459 | } |
---|
1460 | |
---|
1461 | public UISelectOne getModeUI() { |
---|
1462 | return modeUI; |
---|
1463 | } |
---|
1464 | |
---|
1465 | public void setModeUI(UISelectOne modeUI) { |
---|
1466 | this.modeUI = modeUI; |
---|
1467 | } |
---|
1468 | |
---|
1469 | public boolean isShowPosPixel() { |
---|
1470 | return showPosPixel; |
---|
1471 | } |
---|
1472 | |
---|
1473 | public void setShowPosPixel(boolean showPosPixel) { |
---|
1474 | this.showPosPixel = showPosPixel; |
---|
1475 | } |
---|
1476 | |
---|
1477 | public String getTotal() { |
---|
1478 | return total; |
---|
1479 | } |
---|
1480 | |
---|
1481 | public void setTotal(String total) { |
---|
1482 | this.total = total; |
---|
1483 | } |
---|
1484 | |
---|
1485 | public UISelectOne getTotalUI() { |
---|
1486 | return totalUI; |
---|
1487 | } |
---|
1488 | |
---|
1489 | public void setTotalUI(UISelectOne totalUI) { |
---|
1490 | this.totalUI = totalUI; |
---|
1491 | } |
---|
1492 | |
---|
1493 | public int getNbrAlt() { |
---|
1494 | return nbrAlt; |
---|
1495 | } |
---|
1496 | |
---|
1497 | public void setNbrAlt(int nbrAlt) { |
---|
1498 | this.nbrAlt = nbrAlt; |
---|
1499 | } |
---|
1500 | |
---|
1501 | public String getGlobalSum() { |
---|
1502 | return globalSum; |
---|
1503 | } |
---|
1504 | |
---|
1505 | public void setGlobalSum(String globalSum) { |
---|
1506 | this.globalSum = globalSum; |
---|
1507 | } |
---|
1508 | |
---|
1509 | public Zone getZone_visible() { |
---|
1510 | return zone_visible; |
---|
1511 | } |
---|
1512 | |
---|
1513 | public void setZone_visible(Zone zoneVisible) { |
---|
1514 | zone_visible = zoneVisible; |
---|
1515 | } |
---|
1516 | |
---|
1517 | public String getMask() { |
---|
1518 | return mask; |
---|
1519 | } |
---|
1520 | |
---|
1521 | public void setMask(String mask) { |
---|
1522 | this.mask = mask; |
---|
1523 | } |
---|
1524 | |
---|
1525 | public UISelectOne getMaskUI() { |
---|
1526 | return maskUI; |
---|
1527 | } |
---|
1528 | |
---|
1529 | public void setMaskUI(UISelectOne maskUI) { |
---|
1530 | this.maskUI = maskUI; |
---|
1531 | } |
---|
1532 | |
---|
1533 | public List<SelectItem> getListe_region() { |
---|
1534 | return liste_region; |
---|
1535 | } |
---|
1536 | |
---|
1537 | public void setListe_region(List<SelectItem> listeRegion) { |
---|
1538 | liste_region = listeRegion; |
---|
1539 | } |
---|
1540 | |
---|
1541 | public Long getRegion() { |
---|
1542 | return region; |
---|
1543 | } |
---|
1544 | |
---|
1545 | public void setRegion(Long region) { |
---|
1546 | this.region = region; |
---|
1547 | } |
---|
1548 | |
---|
1549 | public UISelectOne getRegionUI() { |
---|
1550 | return regionUI; |
---|
1551 | } |
---|
1552 | |
---|
1553 | public void setRegionUI(UISelectOne regionUI) { |
---|
1554 | this.regionUI = regionUI; |
---|
1555 | } |
---|
1556 | |
---|
1557 | public List<SelectItem> getListe_country() { |
---|
1558 | return liste_country; |
---|
1559 | } |
---|
1560 | |
---|
1561 | public void setListe_country(List<SelectItem> listeCountry) { |
---|
1562 | liste_country = listeCountry; |
---|
1563 | } |
---|
1564 | |
---|
1565 | public Long getCountry() { |
---|
1566 | return country; |
---|
1567 | } |
---|
1568 | |
---|
1569 | public void setCountry(Long country) { |
---|
1570 | this.country = country; |
---|
1571 | } |
---|
1572 | |
---|
1573 | public UISelectOne getCountryUI() { |
---|
1574 | return countryUI; |
---|
1575 | } |
---|
1576 | |
---|
1577 | public void setCountryUI(UISelectOne countryUI) { |
---|
1578 | this.countryUI = countryUI; |
---|
1579 | } |
---|
1580 | |
---|
1581 | public String getRegionName() { |
---|
1582 | return regionName; |
---|
1583 | } |
---|
1584 | |
---|
1585 | public void setRegionName(String regionName) { |
---|
1586 | this.regionName = regionName; |
---|
1587 | } |
---|
1588 | |
---|
1589 | public String getCountryName() { |
---|
1590 | return countryName; |
---|
1591 | } |
---|
1592 | |
---|
1593 | public void setCountryName(String countryName) { |
---|
1594 | this.countryName = countryName; |
---|
1595 | } |
---|
1596 | |
---|
1597 | public List<SelectItem> getListe_mask() { |
---|
1598 | return liste_mask; |
---|
1599 | } |
---|
1600 | |
---|
1601 | public void setListe_mask(List<SelectItem> listeMask) { |
---|
1602 | liste_mask = listeMask; |
---|
1603 | } |
---|
1604 | } |
---|