comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ScenarioSelect.java @ 1064:13784581ab0c

Moved the input of user defined barriers for the floodmap to an earlier state. flys-artifacts/trunk@2542 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 24 Aug 2011 08:22:09 +0000
parents eccf966fb677
children fb5a7ff9feb8
comparison
equal deleted inserted replaced
1063:e7c1ebfc2701 1064:13784581ab0c
10 10
11 import de.intevation.artifacts.common.utils.XMLUtils; 11 import de.intevation.artifacts.common.utils.XMLUtils;
12 12
13 import de.intevation.artifactdatabase.ProtocolUtils; 13 import de.intevation.artifactdatabase.ProtocolUtils;
14 14
15 import de.intevation.flys.artifacts.FLYSArtifact;
15 import de.intevation.flys.artifacts.resources.Resources; 16 import de.intevation.flys.artifacts.resources.Resources;
16 17
17 /** 18 /**
18 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> 19 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
19 */ 20 */
21 22
22 /** The logger that is used in this class.*/ 23 /** The logger that is used in this class.*/
23 private static Logger logger = Logger.getLogger(ScenarioSelect.class); 24 private static Logger logger = Logger.getLogger(ScenarioSelect.class);
24 25
25 26
26 public static final String FIELD_MODE = "szenario"; 27 public static final String FIELD_MODE = "scenario";
28 public static final String FIELD_BARRIERS = "uesk.barriers";
27 29
28 public static final String SCENARIO_CURRENT = "scenario.current"; 30 public static final String SCENARIO_CURRENT = "scenario.current";
29 public static final String SCENARIO_POTENTIEL = "scenario.potentiel"; 31 public static final String SCENARIO_POTENTIEL = "scenario.potentiel";
30 public static final String SCENARIO_SCENRAIO = "scenario.scenario"; 32 public static final String SCENARIO_SCENRAIO = "scenario.scenario";
31 33
33 SCENARIO_CURRENT, 35 SCENARIO_CURRENT,
34 SCENARIO_POTENTIEL, 36 SCENARIO_POTENTIEL,
35 SCENARIO_SCENRAIO }; 37 SCENARIO_SCENRAIO };
36 38
37 39
40
41 @Override
42 protected String getUIProvider() {
43 return "map_digitize";
44 }
45
46
38 @Override 47 @Override
39 protected Element[] createItems( 48 protected Element[] createItems(
40 XMLUtils.ElementCreator cr, 49 XMLUtils.ElementCreator cr,
41 Artifact artifact, 50 Artifact artifact,
42 String name, 51 String name,
43 CallContext context) 52 CallContext context)
44 { 53 {
45 CallMeta meta = context.getMeta(); 54 CallMeta meta = context.getMeta();
46 Element[] scenarios = new Element[SCENARIOS.length];
47 55
48 int i = 0; 56 if (name.equals(FIELD_MODE)) {
57 Element[] scenarios = new Element[SCENARIOS.length];
49 58
50 for (String scenario: SCENARIOS) { 59 int i = 0;
51 scenarios[i++] = createItem( 60
52 cr, new String[] { 61 for (String scenario: SCENARIOS) {
53 Resources.getMsg(meta, scenario, scenario), 62 scenarios[i++] = createItem(
54 scenario 63 cr, new String[] {
55 }); 64 Resources.getMsg(meta, scenario, scenario),
65 scenario
66 });
67 }
68
69 return scenarios;
56 } 70 }
71 else {
72 FLYSArtifact flys = (FLYSArtifact) artifact;
73 String data = flys.getDataAsString(name);
57 74
58 return scenarios; 75 return new Element[] { createItem(
76 cr,
77 new String[] {
78 Resources.getMsg(meta, name, name),
79 data
80 }
81 )};
82 }
59 } 83 }
60 84
61 85
62 protected Element createItem(XMLUtils.ElementCreator cr, Object obj) { 86 protected Element createItem(XMLUtils.ElementCreator cr, Object obj) {
63 Element item = ProtocolUtils.createArtNode(cr, "item", null, null); 87 Element item = ProtocolUtils.createArtNode(cr, "item", null, null);

http://dive4elements.wald.intevation.org