Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/HistoricalDischargeState.java @ 4241:49cb65d5932d
Improved the historical discharge calculation.
The calculation now creates new HistoricalWQKms (new subclass of WQKms). Those WQKms are used
to create new facets from (new) type 'HistoricalDischargeCurveFacet'. The chart generator is
improved to support those facets.
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 24 Oct 2012 14:34:35 +0200 |
parents | eab357067e06 |
children | 05eeedc5b156 |
rev | line source |
---|---|
2191
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.states; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import org.apache.log4j.Logger; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import org.w3c.dom.Element; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import de.intevation.artifacts.Artifact; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import de.intevation.artifacts.ArtifactNamespaceContext; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 import de.intevation.artifacts.CallContext; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import de.intevation.artifacts.CallMeta; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.flys.artifacts.resources.Resources; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 /** |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 */ |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 public class HistoricalDischargeState extends DefaultState { |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 private static final Logger logger = |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 Logger.getLogger(HistoricalDischargeState.class); |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 |
2210
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
26 public static final String I18N_MODE_W = "historical.mode.w"; |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
27 public static final String I18N_MODE_Q = "historical.mode.q"; |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
28 |
2191
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 public static final String DATA_MODE = "historical_mode"; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 public static final String DATA_VALUES = "historical_values"; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 public static final int DATA_MODE_W = 0; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 public static final int DATA_MODE_Q = 1; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 @Override |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 protected String getUIProvider() { |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 return "wq_simple_array"; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 } |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 protected void appendItems( |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 Artifact artifact, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 ElementCreator creator, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 String name, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 CallContext context, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 Element select |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 ) { |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 if (name != null && name.equals(DATA_VALUES)) { |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 select.setAttributeNS( |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 ArtifactNamespaceContext.NAMESPACE_URI, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 "art:type", |
2255
eab357067e06
W/Q input values in historical discharge curves may now by from type double.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2210
diff
changeset
|
51 "doublearray"); |
2191
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 } |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 else if (name != null && name.equals(DATA_MODE)) { |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 select.setAttributeNS( |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 ArtifactNamespaceContext.NAMESPACE_URI, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 "art:type", |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 "intoptions"); |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 } |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 super.appendItems(artifact, creator, name, context, select); |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 } |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 @Override |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 protected Element[] createItems( |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 ElementCreator creator, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 Artifact artifact, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 String name, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 CallContext context |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 ) { |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 logger.debug("createItems()"); |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 if (name != null && name.equals(DATA_MODE)) { |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 return createModeItem(creator, artifact, name, context); |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 } |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 else if (name != null && name.equals(DATA_VALUES)) { |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 return createValuesItem(creator, artifact, name, context); |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 } |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 logger.warn("Tried to create item for invalid data: " + name); |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 return new Element[0]; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 } |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 |
2210
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
86 @Override |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
87 protected String getLabelFor( |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
88 CallContext cc, |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
89 String name, |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
90 String value, |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
91 String type |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
92 ) { |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
93 CallMeta meta = cc.getMeta(); |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
94 |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
95 if (name.equals(DATA_MODE)) { |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
96 if (value.equals(String.valueOf(DATA_MODE_W))) { |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
97 return Resources.getMsg(meta, I18N_MODE_W, I18N_MODE_W); |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
98 } |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
99 else { |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
100 return Resources.getMsg(meta, I18N_MODE_Q, I18N_MODE_Q); |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
101 } |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
102 } |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
103 else { |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
104 return value; |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
105 } |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
106 } |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
107 |
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
108 |
2191
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 protected Element[] createModeItem( |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 ElementCreator creator, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 Artifact artifact, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 String name, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 CallContext context |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 ) { |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 logger.debug("createModeItem()"); |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 CallMeta meta = context.getMeta(); |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 Element modeW = createItem( |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 creator, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 new String[] { |
2210
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
122 Resources.getMsg(meta, I18N_MODE_W, I18N_MODE_W), |
2191
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 String.valueOf(DATA_MODE_W) } ); |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 Element modeQ = createItem( |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 creator, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 new String[] { |
2210
66408cdca36f
Override getLabelFor() in HistoricalDischargeState to return an I18N string for the selected evaluation mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2191
diff
changeset
|
128 Resources.getMsg(meta, I18N_MODE_Q, I18N_MODE_Q), |
2191
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 String.valueOf(DATA_MODE_Q) } ); |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 return new Element[] { modeW, modeQ }; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 } |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 protected Element[] createValuesItem( |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 ElementCreator creator, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 Artifact artifact, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 String name, |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 CallContext context |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 ) { |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 logger.debug("createValuesItem()"); |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 Element valuesW = createItem( |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 creator, new String[] { "ws", "" } ); |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 Element valuesQ = createItem( |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 creator, new String[] { "qs", "" } ); |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 return new Element[] { valuesW, valuesQ }; |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 } |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 } |
f28844a57fed
Added states (work is not finished yet) for the 'historical discharge curve' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
152 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |