annotate artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineProcessor.java @ 9556:9b8e8fc1f408

Use facetName in all processors as themeType for legend aggregation.
author gernotbelger
date Tue, 23 Oct 2018 16:26:58 +0200
parents 853f2dafc16e
children
rev   line source
9295
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
2 * Software engineering by
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
3 * Björnsen Beratende Ingenieure GmbH
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
5 *
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
6 * This file is Free Software under the GNU AGPL (>=v3)
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
8 * documentation coming with Dive4Elements River for details.
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
9 */
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
10
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
11 package org.dive4elements.river.artifacts.uinfo.salix;
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
12
9496
d8e753d0fdb9 stripedArea introduced for Assessment Scheme/Bewertungsschema
gernotbelger
parents: 9429
diff changeset
13 import java.awt.Color;
9295
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
14 import java.util.HashSet;
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
15 import java.util.Set;
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
16
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
17 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
18 import org.dive4elements.artifactdatabase.state.Facet;
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
19 import org.dive4elements.artifacts.CallContext;
9496
d8e753d0fdb9 stripedArea introduced for Assessment Scheme/Bewertungsschema
gernotbelger
parents: 9429
diff changeset
20 import org.dive4elements.artifacts.CallMeta;
9347
08f46ccd37ba salix.regional refactoring
gernotbelger
parents: 9328
diff changeset
21 import org.dive4elements.river.artifacts.common.AbstractProcessor;
9429
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
22 import org.dive4elements.river.artifacts.model.CrossSectionWaterLineFacet;
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
23 import org.dive4elements.river.artifacts.model.FacetTypes;
9316
72b3270e1568 U-Info salix line with regional and supraregional scenario calculation and chart display
mschaefer
parents: 9295
diff changeset
24 import org.dive4elements.river.artifacts.resources.Resources;
9429
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
25 import org.dive4elements.river.artifacts.states.DefaultState.ComputeType;
9328
b3d3c958a594 Renamed package name
gernotbelger
parents: 9316
diff changeset
26 import org.dive4elements.river.artifacts.uinfo.common.UInfoResultType;
9429
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
27 import org.dive4elements.river.artifacts.uinfo.salix.SalixLineCrossSectionIndexData.SalixWaterlevel;
9295
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
28 import org.dive4elements.river.exports.DiagramGenerator;
9499
853f2dafc16e VegetationZones in CrossSectionsDiagram
gernotbelger
parents: 9496
diff changeset
29 import org.dive4elements.river.jfree.StripedAreaDataset;
9496
d8e753d0fdb9 stripedArea introduced for Assessment Scheme/Bewertungsschema
gernotbelger
parents: 9429
diff changeset
30 import org.dive4elements.river.jfree.StripedAreaDataset.Stripe;
9295
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
31 import org.dive4elements.river.themes.ThemeDocument;
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
32
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
33 /**
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
34 * Processor to generate the facets and data series of salix line
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
35 *
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
36 * @author Matthias Schäfer
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
37 *
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
38 */
9347
08f46ccd37ba salix.regional refactoring
gernotbelger
parents: 9328
diff changeset
39 public final class SalixLineProcessor extends AbstractProcessor {
9295
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
40
9368
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
41 private static final String FACET_SALIX_LINE_FILTERED = "uinfo_facet_salix_line.filtered";
9316
72b3270e1568 U-Info salix line with regional and supraregional scenario calculation and chart display
mschaefer
parents: 9295
diff changeset
42
9368
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
43 private static final String FACET_SALIX_LINE_FILTERED_DESCRIPTION = "uinfo_facet_salix_line.filtered.description";
9316
72b3270e1568 U-Info salix line with regional and supraregional scenario calculation and chart display
mschaefer
parents: 9295
diff changeset
44
9368
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
45 public static final String FACET_SALIX_LINE_RAW = "uinfo_facet_salix_line";
9316
72b3270e1568 U-Info salix line with regional and supraregional scenario calculation and chart display
mschaefer
parents: 9295
diff changeset
46
9368
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
47 private static final String FACET_SALIX_LINE_RAW_DESCRIPTION = "uinfo_facet_salix_line.raw.description";
9316
72b3270e1568 U-Info salix line with regional and supraregional scenario calculation and chart display
mschaefer
parents: 9295
diff changeset
48
9368
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
49 private static final String FACET_SALIX_MNWMW_FILTERED = "uinfo_facet_salix_mnwmw.filtered";
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
50
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
51 private static final String FACET_SALIX_MNWMW_FILTERED_DESCRIPTION = "uinfo_facet_salix_mnwmw.filtered.description";
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
52
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
53 public static final String FACET_SALIX_MNWMW_RAW = "uinfo_facet_salix_mnwmw";
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
54
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
55 private static final String FACET_SALIX_MNWMW_RAW_DESCRIPTION = "uinfo_facet_salix_mnwmw.raw.description";
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
56
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
57 public static final String FACET_SALIX_SCENARIO_FILTERED = "uinfo_facet_salix_scenario.filtered";
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
58
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
59 private static final String FACET_SALIX_SCENARIO_FILTERED_DESCRIPTION = "uinfo_facet_salix_scenario.filtered.description";
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
60
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
61 public static final String FACET_SALIX_SCENARIO_RAW = "uinfo_facet_salix_scenario";
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
62
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
63 private static final String FACET_SALIX_SCENARIO_RAW_DESCRIPTION = "uinfo_facet_salix_scenario.raw.description";
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
64
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
65 public static final String FACET_SALIX_RANK = "uinfo_facet_salix_rank";
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
66
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
67 private static final String FACET_SALIX_RANK_DESCRIPTION = "uinfo_facet_salix_rank.description";
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
68
9429
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
69 // REMARK: must end with FacetTypes.CROSS_SECTION_WATER_LINE so its correctly recognized as such a theme
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
70 private static final String FACET_SALIX_CROSS_SECTION_WATER_LINE = "uinfo_facet_salix_line_" + FacetTypes.CROSS_SECTION_WATER_LINE;
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
71
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
72 private static final String FACET_SALIX_CROSS_SECTION_WATER_LINE_DESCRIPTION = FACET_SALIX_CROSS_SECTION_WATER_LINE + "_description";
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
73
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
74 private static final String FACET_SALIX_SCENARIO_CROSS_SECTION_WATER_LINE = "uinfo_facet_salix_scenario_" + FacetTypes.CROSS_SECTION_WATER_LINE;
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
75
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
76 private static final String FACET_SALIX_WATERLEVEL_CROSS_SECTION_WATER_LINE_PREFIX = "uinfo_facet_salix_waterlevel_";
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
77
9368
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
78 private static final String I18N_AXIS_LABEL = "uinfo.chart.salix_line.section.yaxis.label";
9295
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
79
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
80 private static final Set<String> HANDLED_FACET_TYPES = new HashSet<>();
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
81
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
82 static {
9368
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
83 HANDLED_FACET_TYPES.add(FACET_SALIX_LINE_FILTERED);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
84 HANDLED_FACET_TYPES.add(FACET_SALIX_LINE_RAW);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
85 HANDLED_FACET_TYPES.add(FACET_SALIX_MNWMW_FILTERED);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
86 HANDLED_FACET_TYPES.add(FACET_SALIX_MNWMW_RAW);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
87 HANDLED_FACET_TYPES.add(FACET_SALIX_SCENARIO_FILTERED);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
88 HANDLED_FACET_TYPES.add(FACET_SALIX_SCENARIO_RAW);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
89 HANDLED_FACET_TYPES.add(FACET_SALIX_RANK);
9347
08f46ccd37ba salix.regional refactoring
gernotbelger
parents: 9328
diff changeset
90 }
08f46ccd37ba salix.regional refactoring
gernotbelger
parents: 9328
diff changeset
91
08f46ccd37ba salix.regional refactoring
gernotbelger
parents: 9328
diff changeset
92 public SalixLineProcessor() {
9368
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
93 super(I18N_AXIS_LABEL, HANDLED_FACET_TYPES);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
94 }
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
95
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
96 public static Facet createSalixLineFilteredFacet(final CallContext context, final String hash, final String id, final int facetIndex,
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
97 final int resultIndex) {
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
98
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
99 final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_LINE_FILTERED_DESCRIPTION, FACET_SALIX_LINE_FILTERED_DESCRIPTION);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
100 return new SalixLineResultFacet(facetIndex, resultIndex, FACET_SALIX_LINE_FILTERED, description, I18N_AXIS_LABEL, id, hash);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
101 }
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
102
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
103 public static Facet createSalixLineRawFacet(final CallContext context, final String hash, final String id, final int facetIndex, final int resultIndex) {
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
104
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
105 final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_LINE_RAW_DESCRIPTION, FACET_SALIX_LINE_RAW_DESCRIPTION);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
106 return new SalixLineResultFacet(facetIndex, resultIndex, FACET_SALIX_LINE_RAW, description, I18N_AXIS_LABEL, id, hash);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
107 }
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
108
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
109 public static Facet createSalixMnwMwFilteredFacet(final CallContext context, final String hash, final String id, final int facetIndex,
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
110 final int resultIndex) {
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
111
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
112 final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_MNWMW_FILTERED_DESCRIPTION, FACET_SALIX_MNWMW_FILTERED_DESCRIPTION);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
113 return new SalixMnwMwResultFacet(facetIndex, resultIndex, FACET_SALIX_MNWMW_FILTERED, description, I18N_AXIS_LABEL, id, hash);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
114 }
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
115
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
116 public static Facet createSalixMnwMwRawFacet(final CallContext context, final String hash, final String id, final int facetIndex, final int resultIndex) {
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
117
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
118 final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_MNWMW_RAW_DESCRIPTION, FACET_SALIX_MNWMW_RAW_DESCRIPTION);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
119 return new SalixMnwMwResultFacet(facetIndex, resultIndex, FACET_SALIX_MNWMW_RAW, description, I18N_AXIS_LABEL, id, hash);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
120 }
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
121
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
122 public static Facet createSalixScenarioFilteredFacet(final CallContext context, final String hash, final String id, final int dataIndex,
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
123 final int resultIndex, final int facetIndex, final String subLabel) {
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
124
9429
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
125 final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_SCENARIO_FILTERED_DESCRIPTION, FACET_SALIX_SCENARIO_FILTERED_DESCRIPTION,
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
126 subLabel);
9368
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
127 return new SalixScenarioResultFacet(facetIndex, resultIndex, dataIndex, FACET_SALIX_SCENARIO_FILTERED, description, I18N_AXIS_LABEL, hash, id);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
128 }
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
129
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
130 public static Facet createSalixScenarioRawFacet(final CallContext context, final String hash, final String id, final int dataIndex, final int resultIndex,
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
131 final int facetIndex, final String subLabel) {
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
132
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
133 final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_SCENARIO_RAW_DESCRIPTION, FACET_SALIX_SCENARIO_RAW_DESCRIPTION, subLabel);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
134 return new SalixScenarioResultFacet(facetIndex, resultIndex, dataIndex, FACET_SALIX_SCENARIO_RAW, description, I18N_AXIS_LABEL, hash, id);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
135 }
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
136
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
137 public static Facet createSalixRankFacet(final CallContext context, final String hash, final String id, final int facetIndex, final int resultIndex) {
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
138
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
139 final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_RANK_DESCRIPTION, FACET_SALIX_RANK_DESCRIPTION);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
140 return new SalixRankResultFacet(facetIndex, resultIndex, FACET_SALIX_RANK, description, I18N_AXIS_LABEL, id, hash);
9316
72b3270e1568 U-Info salix line with regional and supraregional scenario calculation and chart display
mschaefer
parents: 9295
diff changeset
141 }
72b3270e1568 U-Info salix line with regional and supraregional scenario calculation and chart display
mschaefer
parents: 9295
diff changeset
142
9429
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
143 public static Facet createSalixCrossSectionFacet(final CallContext context, final ComputeType type, final String hash, final String stateId,
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
144 final int facetIndex) {
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
145 final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_CROSS_SECTION_WATER_LINE_DESCRIPTION);
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
146 return new CrossSectionWaterLineFacet(facetIndex, FACET_SALIX_CROSS_SECTION_WATER_LINE, description, type, hash, stateId,
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
147 SalixLineCrossSectionIndexData.salixLine());
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
148 }
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
149
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
150 public static Facet createSalixScenarioCrossSectionFacet(final CallContext context, final ComputeType type, final String hash, final String stateId,
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
151 final int scenarioIndex, final int facetIndex, final String subLabel) {
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
152
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
153 final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_SCENARIO_FILTERED_DESCRIPTION, FACET_SALIX_SCENARIO_FILTERED_DESCRIPTION,
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
154 subLabel);
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
155
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
156 return new CrossSectionWaterLineFacet(facetIndex, FACET_SALIX_SCENARIO_CROSS_SECTION_WATER_LINE, description, type, hash, stateId,
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
157 SalixLineCrossSectionIndexData.scenario(scenarioIndex));
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
158 }
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
159
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
160 public static Facet createSalixWaterlevelCrossSectionFacet(final CallContext context, final ComputeType type, final String hash, final String stateId,
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
161 final SalixWaterlevel knownWaterlevel, final int facetIndex) {
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
162 final String facetName = FACET_SALIX_WATERLEVEL_CROSS_SECTION_WATER_LINE_PREFIX + knownWaterlevel.name() + "_" + FacetTypes.CROSS_SECTION_WATER_LINE;
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
163 final String facetI10n = facetName + "_description";
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
164 final String facetDescirption = Resources.getMsg(context.getMeta(), facetI10n);
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
165
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
166 return new CrossSectionWaterLineFacet(facetIndex, facetName, facetDescirption, type, hash, stateId,
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
167 SalixLineCrossSectionIndexData.waterlevel(knownWaterlevel));
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
168 }
bd5f5d2220fa Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents: 9397
diff changeset
169
9295
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
170 @Override
9347
08f46ccd37ba salix.regional refactoring
gernotbelger
parents: 9328
diff changeset
171 protected String generateSeries(final DiagramGenerator generator, final ArtifactAndFacet bundle, final ThemeDocument theme, final boolean visible) {
9556
9b8e8fc1f408 Use facetName in all processors as themeType for legend aggregation.
gernotbelger
parents: 9499
diff changeset
172 final String facetName = bundle.getFacetName();
9b8e8fc1f408 Use facetName in all processors as themeType for legend aggregation.
gernotbelger
parents: 9499
diff changeset
173
9b8e8fc1f408 Use facetName in all processors as themeType for legend aggregation.
gernotbelger
parents: 9499
diff changeset
174 if (facetName.equals(FACET_SALIX_SCENARIO_FILTERED) || facetName.equals(FACET_SALIX_SCENARIO_RAW)) {
9368
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
175 final CallContext context = generator.getContext();
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
176 final SalixLineCalculationResult data = (SalixLineCalculationResult) bundle.getData(context);
9361
2aec052d4088 Refactoring on SalixLineCalculationResult etc., calculation using MQ etc., scenario (regional+supra) csv columns and meta data added
mschaefer
parents: 9347
diff changeset
177 final int dataIndex = ((SalixScenarioResultFacet) bundle.getFacet()).getDataIndex();
2aec052d4088 Refactoring on SalixLineCalculationResult etc., calculation using MQ etc., scenario (regional+supra) csv columns and meta data added
mschaefer
parents: 9347
diff changeset
178 final double[][] scenarioPoints = data.getScenarioPoints(dataIndex);
2aec052d4088 Refactoring on SalixLineCalculationResult etc., calculation using MQ etc., scenario (regional+supra) csv columns and meta data added
mschaefer
parents: 9347
diff changeset
179 return buildSeriesForPoints(scenarioPoints, generator, bundle, theme, visible, GAP_DISTANCE);
9295
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
180 }
9347
08f46ccd37ba salix.regional refactoring
gernotbelger
parents: 9328
diff changeset
181
9556
9b8e8fc1f408 Use facetName in all processors as themeType for legend aggregation.
gernotbelger
parents: 9499
diff changeset
182 if (facetName.equals(FACET_SALIX_RANK)) {
9496
d8e753d0fdb9 stripedArea introduced for Assessment Scheme/Bewertungsschema
gernotbelger
parents: 9429
diff changeset
183 final CallMeta meta = generator.getContext().getMeta();
d8e753d0fdb9 stripedArea introduced for Assessment Scheme/Bewertungsschema
gernotbelger
parents: 9429
diff changeset
184
9556
9b8e8fc1f408 Use facetName in all processors as themeType for legend aggregation.
gernotbelger
parents: 9499
diff changeset
185 final StripedAreaDataset dataset = new StripedAreaDataset(facetName, theme);
9499
853f2dafc16e VegetationZones in CrossSectionsDiagram
gernotbelger
parents: 9496
diff changeset
186 dataset.addStripe(new Stripe(getSimpleMsg("uinfo_salix_rank.excellent", meta), Color.decode("#00B0F0"), -0.3, 0.3));
853f2dafc16e VegetationZones in CrossSectionsDiagram
gernotbelger
parents: 9496
diff changeset
187 dataset.addStripe(new Stripe(getSimpleMsg("uinfo_salix_rank.good", meta), Color.decode("#00B050"), 0.3, 0.5));
853f2dafc16e VegetationZones in CrossSectionsDiagram
gernotbelger
parents: 9496
diff changeset
188 dataset.addStripe(new Stripe(getSimpleMsg("uinfo_salix_rank.moderate", meta), Color.decode("#FFFF00"), 0.5, 1.0));
853f2dafc16e VegetationZones in CrossSectionsDiagram
gernotbelger
parents: 9496
diff changeset
189 dataset.addStripe(new Stripe(getSimpleMsg("uinfo_salix_rank.bad", meta), Color.decode("#FFC000"), 1.0, 1.5));
853f2dafc16e VegetationZones in CrossSectionsDiagram
gernotbelger
parents: 9496
diff changeset
190 dataset.addStripe(new Stripe(getSimpleMsg("uinfo_salix_rank.very_bad", meta), Color.decode("#FF0000"), 1.5, Double.NaN));
853f2dafc16e VegetationZones in CrossSectionsDiagram
gernotbelger
parents: 9496
diff changeset
191
853f2dafc16e VegetationZones in CrossSectionsDiagram
gernotbelger
parents: 9496
diff changeset
192 generator.addAxisDataset(dataset, getAxisName(), visible);
853f2dafc16e VegetationZones in CrossSectionsDiagram
gernotbelger
parents: 9496
diff changeset
193
853f2dafc16e VegetationZones in CrossSectionsDiagram
gernotbelger
parents: 9496
diff changeset
194 return null;
9368
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
195 }
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
196
9556
9b8e8fc1f408 Use facetName in all processors as themeType for legend aggregation.
gernotbelger
parents: 9499
diff changeset
197 return buildSeriesForType(generator, bundle, theme, visible, doGetType(facetName), GAP_DISTANCE);
9368
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
198 }
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
199
9496
d8e753d0fdb9 stripedArea introduced for Assessment Scheme/Bewertungsschema
gernotbelger
parents: 9429
diff changeset
200 private String getSimpleMsg(final String code, final CallMeta meta) {
d8e753d0fdb9 stripedArea introduced for Assessment Scheme/Bewertungsschema
gernotbelger
parents: 9429
diff changeset
201 return Resources.getMsg(meta, code);
d8e753d0fdb9 stripedArea introduced for Assessment Scheme/Bewertungsschema
gernotbelger
parents: 9429
diff changeset
202 }
d8e753d0fdb9 stripedArea introduced for Assessment Scheme/Bewertungsschema
gernotbelger
parents: 9429
diff changeset
203
9368
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
204 protected UInfoResultType doGetType(final String facetName) {
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
205
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
206 if (FACET_SALIX_LINE_FILTERED.contentEquals(facetName))
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
207 return UInfoResultType.salixline;
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
208 if (FACET_SALIX_LINE_RAW.contentEquals(facetName))
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
209 return UInfoResultType.salixline;
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
210
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
211 if (FACET_SALIX_MNWMW_FILTERED.contentEquals(facetName))
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
212 return UInfoResultType.salix_mw_mnw;
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
213 if (FACET_SALIX_MNWMW_RAW.contentEquals(facetName))
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
214 return UInfoResultType.salix_mw_mnw;
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
215
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
216 final String error = String.format("Unknown facet name: %s", facetName);
6f7e92c16050 Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents: 9361
diff changeset
217 throw new UnsupportedOperationException(error);
9295
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
218 }
385b52ccde23 Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff changeset
219 }

http://dive4elements.wald.intevation.org