Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineProcessor.java @ 9429:bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
Colors and i10n for all themes.
author | gernotbelger |
---|---|
date | Fri, 17 Aug 2018 17:48:01 +0200 |
parents | 6e7094368e97 |
children | d8e753d0fdb9 |
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 |
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
13 import java.util.HashSet; |
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
14 import java.util.Set; |
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
15 |
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
16 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; |
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
17 import org.dive4elements.artifactdatabase.state.Facet; |
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
18 import org.dive4elements.artifacts.CallContext; |
9397 | 19 import org.dive4elements.river.artifacts.D4EArtifact; |
20 import org.dive4elements.river.artifacts.access.RangeAccess; | |
9347 | 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 | 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; |
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
29 import org.dive4elements.river.themes.ThemeDocument; |
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
30 |
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
31 /** |
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
32 * 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
|
33 * |
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
34 * @author Matthias Schäfer |
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 */ |
9347 | 37 public final class SalixLineProcessor extends AbstractProcessor { |
9295
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
38 |
9368
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
39 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
|
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_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
|
42 |
9368
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
43 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
|
44 |
9368
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
45 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
|
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_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
|
48 |
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_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
|
50 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
51 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
|
52 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
53 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
|
54 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
55 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
|
56 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
57 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
|
58 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
59 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
|
60 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
61 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
|
62 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
63 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
|
64 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
65 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
|
66 |
9429
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
67 // 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
|
68 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
|
69 |
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_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
|
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_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
|
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_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
|
75 |
9368
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
76 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
|
77 |
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
78 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
|
79 |
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
80 static { |
9368
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
81 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
|
82 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
|
83 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
|
84 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
|
85 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
|
86 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
|
87 HANDLED_FACET_TYPES.add(FACET_SALIX_RANK); |
9347 | 88 } |
89 | |
90 public SalixLineProcessor() { | |
9368
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
91 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
|
92 } |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
93 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
94 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
|
95 final int resultIndex) { |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
96 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
97 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
|
98 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
|
99 } |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
100 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
101 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
|
102 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
103 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
|
104 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
|
105 } |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
106 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
107 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
|
108 final int resultIndex) { |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
109 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
110 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
|
111 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
|
112 } |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
113 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
114 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
|
115 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
116 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
|
117 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
|
118 } |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
119 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
120 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
|
121 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
|
122 |
9429
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
123 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
|
124 subLabel); |
9368
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
125 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
|
126 } |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
127 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
128 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
|
129 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
|
130 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
131 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
|
132 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
|
133 } |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
134 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
135 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
|
136 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
137 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
|
138 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
|
139 } |
72b3270e1568
U-Info salix line with regional and supraregional scenario calculation and chart display
mschaefer
parents:
9295
diff
changeset
|
140 |
9429
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
141 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
|
142 final int facetIndex) { |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
143 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
|
144 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
|
145 SalixLineCrossSectionIndexData.salixLine()); |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
146 } |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
147 |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
148 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
|
149 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
|
150 |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
151 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
|
152 subLabel); |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
153 |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
154 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
|
155 SalixLineCrossSectionIndexData.scenario(scenarioIndex)); |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
156 } |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
157 |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
158 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
|
159 final SalixWaterlevel knownWaterlevel, final int facetIndex) { |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
160 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
|
161 final String facetI10n = facetName + "_description"; |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
162 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
|
163 |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
164 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
|
165 SalixLineCrossSectionIndexData.waterlevel(knownWaterlevel)); |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
166 } |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9397
diff
changeset
|
167 |
9295
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
168 @Override |
9347 | 169 protected String generateSeries(final DiagramGenerator generator, final ArtifactAndFacet bundle, final ThemeDocument theme, final boolean visible) { |
9295
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
170 |
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
171 // log.debug("Processing facet: " + bundle.getFacetName()); |
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
172 |
9368
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
173 if (bundle.getFacetName().equals(FACET_SALIX_SCENARIO_FILTERED) || bundle.getFacetName().equals(FACET_SALIX_SCENARIO_RAW)) { |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
174 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
|
175 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
|
176 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
|
177 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
|
178 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
|
179 } |
9347 | 180 |
9368
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
181 if (bundle.getFacetName().equals(FACET_SALIX_RANK)) { |
9397 | 182 final RangeAccess kmRange = new RangeAccess((D4EArtifact) bundle.getArtifact()); |
183 // TODO get all rank data (5 ranks) from database | |
184 final double[][] points = new double[2][2]; | |
185 points[0][0] = kmRange.getLowerKm(); | |
186 points[0][1] = kmRange.getUpperKm(); | |
187 points[1][0] = 1.5; | |
188 points[1][1] = 1.5; | |
189 return buildSeriesForPoints(points, generator, bundle, theme, visible, null); | |
9368
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
190 } |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
191 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
192 return buildSeriesForType(generator, bundle, theme, visible, doGetType(bundle.getFacetName()), GAP_DISTANCE); |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
193 } |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
194 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
195 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
|
196 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
197 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
|
198 return UInfoResultType.salixline; |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
199 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
|
200 return UInfoResultType.salixline; |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
201 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
202 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
|
203 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
|
204 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
|
205 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
|
206 |
6f7e92c16050
Fixed U-Info salix mw calculation, added filtered themes, own y axis, warning report
mschaefer
parents:
9361
diff
changeset
|
207 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
|
208 throw new UnsupportedOperationException(error); |
9295
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
209 } |
385b52ccde23
Work on U-Info salix line calculation and chart (no scenario case)
mschaefer
parents:
diff
changeset
|
210 } |