Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/EnterMultipleLocationsState.java @ 3721:1cfe788325d5
Issue 791.
Add start km to data to compare reference and target km in next state.
flys-artifacts/trunk@5379 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 07 Sep 2012 11:58:41 +0000 |
parents | 5642a83420f2 |
children | 8e66293c5369 |
comparison
equal
deleted
inserted
replaced
3720:181e250bf989 | 3721:1cfe788325d5 |
---|---|
1 package de.intevation.flys.artifacts.states; | 1 package de.intevation.flys.artifacts.states; |
2 | 2 |
3 import org.apache.log4j.Logger; | |
4 import org.w3c.dom.Element; | |
5 | |
6 import de.intevation.artifacts.Artifact; | |
3 import de.intevation.artifacts.CallContext; | 7 import de.intevation.artifacts.CallContext; |
4 import de.intevation.artifacts.common.utils.StringUtils; | 8 import de.intevation.artifacts.common.utils.StringUtils; |
9 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; | |
10 import de.intevation.flys.artifacts.WINFOArtifact; | |
5 | 11 |
6 | 12 |
7 /** | 13 /** |
8 * Get me doubles (km). | 14 * Get me doubles (km). |
9 */ | 15 */ |
10 public class EnterMultipleLocationsState extends EnterLocationState { | 16 public class EnterMultipleLocationsState extends EnterLocationState { |
17 /** The logger for this class. */ | |
18 private static Logger logger = Logger.getLogger(EnterMultipleLocationsState.class); | |
11 | 19 |
12 @Override | 20 @Override |
13 protected String getUIProvider() { | 21 protected String getUIProvider() { |
22 logger.debug("multi location panel"); | |
14 return "multi_location_panel"; | 23 return "multi_location_panel"; |
15 } | 24 } |
16 | 25 |
17 | 26 |
18 /** Deal with multiple double values. */ | 27 /** Deal with multiple double values. */ |
29 vals[i] = super.getLabelFor(cc, name, vals[i], type); | 38 vals[i] = super.getLabelFor(cc, name, vals[i], type); |
30 } | 39 } |
31 | 40 |
32 return StringUtils.join(" ", vals); | 41 return StringUtils.join(" ", vals); |
33 } | 42 } |
43 | |
44 /** | |
45 * This method creates a list of items. These items represent the amount of | |
46 * input data that is possible for this state. | |
47 * | |
48 * @param cr The ElementCreator. | |
49 * @param name The name of the amount of data. | |
50 * | |
51 * @return a list of items. | |
52 */ | |
53 @Override | |
54 protected Element[] createItems( | |
55 ElementCreator cr, | |
56 Artifact artifact, | |
57 String name, | |
58 CallContext context | |
59 ) { | |
60 if (name.equals("reference_endpoint")) { | |
61 Element[] elements = new Element[1]; | |
62 WINFOArtifact winfo = (WINFOArtifact) artifact; | |
63 Double km = winfo.getReferenceStartKm(); | |
64 elements[0] = createItem( | |
65 cr, | |
66 new String[] {"start_km", km.toString()}); | |
67 return elements; | |
68 } | |
69 return null; | |
70 } | |
71 | |
34 } | 72 } |
35 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : | 73 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |