Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/YearEpochSelect.java @ 9053:ad2ae847e10e
- RadioButton-Auswahl generisch
- Überflutungsdauern (inudation of infrastructures) Ablauf states
author | gernotbelger |
---|---|
date | Fri, 04 May 2018 13:17:57 +0200 |
parents | 5ffbf97766f7 |
children | 1a4d2ce77423 |
comparison
equal
deleted
inserted
replaced
9052:a6c19528ac16 | 9053:ad2ae847e10e |
---|---|
6 * documentation coming with Dive4Elements River for details. | 6 * documentation coming with Dive4Elements River for details. |
7 */ | 7 */ |
8 | 8 |
9 package org.dive4elements.river.artifacts.states.minfo; | 9 package org.dive4elements.river.artifacts.states.minfo; |
10 | 10 |
11 import org.w3c.dom.Element; | |
12 | |
13 import org.dive4elements.artifacts.Artifact; | 11 import org.dive4elements.artifacts.Artifact; |
14 import org.dive4elements.artifacts.CallContext; | 12 import org.dive4elements.artifacts.CallContext; |
15 import org.dive4elements.artifacts.CallMeta; | 13 import org.dive4elements.artifacts.CallMeta; |
16 import org.dive4elements.artifacts.common.utils.XMLUtils; | 14 import org.dive4elements.artifacts.common.utils.XMLUtils; |
17 import org.dive4elements.river.artifacts.resources.Resources; | 15 import org.dive4elements.river.artifacts.resources.Resources; |
18 import org.dive4elements.river.artifacts.states.DefaultState; | 16 import org.dive4elements.river.artifacts.states.DefaultState; |
17 import org.w3c.dom.Element; | |
19 | 18 |
20 /** | 19 /** |
21 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> | 20 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
22 */ | 21 */ |
23 public class YearEpochSelect extends DefaultState { | 22 public class YearEpochSelect extends DefaultState {// TODO: RadioSelect-class; more flexible Implementation |
24 | 23 |
25 /** | 24 /** |
26 * The default constructor that initializes an empty State object. | 25 * The default constructor that initializes an empty State object. |
27 */ | 26 */ |
28 public YearEpochSelect() { | 27 public YearEpochSelect() { |
32 protected String getUIProvider() { | 31 protected String getUIProvider() { |
33 return "minfo.bed.year_epoch"; | 32 return "minfo.bed.year_epoch"; |
34 } | 33 } |
35 | 34 |
36 @Override | 35 @Override |
37 protected Element[] createItems( | 36 protected Element[] createItems(final XMLUtils.ElementCreator ec, final Artifact artifact, final String name, final CallContext context) { |
38 XMLUtils.ElementCreator ec, | 37 final CallMeta meta = context.getMeta(); |
39 Artifact artifact, | |
40 String name, | |
41 CallContext context) | |
42 { | |
43 CallMeta meta = context.getMeta(); | |
44 Element[] elements; | 38 Element[] elements; |
45 | 39 |
46 /* Disable calculation of official epochs | 40 /* |
47 if (((D4EArtifact)artifact).getCurrentStateId() | 41 * Disable calculation of official epochs |
48 .equals("state.minfo.sediment.load.year_epoch") | 42 * if (((D4EArtifact)artifact).getCurrentStateId() |
49 ) { | 43 * .equals("state.minfo.sediment.load.year_epoch") |
50 elements = new Element[3]; | 44 * ) { |
51 elements[2] = createItem( | 45 * elements = new Element[3]; |
52 ec, | 46 * elements[2] = createItem( |
53 new String[] { | 47 * ec, |
54 Resources.getMsg(meta, | 48 * new String[] { |
55 "state.minfo.off_epoch", | 49 * Resources.getMsg(meta, |
56 "state.minfo.off_epoch"), | 50 * "state.minfo.off_epoch", |
57 "off_epoch"}); | 51 * "state.minfo.off_epoch"), |
58 } | 52 * "off_epoch"}); |
59 else { | 53 * } |
60 elements = new Element[2]; | 54 * else { |
61 } */ | 55 * elements = new Element[2]; |
56 * } | |
57 */ | |
62 elements = new Element[2]; | 58 elements = new Element[2]; |
63 elements[0] = createItem( | 59 elements[0] = createItem(ec, new String[] { Resources.getMsg(meta, "state.minfo.year", "state.minfo.year"), "year" }); |
64 ec, | |
65 new String[] { | |
66 Resources.getMsg(meta, | |
67 "state.minfo.year", | |
68 "state.minfo.year"), | |
69 "year"}); | |
70 | 60 |
71 elements[1] = createItem( | 61 elements[1] = createItem(ec, new String[] { Resources.getMsg(meta, "state.minfo.epoch", "state.minfo.epoch"), "epoch" }); |
72 ec, | |
73 new String[] { | |
74 Resources.getMsg(meta, | |
75 "state.minfo.epoch", | |
76 "state.minfo.epoch"), | |
77 "epoch"}); | |
78 | 62 |
79 return elements; | 63 return elements; |
80 } | 64 } |
81 } | 65 } |
82 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : | 66 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |