annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/EnterMultipleLocationsState.java @ 2791:c9815016a3bb

Merged revisions 4536 via svnmerge from file:///home/clients/bsh/bsh-generischer-viewer/Material/SVN/flys-artifacts/trunk ........ r4536 | ingo | 2012-05-27 15:35:15 +0200 (So, 27 Mai 2012) | 1 line Added more checks in CrossSectionFactory.isNewst() to prevent IndexOutOfBoundsExceptions. ........ flys-artifacts/tags/2.7@4538 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Sun, 27 May 2012 13:39:30 +0000
parents f4ca234ba214
children 5642a83420f2
rev   line source
2306
cc6b8af44728 Prepare new data input for reference curves 'Ziel' locations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts.states;
cc6b8af44728 Prepare new data input for reference curves 'Ziel' locations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
2
2312
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
3 import de.intevation.artifacts.CallContext;
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
4 import de.intevation.artifacts.common.utils.StringUtils;
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
5
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
6
2306
cc6b8af44728 Prepare new data input for reference curves 'Ziel' locations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
7 /**
cc6b8af44728 Prepare new data input for reference curves 'Ziel' locations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
8 * Get me doubles (km).
cc6b8af44728 Prepare new data input for reference curves 'Ziel' locations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
9 */
cc6b8af44728 Prepare new data input for reference curves 'Ziel' locations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
10 public class EnterMultipleLocationsState extends EnterLocationState {
cc6b8af44728 Prepare new data input for reference curves 'Ziel' locations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
11
cc6b8af44728 Prepare new data input for reference curves 'Ziel' locations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
12 @Override
cc6b8af44728 Prepare new data input for reference curves 'Ziel' locations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
13 protected String getUIProvider() {
cc6b8af44728 Prepare new data input for reference curves 'Ziel' locations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
14 return "multi_location_panel";
cc6b8af44728 Prepare new data input for reference curves 'Ziel' locations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
15 }
2312
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
16
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
17
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
18 /** Deal with multiple double values. */
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
19 @Override
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
20 protected String getLabelFor(
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
21 CallContext cc,
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
22 String name,
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
23 String value,
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
24 String type
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
25 ) {
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
26 String label = "";
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
27 String[] vals = value.split(" ");
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
28 for (int i = 0; i < vals.length; i++) {
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
29 vals[i] = super.getLabelFor(cc, name, vals[i], type);
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
30 }
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
31
2314
f4ca234ba214 Fix call to StringUtils.join .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2312
diff changeset
32 return StringUtils.join(" ", vals);
2312
f911ddd93f58 Format multiple double values with a locale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2306
diff changeset
33 }
2306
cc6b8af44728 Prepare new data input for reference curves 'Ziel' locations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
34 }
cc6b8af44728 Prepare new data input for reference curves 'Ziel' locations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
35 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org