Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/EnterMultipleLocationsState.java @ 3649:33bfc01410fb
Merged revisions 5375,5379,5382 via svnmerge from
file:///home/clients/bsh/bsh-generischer-viewer/Material/SVN/flys-artifacts/trunk
........
r5375 | ingo | 2012-09-07 11:26:45 +0200 (Fr, 07 Sep 2012) | 1 line
Tagged 'flys-artifacts' as 2.9
........
r5379 | rrenkert | 2012-09-07 13:58:41 +0200 (Fr, 07 Sep 2012) | 4 lines
Issue 791.
Add start km to data to compare reference and target km in next state.
........
r5382 | rrenkert | 2012-09-07 14:03:48 +0200 (Fr, 07 Sep 2012) | 3 lines
Set data for characteristic diameter for use in parameter matrix UI.
........
flys-artifacts/tags/2.9@5388 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 07 Sep 2012 13:12:08 +0000 |
parents | 5642a83420f2 |
children | 8e66293c5369 |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/EnterMultipleLocationsState.java Fri Sep 07 09:12:11 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/EnterMultipleLocationsState.java Fri Sep 07 13:12:08 2012 +0000 @@ -1,16 +1,25 @@ package de.intevation.flys.artifacts.states; +import org.apache.log4j.Logger; +import org.w3c.dom.Element; + +import de.intevation.artifacts.Artifact; import de.intevation.artifacts.CallContext; import de.intevation.artifacts.common.utils.StringUtils; +import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; +import de.intevation.flys.artifacts.WINFOArtifact; /** * Get me doubles (km). */ public class EnterMultipleLocationsState extends EnterLocationState { + /** The logger for this class. */ + private static Logger logger = Logger.getLogger(EnterMultipleLocationsState.class); @Override protected String getUIProvider() { + logger.debug("multi location panel"); return "multi_location_panel"; } @@ -31,5 +40,34 @@ return StringUtils.join(" ", vals); } + + /** + * This method creates a list of items. These items represent the amount of + * input data that is possible for this state. + * + * @param cr The ElementCreator. + * @param name The name of the amount of data. + * + * @return a list of items. + */ + @Override + protected Element[] createItems( + ElementCreator cr, + Artifact artifact, + String name, + CallContext context + ) { + if (name.equals("reference_endpoint")) { + Element[] elements = new Element[1]; + WINFOArtifact winfo = (WINFOArtifact) artifact; + Double km = winfo.getReferenceStartKm(); + elements[0] = createItem( + cr, + new String[] {"start_km", km.toString()}); + return elements; + } + return null; + } + } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :