comparison gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java @ 468:7ba4c7222265

Added ij-Index determination for horizontal-cross-sections. gnv-artifacts/trunk@531 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 12 Jan 2010 11:34:25 +0000
parents 07672838fa5f
children d6a100d5f74a
comparison
equal deleted inserted replaced
467:b2d2b36b20a0 468:7ba4c7222265
70 "palette"; 70 "palette";
71 71
72 public final static String HORIZONTAL_CROSS_SECTION_PROFILE_SAMPLES = 72 public final static String HORIZONTAL_CROSS_SECTION_PROFILE_SAMPLES =
73 "/artifact-database/gnv/horizontal-cross-section-profile/samples/@number"; 73 "/artifact-database/gnv/horizontal-cross-section-profile/samples/@number";
74 74
75 public final static String HORIZONTAL_CROSS_SECTION_SAMPLES =
76 "/artifact-database/gnv/horizontal-cross-section/samples/@number";
77
75 public final static String VERTICAL_CROSS_SECTION_SAMPLES = 78 public final static String VERTICAL_CROSS_SECTION_SAMPLES =
76 "/artifact-database/gnv/vertical-cross-section/samples"; 79 "/artifact-database/gnv/vertical-cross-section/samples";
77 80
78 public final static String VERTICAL_CROSS_SECTION_FILTERS = 81 public final static String VERTICAL_CROSS_SECTION_FILTERS =
79 "/artifact-database/gnv/vertical-cross-section/filters/filter"; 82 "/artifact-database/gnv/vertical-cross-section/filters/filter";
131 134
132 configureChartTemplate(config, returnValue); 135 configureChartTemplate(config, returnValue);
133 136
134 configureHorizontalCrossSectionProfile(config, returnValue); 137 configureHorizontalCrossSectionProfile(config, returnValue);
135 138
139 configureHorizontalCrossSection(config,returnValue);
140
136 configureVerticalCrossSection(config, returnValue); 141 configureVerticalCrossSection(config, returnValue);
137 142
138 } catch (FileNotFoundException e) { 143 } catch (FileNotFoundException e) {
139 log.error(e, e); 144 log.error(e, e);
140 } catch (IOException e) { 145 } catch (IOException e) {
304 309
305 context.put( 310 context.put(
306 GNVArtifactContext.HORIZONTAL_CROSS_SECTION_PROFILE_SAMPLES_KEY, 311 GNVArtifactContext.HORIZONTAL_CROSS_SECTION_PROFILE_SAMPLES_KEY,
307 samples); 312 samples);
308 } 313 }
314
315 protected void configureHorizontalCrossSection(
316 Document config,
317 GNVArtifactContext context
318 )
319 {
320 log.info("configuration of horizontal cross section");
321
322 String numSamples = Config.getStringXPath(
323 config,
324 HORIZONTAL_CROSS_SECTION_SAMPLES);
325
326 Integer samples =
327 GNVArtifactContext.DEFAULT_HORIZONTAL_CROSS_SECTION_SAMPLES;
328
329 if (numSamples == null) {
330 log.warn("No number of samples found.");
331 }
332 else {
333 try {
334 samples = Integer.valueOf(numSamples);
335 }
336 catch (NumberFormatException nfe) {
337 log.warn("Invalid integer for number of samples");
338 }
339 }
340
341 log.info("# horizontal cross section profile samples: " + samples);
342
343 context.put(
344 GNVArtifactContext.HORIZONTAL_CROSS_SECTION_SAMPLES_KEY,
345 samples);
346 }
309 347
310 protected void configureChartTemplate( 348 protected void configureChartTemplate(
311 Document config, 349 Document config,
312 GNVArtifactContext context 350 GNVArtifactContext context
313 ) { 351 ) {

http://dive4elements.wald.intevation.org