annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/EnterLocationState.java @ 2253:707b47d8c554

Dont sort the data series in reference curve. flys-artifacts/trunk@3903 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 03 Feb 2012 14:53:11 +0000
parents c9c788eea200
children ee7e774ed5b4
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
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
3 import java.util.Calendar;
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
4 import java.util.List;
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
5
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
6 import org.apache.log4j.Logger;
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
7
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
8 import org.hibernate.Session;
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
9 import org.hibernate.SQLQuery;
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
10 import org.hibernate.type.StandardBasicTypes;
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 import de.intevation.flys.model.Gauge;
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
13 import de.intevation.flys.backend.SessionHolder;
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
14
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
15 import de.intevation.flys.artifacts.FLYSArtifact;
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
16 import de.intevation.flys.utils.FLYSUtils;
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
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
19 /**
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
20 * Get me a double startpoint.
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 public class EnterLocationState extends InputDoubleState {
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 private static final Logger logger =
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
25 Logger.getLogger(EnterLocationState.class);
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
26
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 @Override
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
29 protected String getUIProvider() {
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
30 return "location_panel";
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 getLower(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[0]
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
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
44 @Override
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
45 protected Object getUpper(FLYSArtifact flys) {
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
46 double[] lowerUpper = FLYSUtils.getRiverMinMax(flys);
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
47
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
48 return lowerUpper != null
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
49 ? lowerUpper[1]
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
50 : 0;
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
51 }
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
52 }
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
53 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org