Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java @ 327:22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
gnv-artifacts/trunk@393 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 02 Dec 2009 10:50:12 +0000 |
parents | 3eff9241ea1e |
children | 1c427acb6c76 |
comparison
equal
deleted
inserted
replaced
326:37847d724fc9 | 327:22a6493e8460 |
---|---|
216 ChartLabels chartLables = new ChartLabels(this.getFisName(callMeta.getLanguages())+" "+this | 216 ChartLabels chartLables = new ChartLabels(this.getFisName(callMeta.getLanguages())+" "+this |
217 .getSelectedFeatureName(uuid), this.domainLable); | 217 .getSelectedFeatureName(uuid), this.domainLable); |
218 | 218 |
219 String exportFormat = getExportFormat(mimeType); | 219 String exportFormat = getExportFormat(mimeType); |
220 | 220 |
221 // TODO Remove this and parse input data | |
222 boolean linesVisible = true; | |
223 boolean shapesVisible = true; | |
224 | |
221 PreferredLocale[] locales = callMeta.getLanguages(); | 225 PreferredLocale[] locales = callMeta.getLanguages(); |
222 Locale[] serverLocales = | 226 Locale[] serverLocales = |
223 RessourceFactory.getInstance().getLocales(); | 227 RessourceFactory.getInstance().getLocales(); |
224 Locale locale = | 228 Locale locale = |
225 callMeta.getPreferredLocale(serverLocales); | 229 callMeta.getPreferredLocale(serverLocales); |
237 chartLables, | 241 chartLables, |
238 uuid, | 242 uuid, |
239 exportFormat, | 243 exportFormat, |
240 locale, | 244 locale, |
241 chartWidth, | 245 chartWidth, |
242 chartHeight | 246 chartHeight, |
247 linesVisible, | |
248 shapesVisible | |
243 ); | 249 ); |
244 } | 250 } |
245 else if (outputMode.equalsIgnoreCase("pdf")) { | 251 else if (outputMode.equalsIgnoreCase("pdf")) { |
246 log.debug("Output mode == pdf"); | 252 log.debug("Output mode == pdf"); |
247 | 253 |
248 Locale[] serverLocales = | 254 Locale[] serverLocales = |
249 RessourceFactory.getInstance().getLocales(); | 255 RessourceFactory.getInstance().getLocales(); |
250 Locale locale = | 256 Locale locale = |
251 callMeta.getPreferredLocale(serverLocales); | 257 callMeta.getPreferredLocale(serverLocales); |
258 | |
259 // TODO Remove this and parse input data | |
260 boolean linesVisible = true; | |
261 boolean shapesVisible = true; | |
252 | 262 |
253 log.debug( | 263 log.debug( |
254 "Best locale - regarding intersection of server and " + | 264 "Best locale - regarding intersection of server and " + |
255 "browser locales - is " + locale.toString() | 265 "browser locales - is " + locale.toString() |
256 ); | 266 ); |
265 " "+ getSelectedFeatureName(uuid), | 275 " "+ getSelectedFeatureName(uuid), |
266 this.domainLable), | 276 this.domainLable), |
267 uuid, | 277 uuid, |
268 "A4", | 278 "A4", |
269 true, | 279 true, |
270 locale | 280 locale, |
281 linesVisible, | |
282 shapesVisible | |
271 ); | 283 ); |
272 } | 284 } |
273 else if (outputMode.equalsIgnoreCase("svg")) { | 285 else if (outputMode.equalsIgnoreCase("svg")) { |
274 log.debug("Output mode == svg"); | 286 log.debug("Output mode == svg"); |
275 int width = 600; | 287 int width = 600; |
276 int height = 400; | 288 int height = 400; |
289 | |
290 // TODO Remove this and parse input data | |
291 boolean linesVisible = true; | |
292 boolean shapesVisible = true; | |
277 | 293 |
278 Locale[] serverLocales = | 294 Locale[] serverLocales = |
279 RessourceFactory.getInstance().getLocales(); | 295 RessourceFactory.getInstance().getLocales(); |
280 Locale locale = | 296 Locale locale = |
281 callMeta.getPreferredLocale(serverLocales); | 297 callMeta.getPreferredLocale(serverLocales); |
295 " "+ getSelectedFeatureName(uuid), | 311 " "+ getSelectedFeatureName(uuid), |
296 this.domainLable), | 312 this.domainLable), |
297 uuid, | 313 uuid, |
298 locale, | 314 locale, |
299 width, | 315 width, |
300 height | 316 height, |
317 linesVisible, | |
318 shapesVisible | |
301 ); | 319 ); |
302 } | 320 } |
303 else if (outputMode.equalsIgnoreCase("csv")) { | 321 else if (outputMode.equalsIgnoreCase("csv")) { |
304 log.debug("CSV-File will be generated."); | 322 log.debug("CSV-File will be generated."); |
305 Collection<Result> chartResult = this.getChartResult(uuid); | 323 Collection<Result> chartResult = this.getChartResult(uuid); |
471 ChartLabels chartLables, | 489 ChartLabels chartLables, |
472 String uuid, | 490 String uuid, |
473 String exportFormat, | 491 String exportFormat, |
474 Locale locale, | 492 Locale locale, |
475 int width, | 493 int width, |
476 int height | 494 int height, |
495 boolean linesVisible, | |
496 boolean shapesVisible | |
477 ) | 497 ) |
478 throws IOException, TechnicalChartException | 498 throws IOException, TechnicalChartException |
479 { | 499 { |
480 log.debug("Create chart."); | 500 log.debug("Create chart."); |
481 Chart chart = getChart( | 501 Chart chart = getChart( |
483 parameters, | 503 parameters, |
484 measurements, | 504 measurements, |
485 dates, | 505 dates, |
486 getChartResult(uuid), | 506 getChartResult(uuid), |
487 locale, // Locale | 507 locale, // Locale |
488 uuid | 508 uuid, |
509 linesVisible, | |
510 shapesVisible | |
489 ); | 511 ); |
490 | 512 |
491 if (chart == null) { | 513 if (chart == null) { |
492 log.error("Could not initialize chart."); | 514 log.error("Could not initialize chart."); |
493 return; | 515 return; |
515 Collection dates, | 537 Collection dates, |
516 ChartLabels chartLables, | 538 ChartLabels chartLables, |
517 String uuid, | 539 String uuid, |
518 String exportFormat, | 540 String exportFormat, |
519 boolean landscape, | 541 boolean landscape, |
520 Locale locale | 542 Locale locale, |
543 boolean linesVisible, | |
544 boolean shapesVisible | |
521 ) { | 545 ) { |
522 Chart chart = getChart( | 546 Chart chart = getChart( |
523 chartLables, | 547 chartLables, |
524 parameters, | 548 parameters, |
525 measurements, | 549 measurements, |
526 dates, | 550 dates, |
527 getChartResult(uuid), | 551 getChartResult(uuid), |
528 locale, | 552 locale, |
529 uuid | 553 uuid, |
554 linesVisible, | |
555 shapesVisible | |
530 ); | 556 ); |
531 | 557 |
532 if (chart == null) { | 558 if (chart == null) { |
533 log.error("Could not initialize chart."); | 559 log.error("Could not initialize chart."); |
534 return; | 560 return; |
564 Collection dates, | 590 Collection dates, |
565 ChartLabels chartLables, | 591 ChartLabels chartLables, |
566 String uuid, | 592 String uuid, |
567 Locale locale, | 593 Locale locale, |
568 int width, | 594 int width, |
569 int height | 595 int height, |
596 boolean linesVisible, | |
597 boolean shapesVisible | |
570 ) { | 598 ) { |
571 Chart chart = getChart( | 599 Chart chart = getChart( |
572 chartLables, | 600 chartLables, |
573 parameters, | 601 parameters, |
574 measurements, | 602 measurements, |
575 dates, | 603 dates, |
576 getChartResult(uuid), | 604 getChartResult(uuid), |
577 locale, | 605 locale, |
578 uuid | 606 uuid, |
607 linesVisible, | |
608 shapesVisible | |
579 ); | 609 ); |
580 | 610 |
581 if (chart == null) { | 611 if (chart == null) { |
582 log.error("Could not initialize chart."); | 612 log.error("Could not initialize chart."); |
583 return; | 613 return; |
599 Collection parameters, | 629 Collection parameters, |
600 Collection measurements, | 630 Collection measurements, |
601 Collection dates, | 631 Collection dates, |
602 Collection result, | 632 Collection result, |
603 Locale locale, | 633 Locale locale, |
604 String uuid | 634 String uuid, |
635 boolean linesVisible, | |
636 boolean shapesVisible | |
605 ) { | 637 ) { |
606 Chart chart = null; | 638 Chart chart = null; |
607 | 639 |
608 if (CACHE_CHART) { | 640 if (CACHE_CHART) { |
609 log.info("Try to get timeseries chart from cache."); | 641 log.info("Try to get timeseries chart from cache."); |
620 parameters, | 652 parameters, |
621 measurements, | 653 measurements, |
622 dates, | 654 dates, |
623 result, | 655 result, |
624 timeGapDefinitions, | 656 timeGapDefinitions, |
625 locale | 657 locale, |
658 linesVisible, | |
659 shapesVisible | |
626 ); | 660 ); |
627 chart.generateChart(); | 661 chart.generateChart(); |
628 | 662 |
629 if (CACHE_CHART) { | 663 if (CACHE_CHART) { |
630 log.info("Put chart into cache."); | 664 log.info("Put chart into cache."); |