annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/PredefinedDepthEvolPerYearProcessor.java @ 9200:6393e05a9610

refactoring on processors
author gernotbelger
date Fri, 29 Jun 2018 16:29:23 +0200
parents a4121ec450d6
children 08f46ccd37ba
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;
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
19 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
20 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
21 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
22 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
23
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 * 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
26 *
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 * @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
28 *
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 public class PredefinedDepthEvolPerYearProcessor extends AbstractSInfoProcessor {
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
31
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 // 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
33
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 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
35
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 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
37
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 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
39
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 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
41
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 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
43 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
44 }
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 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
47 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
48 }
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 @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
51 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
52
9200
6393e05a9610 refactoring on processors
gernotbelger
parents: 9195
diff changeset
53 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
54 }
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 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
57 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
58 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
59 }
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 }

http://dive4elements.wald.intevation.org