annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/PredefinedDepthEvolPerYearProcessor.java @ 9609:8232a3f5967b

#20 SinfoResultType
author dnt_bjoernsen <d.tironi@bjoernsen.de>
date Wed, 09 Oct 2019 15:43:39 +0200
parents 08f46ccd37ba
children
rev   line source
9033
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
2 * Software engineering by
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
3 * Björnsen Beratende Ingenieure GmbH
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
5 *
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
6 * This file is Free Software under the GNU AGPL (>=v3)
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
8 * documentation coming with Dive4Elements River for details.
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
9 */
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
10
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
11 package org.dive4elements.river.artifacts.sinfo.common;
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
12
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
13 import java.util.HashSet;
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
14 import java.util.Set;
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
15
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
16 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
17 import org.dive4elements.artifactdatabase.state.Facet;
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
18 import org.dive4elements.artifacts.CallMeta;
9347
08f46ccd37ba salix.regional refactoring
gernotbelger
parents: 9200
diff changeset
19 import org.dive4elements.river.artifacts.common.AbstractProcessor;
9033
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
20 import org.dive4elements.river.artifacts.resources.Resources;
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
21 import org.dive4elements.river.artifacts.sinfo.predefineddepthevol.PredefinedDepthEvolFacet;
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
22 import org.dive4elements.river.exports.DiagramGenerator;
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
23 import org.dive4elements.river.themes.ThemeDocument;
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
24
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
25 /**
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
26 * Processor to generate a data series for depth evolution per year data loaded from the database
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
27 *
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
28 * @author Matthias Schäfer
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
29 *
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
30 */
9347
08f46ccd37ba salix.regional refactoring
gernotbelger
parents: 9200
diff changeset
31 public class PredefinedDepthEvolPerYearProcessor extends AbstractProcessor {
9033
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
32
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
33 // private final static Logger log = Logger.getLogger(PredefinedDepthEvolPerYearProcessor.class);
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
34
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
35 public static final String FACET_PREDEFINED_DEPTHEVOL_PER_YEAR = "sinfo_facet_predefined_depthevol_per_year";
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
36
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
37 private static final String I18N_AXIS_LABEL = "sinfo.chart.flow_depth_development_per_year.section.yaxis.label";
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
38
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
39 private static final String I18N_SERIES_NAME_PATTERN = "predefineddepthevol.peryear.title";
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
40
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
41 private static final Set<String> HANDLED_FACET_TYPES = new HashSet<>();
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
42
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
43 static {
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
44 HANDLED_FACET_TYPES.add(FACET_PREDEFINED_DEPTHEVOL_PER_YEAR);
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
45 }
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
46
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
47 public PredefinedDepthEvolPerYearProcessor() {
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
48 super(I18N_AXIS_LABEL, HANDLED_FACET_TYPES);
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
49 }
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
50
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
51 @Override
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
52 protected String generateSeries(final DiagramGenerator generator, final ArtifactAndFacet bundle, final ThemeDocument theme, final boolean visible) {
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
53
9200
6393e05a9610 refactoring on processors
gernotbelger
parents: 9195
diff changeset
54 return buildSeriesForType(generator, bundle, theme, visible, SInfoResultType.flowdepthDevelopmentPerYear, null);
9033
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
55 }
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
56
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
57 public static Facet createFacet(final CallMeta callMeta, final String seriesName) {
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
58 return new PredefinedDepthEvolFacet(FACET_PREDEFINED_DEPTHEVOL_PER_YEAR,
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
59 Resources.getMsg(callMeta, I18N_SERIES_NAME_PATTERN, I18N_SERIES_NAME_PATTERN, seriesName), I18N_AXIS_LABEL);
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
60 }
384eee4b4135 Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
mschaefer
parents:
diff changeset
61 }

http://dive4elements.wald.intevation.org