annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/EnterLocationState.java @ 2296:d69d8dea78dc

Be more merciful for building the URL for the user-wms. flys-artifacts/trunk@3962 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 08 Feb 2012 10:54:23 +0000
parents ee7e774ed5b4
children cc6b8af44728
rev   line source
2251
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts.states;
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
2
2254
ee7e774ed5b4 Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2251
diff changeset
3 import de.intevation.flys.artifacts.FLYSArtifact;
ee7e774ed5b4 Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2251
diff changeset
4
ee7e774ed5b4 Removed superfluous imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2251
diff changeset
5 import de.intevation.flys.utils.FLYSUtils;
2251
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
6
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
7 import org.apache.log4j.Logger;
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
8
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
9 /**
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
10 * Get me a double startpoint.
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
11 */
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
12 public class EnterLocationState extends InputDoubleState {
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
13
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
14 private static final Logger logger =
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
15 Logger.getLogger(EnterLocationState.class);
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
16
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
17
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
18 @Override
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
19 protected String getUIProvider() {
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
20 return "location_panel";
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
21 }
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
22
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
23
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
24 @Override
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
25 protected Object getLower(FLYSArtifact flys) {
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
26 double[] lowerUpper = FLYSUtils.getRiverMinMax(flys);
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
27
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
28 return lowerUpper != null
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
29 ? lowerUpper[0]
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
30 : 0;
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
31 }
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
32
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
33
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
34 @Override
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
35 protected Object getUpper(FLYSArtifact flys) {
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
36 double[] lowerUpper = FLYSUtils.getRiverMinMax(flys);
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
37
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
38 return lowerUpper != null
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
39 ? lowerUpper[1]
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
40 : 0;
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
41 }
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
42 }
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
43 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org