Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/RiversideRadioChoice.java @ 9257:ef7b65576d4b
Added W and Q main values to S-Info flood duration curve chart
author | mschaefer |
---|---|
date | Fri, 13 Jul 2018 18:38:05 +0200 |
parents | dace17e26d33 |
children | 1a4d2ce77423 |
rev | line source |
---|---|
9050 | 1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU AGPL (>=v3) | |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
6 * documentation coming with Dive4Elements River for details. | |
7 */ | |
8 | |
9054
95643dffd006
rename grounding->collision; inundation_duration->flood_duration
gernotbelger
parents:
9053
diff
changeset
|
9 package org.dive4elements.river.artifacts.sinfo.flood_duration; |
9050 | 10 |
9178
2f5052835b76
uinfo inundationduration langjähr. Mittel, Uedauern.properties, Meldung
gernotbelger
parents:
9054
diff
changeset
|
11 import java.util.LinkedHashMap; |
9053 | 12 |
9178
2f5052835b76
uinfo inundationduration langjähr. Mittel, Uedauern.properties, Meldung
gernotbelger
parents:
9054
diff
changeset
|
13 import org.dive4elements.artifacts.Artifact; |
2f5052835b76
uinfo inundationduration langjähr. Mittel, Uedauern.properties, Meldung
gernotbelger
parents:
9054
diff
changeset
|
14 import org.dive4elements.artifacts.CallMeta; |
9053 | 15 import org.dive4elements.river.artifacts.states.RadioSelect; |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
16 import org.dive4elements.river.model.Attribute.AttributeKey; |
9050 | 17 |
18 /** | |
19 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
20 */ | |
9053 | 21 public class RiversideRadioChoice extends RadioSelect { |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
22 |
9050 | 23 private static final long serialVersionUID = 1L; |
24 | |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
25 public enum RiversideChoiceKey { |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
26 NONE("", AttributeKey.NONE), // |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
27 LEFT("state.sinfo.riverside.left", AttributeKey.LEFT), // |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
28 RIGHT("state.sinfo.riverside.right", AttributeKey.RIGHT), // |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
29 BOTH("state.sinfo.riverside.both", AttributeKey.UNKNOWN); |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
30 |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
31 private final String key; |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
32 private final AttributeKey attributeKey; |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
33 |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
34 RiversideChoiceKey(final String key, final AttributeKey attributeKey) { |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
35 this.key = key; |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
36 this.attributeKey = attributeKey; |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
37 } |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
38 |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
39 public static RiversideChoiceKey fromKey(final String key) { |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
40 for (final RiversideChoiceKey v : values()) { |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
41 if (key.equalsIgnoreCase(v.key)) |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
42 return v; |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
43 } |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
44 return NONE; |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
45 } |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
46 |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
47 public String getKey() { |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
48 return this.key; |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
49 } |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
50 |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
51 public AttributeKey getAttributeKey() { |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
52 return this.attributeKey; |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
53 } |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
54 } |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9054
diff
changeset
|
55 |
9053 | 56 @Override |
9178
2f5052835b76
uinfo inundationduration langjähr. Mittel, Uedauern.properties, Meldung
gernotbelger
parents:
9054
diff
changeset
|
57 protected LinkedHashMap<String, String> makeEntries(final CallMeta meta, final Artifact artifact) { |
2f5052835b76
uinfo inundationduration langjähr. Mittel, Uedauern.properties, Meldung
gernotbelger
parents:
9054
diff
changeset
|
58 final LinkedHashMap<String, String> entries = new LinkedHashMap<>(); |
9179 | 59 entries.put(RiversideChoiceKey.LEFT.getKey(), null); |
60 entries.put(RiversideChoiceKey.RIGHT.getKey(), null); | |
61 entries.put(RiversideChoiceKey.BOTH.getKey(), null); | |
9053 | 62 return entries; |
63 } | |
9050 | 64 } |