Mercurial > dive4elements > gnv-client
diff 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 |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java Tue Jan 12 08:49:51 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java Tue Jan 12 11:34:25 2010 +0000 @@ -72,6 +72,9 @@ public final static String HORIZONTAL_CROSS_SECTION_PROFILE_SAMPLES = "/artifact-database/gnv/horizontal-cross-section-profile/samples/@number"; + public final static String HORIZONTAL_CROSS_SECTION_SAMPLES = + "/artifact-database/gnv/horizontal-cross-section/samples/@number"; + public final static String VERTICAL_CROSS_SECTION_SAMPLES = "/artifact-database/gnv/vertical-cross-section/samples"; @@ -133,6 +136,8 @@ configureHorizontalCrossSectionProfile(config, returnValue); + configureHorizontalCrossSection(config,returnValue); + configureVerticalCrossSection(config, returnValue); } catch (FileNotFoundException e) { @@ -306,6 +311,39 @@ GNVArtifactContext.HORIZONTAL_CROSS_SECTION_PROFILE_SAMPLES_KEY, samples); } + + protected void configureHorizontalCrossSection( + Document config, + GNVArtifactContext context + ) + { + log.info("configuration of horizontal cross section"); + + String numSamples = Config.getStringXPath( + config, + HORIZONTAL_CROSS_SECTION_SAMPLES); + + Integer samples = + GNVArtifactContext.DEFAULT_HORIZONTAL_CROSS_SECTION_SAMPLES; + + if (numSamples == null) { + log.warn("No number of samples found."); + } + else { + try { + samples = Integer.valueOf(numSamples); + } + catch (NumberFormatException nfe) { + log.warn("Invalid integer for number of samples"); + } + } + + log.info("# horizontal cross section profile samples: " + samples); + + context.put( + GNVArtifactContext.HORIZONTAL_CROSS_SECTION_SAMPLES_KEY, + samples); + } protected void configureChartTemplate( Document config,