Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/CrossSectionGenerator.java @ 8202:e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 12:58:17 +0200 |
parents | ed8623b989f3 |
children | c086b06b81e5 |
comparison
equal
deleted
inserted
replaced
8201:4b8c5a08de04 | 8202:e4606eae8ea5 |
---|---|
45 */ | 45 */ |
46 public class CrossSectionGenerator | 46 public class CrossSectionGenerator |
47 extends LongitudinalSectionGenerator | 47 extends LongitudinalSectionGenerator |
48 implements FacetTypes | 48 implements FacetTypes |
49 { | 49 { |
50 /** The logger that is used in this generator. */ | 50 /** The log that is used in this generator. */ |
51 private static Logger logger = | 51 private static Logger log = |
52 Logger.getLogger(CrossSectionGenerator.class); | 52 Logger.getLogger(CrossSectionGenerator.class); |
53 | 53 |
54 public static final String I18N_CHART_TITLE = | 54 public static final String I18N_CHART_TITLE = |
55 "chart.cross_section.title"; | 55 "chart.cross_section.title"; |
56 | 56 |
130 Object[] args = new Object[] { | 130 Object[] args = new Object[] { |
131 getRiverName(), | 131 getRiverName(), |
132 km | 132 km |
133 }; | 133 }; |
134 | 134 |
135 logger.debug("Locale: " + Resources.getLocale(context.getMeta())); | 135 log.debug("Locale: " + Resources.getLocale(context.getMeta())); |
136 | 136 |
137 return msg(I18N_CHART_SUBTITLE, "", args); | 137 return msg(I18N_CHART_SUBTITLE, "", args); |
138 } | 138 } |
139 | 139 |
140 | 140 |
156 // Blueish. | 156 // Blueish. |
157 return new Color(0, 0, 255); | 157 return new Color(0, 0, 255); |
158 } | 158 } |
159 else { | 159 else { |
160 // Default. | 160 // Default. |
161 logger.debug("Unknown zone type found."); | 161 log.debug("Unknown zone type found."); |
162 return new Color(255, 0, 0); | 162 return new Color(255, 0, 0); |
163 } | 163 } |
164 } | 164 } |
165 | 165 |
166 @Override | 166 @Override |
257 ThemeDocument attr, | 257 ThemeDocument attr, |
258 boolean visible | 258 boolean visible |
259 ) { | 259 ) { |
260 String name = artifactFacet.getFacetName(); | 260 String name = artifactFacet.getFacetName(); |
261 | 261 |
262 logger.debug("CrossSectionGenerator.doOut: " + name); | 262 log.debug("CrossSectionGenerator.doOut: " + name); |
263 | 263 |
264 if (name == null) { | 264 if (name == null) { |
265 logger.error("No facet name for doOut(). No output generated!"); | 265 log.error("No facet name for doOut(). No output generated!"); |
266 return; | 266 return; |
267 } | 267 } |
268 | 268 |
269 if (name.equals(CROSS_SECTION)) { | 269 if (name.equals(CROSS_SECTION)) { |
270 doCrossSectionOut( | 270 doCrossSectionOut( |
303 doPoints(artifactFacet.getData(context), | 303 doPoints(artifactFacet.getData(context), |
304 artifactFacet, | 304 artifactFacet, |
305 attr, visible, YAXIS.W.idx); | 305 attr, visible, YAXIS.W.idx); |
306 } | 306 } |
307 else { | 307 else { |
308 logger.warn("CrossSection.doOut: Unknown facet name: " + name); | 308 log.warn("CrossSection.doOut: Unknown facet name: " + name); |
309 return; | 309 return; |
310 } | 310 } |
311 } | 311 } |
312 | 312 |
313 | 313 |
329 Object o, | 329 Object o, |
330 String seriesName, | 330 String seriesName, |
331 ThemeDocument theme, | 331 ThemeDocument theme, |
332 boolean visible | 332 boolean visible |
333 ) { | 333 ) { |
334 logger.debug("CrossSectionGenerator.doCrossSectionWaterLineOut"); | 334 log.debug("CrossSectionGenerator.doCrossSectionWaterLineOut"); |
335 | 335 |
336 Lines.LineData lines = (Lines.LineData) o; | 336 Lines.LineData lines = (Lines.LineData) o; |
337 // DO NOT SORT DATA! This destroys the gaps indicated by NaNs. | 337 // DO NOT SORT DATA! This destroys the gaps indicated by NaNs. |
338 StyledXYSeries series = new StyledXYSeries(seriesName, false, theme); | 338 StyledXYSeries series = new StyledXYSeries(seriesName, false, theme); |
339 | 339 |
388 Object o, | 388 Object o, |
389 String seriesName, | 389 String seriesName, |
390 ThemeDocument theme, | 390 ThemeDocument theme, |
391 boolean visible | 391 boolean visible |
392 ) { | 392 ) { |
393 logger.debug("CrossSectionGenerator.doHyk"); | 393 log.debug("CrossSectionGenerator.doHyk"); |
394 | 394 |
395 List<HYKFactory.Zone> zones = (List<HYKFactory.Zone>) o; | 395 List<HYKFactory.Zone> zones = (List<HYKFactory.Zone>) o; |
396 | 396 |
397 if (zones == null || zones.isEmpty()) { | 397 if (zones == null || zones.isEmpty()) { |
398 logger.warn("CrossSectionGenerator.doHYK: empty zone list received."); | 398 log.warn("CrossSectionGenerator.doHYK: empty zone list received."); |
399 return; | 399 return; |
400 } | 400 } |
401 | 401 |
402 // Actual Styling is done in XYChartGenerator. | 402 // Actual Styling is done in XYChartGenerator. |
403 if (visible) { | 403 if (visible) { |
416 Object o, | 416 Object o, |
417 String seriesName, | 417 String seriesName, |
418 ThemeDocument theme, | 418 ThemeDocument theme, |
419 boolean visible | 419 boolean visible |
420 ) { | 420 ) { |
421 logger.debug("CrossSectionGenerator.doCrossSectionOut"); | 421 log.debug("CrossSectionGenerator.doCrossSectionOut"); |
422 | 422 |
423 XYSeries series = new StyledXYSeries(seriesName, theme); | 423 XYSeries series = new StyledXYSeries(seriesName, theme); |
424 | 424 |
425 StyledSeriesBuilder.addPoints(series, (double [][]) o, false); | 425 StyledSeriesBuilder.addPoints(series, (double [][]) o, false); |
426 | 426 |