Mercurial > dive4elements > gnv-client
changeset 791:23877dd69444
Added javadoc in Context package.
gnv-artifacts/trunk@873 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 31 Mar 2010 09:30:34 +0000 (2010-03-31) |
parents | f198e4620546 |
children | 9b9bf42b7928 |
files | gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContext.java gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java |
diffstat | 2 files changed, 213 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContext.java Wed Mar 31 09:13:33 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContext.java Wed Mar 31 09:30:34 2010 +0000 @@ -13,6 +13,12 @@ import org.w3c.dom.Document; /** + * This class defines some final fields used to store some meta information + * required during the work with an artifact into a context object which is + * available in each request specified in + * {@link de.intevation.gnv.artifacts.Artifacts} and further methods called by + * those. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> */ @@ -24,79 +30,150 @@ */ private static Logger log = Logger.getLogger(GNVArtifactContext.class); + /** + * + */ public static final String CHART_TEMPLATE_KEY = "gnv.chart.template"; + /** + * + */ public static final String HORIZONTAL_CROSS_SECTION_PROFILE_SAMPLES_KEY = "gnv.horizontal.cross.section.profile.samples"; + /** + * + */ public static final String HORIZONTAL_CROSS_SECTION_SAMPLES_KEY = "gnv.horizontal.cross.section.samples"; + /** + * + */ public static final String HORIZONTAL_CROSS_SECTION_EXTRAPOLATION_ROUNDS_KEY = "gnv.horizontal.cross.section.extrapolation.rounds"; + /** + * + */ public static final String HORIZONTAL_CROSS_SECTION_RESULT_SHAPEFILE_PATH_KEY = "gnv.horizontal.cross.section.result.shapefile"; + /** + * + */ public static final File DEFAULT_HORIZONTAL_CROSS_SECTION_PROFILE_SHAPEFILE_PATH = new File(System.getProperty("java.io.tmpdir")); + /** + * + */ public static final Integer DEFAULT_HORIZONTAL_CROSS_SECTION_PROFILE_SAMPLES = Integer.valueOf(250); + /** + * + */ public static final Integer DEFAULT_HORIZONTAL_CROSS_SECTION_SAMPLES = Integer.valueOf(1024); + /** + * + */ public static final Integer DEFAULT_HORIZONTAL_CROSS_SECTION_EXTRAPOLATION_ROUNDS = Integer.valueOf(0); + /** + * + */ public static final String HORIZONTAL_CROSS_SECTION_GROUND_INTERPOLATION_KEY = "gnv.horizontal.cross.section.ground.interpolation"; + /** + * + */ public static final String DEFAULT_HORIZONTAL_CROSS_SECTION_GROUND_INTERPOLATION = "bilinear"; + /** + * + */ public static final String PALETTES_KEY = "gnv.color.palettes"; + /** + * + */ public static final String VERTICAL_CROSS_SECTION_SAMPLES_KEY = "gnv.vertical.cross.section.samples"; + /** + * + */ public static final Dimension DEFAULT_VERTICAL_CROSS_SECTION_SAMPLES = new Dimension(1024, 768); + /** + * + */ public static final String VERTICAL_CROSS_SECTION_FILTER_FACTORIES_KEY = "gnv.vertical.cross.section.filter.factories"; + /** + * + */ public static final String VERTICAL_CROSS_SECTION_GROUND_INTERPOLATION_KEY = "gnv.vertical.cross.section.ground.interpolation"; + /** + * + */ public static final String DEFAULT_VERTICAL_CROSS_SECTION_GROUND_INTERPOLATION = "bilinear"; + /** + * + */ public static final String VERTICAL_CROSS_SECTION_GROUND_FILL_KEY = "gnv.vertical.cross.section.ground.fill"; + /** + * + */ public static final String MAPSERVER_SERVER_PATH_KEY = "mapserver.server.path"; + /** + * + */ public static final String MAPSERVER_MAP_PATH_KEY = "mapserver.map.path"; + /** + * + */ public static final Paint DEFAULT_VERTICAL_CROSS_SECTION_GROUND_FILL = new Color(0x7c8683); + /** + * + */ public GNVArtifactContext() { super(); log.debug("GNVArtifactContext.Constructor"); } + /** + * + * @param config + */ public GNVArtifactContext(Document config) { super(config); log.debug("GNVArtifactContext.Constructor(config)"); } } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java Wed Mar 31 09:13:33 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java Wed Mar 31 09:30:34 2010 +0000 @@ -41,6 +41,10 @@ import org.w3c.dom.NodeList; /** + * This factory class is used to create new GNVArtfactContext objects, + * initialize required components and put them into the created context object + * for being available in the application. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * @author <a href="mailto:iweinzierl@intevation.de">Ingo Weinzierl</a> * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> @@ -51,9 +55,15 @@ */ private static Logger log = Logger.getLogger(GNVArtifactContext.class); + /** + * + */ public static final String XPATH_GEOBACKEND_CONFIGURATION = "artifact-database/geo-backend/backend-configuration"; + /** + * + */ public static final String XPATH_GEOBACKEND_QUERYCONFIGURATION = "artifact-database/geo-backend/query-configuration"; @@ -63,42 +73,81 @@ private final static String CHARTCONFIGNODEPATH = "/artifact-database/gnv/charttemplate/configuration"; + /** + * + */ public final static String PALETTES_PATH = "/artifact-database/gnv/palettes"; + /** + * + */ public final static String PALETTE_ITEMS = "palette"; + /** + * + */ 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_GROUND_INTERPOLATION = "/artifact-database/gnv/horizontal-cross-section/ground/@interpolation"; + /** + * + */ public final static String HORIZONTAL_CROSS_SECTION_SAMPLES = "/artifact-database/gnv/horizontal-cross-section/samples/@number"; + /** + * + */ public final static String HORIZONTAL_CROSS_SECTION_EXTRAPOLATION_ROUNDS = "/artifact-database/gnv/horizontal-cross-section/extrapolation/@rounds"; + /** + * + */ public final static String HORIZONTAL_CROSS_SECTION_RESULT_SHAPEFILE_PATH = "/artifact-database/gnv/shapefile-directory/@path"; + /** + * + */ public final static String VERTICAL_CROSS_SECTION_SAMPLES = "/artifact-database/gnv/vertical-cross-section/samples"; + /** + * + */ public final static String VERTICAL_CROSS_SECTION_FILTERS = "/artifact-database/gnv/vertical-cross-section/filters/filter"; + /** + * + */ public final static String VERTICAL_CROSS_SECTION_GROUND_INTERPOLATION = "/artifact-database/gnv/vertical-cross-section/ground/@interpolation"; + /** + * + */ public final static String VERTICAL_CROSS_SECTION_GROUND_FILL_COLOR = "/artifact-database/gnv/vertical-cross-section/ground/@fill-color"; + /** + * + */ public final static String XPATH_MAPSERVER_PATH = "/artifact-database/mapserver/server/@path"; + /** + * + */ public final static String XPATH_MAP_PATH = "/artifact-database/mapserver/map/@path"; @@ -111,6 +160,11 @@ } /** + * Create a new {@link GNVArtifactContext} object and initialize all + * components required by the application. + * + * @param config + * @return GNVArtifactContext * @see de.intevation.artifacts.ArtifactContextFactory#createArtifactContext(org.w3c.dom.Document) */ public Object createArtifactContext(Document config) { @@ -163,6 +217,11 @@ return returnValue; } + /** + * + * @param config + * @param context + */ protected void configureVerticalCrossSection( Document config, GNVArtifactContext context @@ -175,6 +234,10 @@ } + /** + * + * @param config + */ protected void configureCache(Document config) { String cacheConfigurationFile = Config.getStringXPath( config, CACHECONFIGNODEPATH); @@ -191,6 +254,11 @@ } } + /** + * + * @param config + * @param context + */ protected void configureVerticalCrossSectionGroundFillColor( Document config, GNVArtifactContext context @@ -223,6 +291,11 @@ fill); } + /** + * + * @param config + * @param context + */ protected void configureVerticalCrossSectionGroundInterpolation( Document config, GNVArtifactContext context @@ -246,6 +319,11 @@ interpolation); } + /** + * + * @param config + * @param context + */ protected void configureVerticalCrossSectionFilters( Document config, GNVArtifactContext context @@ -298,6 +376,11 @@ Collections.unmodifiableList(filterFactories)); } + /** + * + * @param config + * @param context + */ protected void configureVerticalCrossSectionSamples( Document config, GNVArtifactContext context @@ -342,6 +425,11 @@ } + /** + * + * @param config + * @param context + */ protected void configureHorizontalCrossSectionProfile( Document config, GNVArtifactContext context @@ -375,6 +463,11 @@ samples); } + /** + * + * @param config + * @param context + */ protected void configureHorizontalCrossSection( Document config, GNVArtifactContext context @@ -387,6 +480,11 @@ configureHorizontalCrossSectionGroundInterpolation(config, context); } + /** + * + * @param config + * @param context + */ protected void configureHorizontalCrossSectionExtrapolation( Document config, GNVArtifactContext context @@ -423,6 +521,11 @@ extrapolationRounds); } + /** + * + * @param config + * @param context + */ protected void configureHorizontalCrossSectionGroundInterpolation( Document config, GNVArtifactContext context @@ -449,6 +552,11 @@ interpolation); } + /** + * + * @param config + * @param context + */ protected void configureHorizontalCrossSectionResultShapeFilePath( Document config, GNVArtifactContext context @@ -481,6 +589,11 @@ dir); } + /** + * + * @param config + * @param context + */ protected void configureHorizontalCrossSectionSamples( Document config, GNVArtifactContext context @@ -514,6 +627,11 @@ } + /** + * + * @param config + * @param context + */ protected void configureChartTemplate( Document config, GNVArtifactContext context @@ -546,6 +664,11 @@ context.put(GNVArtifactContext.CHART_TEMPLATE_KEY, theme); } + /** + * + * @param config + * @param context + */ protected void configurePalettes( Document config, GNVArtifactContext context @@ -614,6 +737,11 @@ } + /** + * + * @param config + * @param context + */ protected void configureMapserver( Document config, GNVArtifactContext context @@ -633,10 +761,13 @@ } /** - * @param filePath - * @return - * @throws FileNotFoundException - * @throws IOException + * Read some properties from config file specified by <code>filePath</code>. + * + * @param filePath Path to a cofig file. + * @return Properties contained in <code>filePath</code>. + * @throws FileNotFoundException if file specified by filePath is not + * existing. + * @throws IOException if an error occured while reading from file. */ private Properties getProperties(String filePath) throws FileNotFoundException, IOException @@ -656,3 +787,4 @@ } } } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file