Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 1930:de0c2bbb27f9
Cosmetics, docs.
flys-artifacts/trunk@3310 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 23 Nov 2011 14:09:29 +0000 |
parents | 11c4b1429117 |
children | 7c52e9cb2a72 |
comparison
equal
deleted
inserted
replaced
1929:6b0ae0f2cae6 | 1930:de0c2bbb27f9 |
---|---|
101 JFreeChart chart = generateChart(); | 101 JFreeChart chart = generateChart(); |
102 | 102 |
103 String format = getFormat(); | 103 String format = getFormat(); |
104 int[] size = getSize(); | 104 int[] size = getSize(); |
105 | 105 |
106 context.putContextValue("chart.width", size[0]); | 106 context.putContextValue("chart.width", size[0]); |
107 context.putContextValue("chart.height", size[1]); | 107 context.putContextValue("chart.height", size[1]); |
108 | 108 |
109 if (format.equals(ChartExportHelper.FORMAT_PNG)) { | 109 if (format.equals(ChartExportHelper.FORMAT_PNG)) { |
110 context.putContextValue("chart.image.format", "png"); | 110 context.putContextValue("chart.image.format", "png"); |
111 | 111 |
113 out, | 113 out, |
114 chart, | 114 chart, |
115 context); | 115 context); |
116 } | 116 } |
117 else if (format.equals(ChartExportHelper.FORMAT_PDF)) { | 117 else if (format.equals(ChartExportHelper.FORMAT_PDF)) { |
118 context.putContextValue("chart.marginLeft", 5f); | 118 context.putContextValue("chart.marginLeft", 5f); |
119 context.putContextValue("chart.marginRight", 5f); | 119 context.putContextValue("chart.marginRight", 5f); |
120 context.putContextValue("chart.marginTop", 5f); | 120 context.putContextValue("chart.marginTop", 5f); |
121 context.putContextValue("chart.marginBottom", 5f); | 121 context.putContextValue("chart.marginBottom", 5f); |
122 context.putContextValue( | 122 context.putContextValue( |
123 "chart.page.format", | 123 "chart.page.format", |
124 ChartExportHelper.DEFAULT_PAGE_SIZE); | 124 ChartExportHelper.DEFAULT_PAGE_SIZE); |
125 | 125 |
139 context); | 139 context); |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 | 143 |
144 /** | |
145 * Generate the chart anew (including localized axis and all). | |
146 */ | |
144 public JFreeChart generateChart() { | 147 public JFreeChart generateChart() { |
145 logger.debug("XYChartGenerator.generateChart"); | 148 logger.debug("XYChartGenerator.generateChart"); |
146 | 149 |
147 JFreeChart chart = ChartFactory.createXYLineChart( | 150 JFreeChart chart = ChartFactory.createXYLineChart( |
148 getChartTitle(), | 151 getChartTitle(), |
246 | 249 |
247 xRanges.put(key, newX); | 250 xRanges.put(key, newX); |
248 } | 251 } |
249 | 252 |
250 | 253 |
254 /** | |
255 * @param range the new range. | |
256 */ | |
251 private void combineYRanges(Range range, int index) { | 257 private void combineYRanges(Range range, int index) { |
252 Integer key = Integer.valueOf(index); | 258 Integer key = Integer.valueOf(index); |
253 | 259 |
254 if (yRanges == null) { | 260 if (yRanges == null) { |
255 yRanges = new HashMap<Integer, Range>(); | 261 yRanges = new HashMap<Integer, Range>(); |