Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java @ 1052:b30361464775
The pdf format depends on the chart's aspect ratio (issue290).
gnv-artifacts/trunk@1126 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 26 May 2010 06:45:03 +0000 |
parents | 7f3154331bc1 |
children | 6169ddc827ac |
comparison
equal
deleted
inserted
replaced
1051:8f836fb6f592 | 1052:b30361464775 |
---|---|
83 */ | 83 */ |
84 protected static final boolean CACHE_CHART = | 84 protected static final boolean CACHE_CHART = |
85 Boolean.parseBoolean(System.getProperty("cache.chart", "false")); | 85 Boolean.parseBoolean(System.getProperty("cache.chart", "false")); |
86 | 86 |
87 /** | 87 /** |
88 * A field parsing a system property to adjust the alignment of pdf exports. | |
89 * The system property is 'export.pdf.landscape' and should be true or | |
90 * false. If this property is true, PDFs will be created in landscape | |
91 * format. | |
92 */ | |
93 protected static final boolean PDF_FORMAT_LANDSCAPE = | |
94 Boolean.parseBoolean(System.getProperty("export.pdf.landscape","true")); | |
95 | |
96 /** | |
97 * Supported image export formats. | 88 * Supported image export formats. |
98 */ | 89 */ |
99 protected static final String[] IMG_EXPORT_FORMAT = { | 90 protected static final String[] IMG_EXPORT_FORMAT = { |
100 "PNG", "JPEG", "GIF" | 91 "PNG", "JPEG", "GIF" |
101 }; | 92 }; |
387 measurements, | 378 measurements, |
388 dates, | 379 dates, |
389 chartLables, | 380 chartLables, |
390 uuid, | 381 uuid, |
391 "A4", | 382 "A4", |
392 true, | |
393 callContext | 383 callContext |
394 ); | 384 ); |
395 } | 385 } |
396 else if (mode.equalsIgnoreCase("svg")) { | 386 else if (mode.equalsIgnoreCase("svg")) { |
397 createSVG( | 387 createSVG( |
443 else if (mode.equalsIgnoreCase("pdf")) { | 433 else if (mode.equalsIgnoreCase("pdf")) { |
444 ChartExportHelper.exportHistogramsAsPDF( | 434 ChartExportHelper.exportHistogramsAsPDF( |
445 outputStream, | 435 outputStream, |
446 histograms, | 436 histograms, |
447 "A4", | 437 "A4", |
448 PDF_FORMAT_LANDSCAPE, | 438 true, |
449 50F, 50F, 50F, 50F | 439 50F, 50F, 50F, 50F |
450 ); | 440 ); |
451 } | 441 } |
452 else if (mode.equalsIgnoreCase("svg")) { | 442 else if (mode.equalsIgnoreCase("svg")) { |
453 ChartExportHelper.exportHistogramsAsSVG( | 443 ChartExportHelper.exportHistogramsAsSVG( |
846 Collection measurements, | 836 Collection measurements, |
847 Collection dates, | 837 Collection dates, |
848 ChartLabels chartLables, | 838 ChartLabels chartLables, |
849 String uuid, | 839 String uuid, |
850 String exportFormat, | 840 String exportFormat, |
851 boolean landscape, | |
852 CallContext context | 841 CallContext context |
853 ) { | 842 ) { |
854 Chart chart = getChart( | 843 Chart chart = getChart( |
855 chartLables, | 844 chartLables, |
856 createStyle(context), | 845 createStyle(context), |
872 | 861 |
873 ChartExportHelper.exportPDF( | 862 ChartExportHelper.exportPDF( |
874 outputStream, | 863 outputStream, |
875 chart.generateChart(), | 864 chart.generateChart(), |
876 "A4", | 865 "A4", |
877 PDF_FORMAT_LANDSCAPE, | |
878 50F, 50F, 50F, 50F, | 866 50F, 50F, 50F, 50F, |
879 context | 867 context |
880 ); | 868 ); |
881 } | 869 } |
882 | 870 |