Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/LocationSelect.java @ 5838:5aa05a7a34b7
Rename modules to more fitting names.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 15:23:37 +0200 |
parents | flys-artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/LocationSelect.java@bd047b71ab37 |
children | 4897a58c8746 |
comparison
equal
deleted
inserted
replaced
5837:d9901a08d0a6 | 5838:5aa05a7a34b7 |
---|---|
1 package org.dive4elements.river.artifacts.states.fixation; | |
2 | |
3 import org.apache.log4j.Logger; | |
4 | |
5 import org.dive4elements.artifacts.Artifact; | |
6 | |
7 import org.dive4elements.river.utils.FLYSUtils; | |
8 | |
9 import org.dive4elements.river.artifacts.FLYSArtifact; | |
10 import org.dive4elements.river.artifacts.states.RangeState; | |
11 | |
12 | |
13 /** | |
14 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> | |
15 */ | |
16 public class LocationSelect extends RangeState { | |
17 | |
18 /** The logger used in this class. */ | |
19 private static Logger logger = Logger.getLogger(LocationSelect.class); | |
20 | |
21 private static final String LOWER = "ld_from"; | |
22 | |
23 private static final String UPPER = "ld_to"; | |
24 | |
25 private static final String STEP = "ld_step"; | |
26 | |
27 | |
28 /** | |
29 * The default constructor that initializes an empty State object. | |
30 */ | |
31 public LocationSelect() { | |
32 } | |
33 | |
34 @Override | |
35 protected String getUIProvider() { | |
36 return "fix.location_panel"; | |
37 } | |
38 | |
39 @Override | |
40 protected double[] getMinMax(Artifact artifact) { | |
41 FLYSArtifact flysArtifact = (FLYSArtifact) artifact; | |
42 return FLYSUtils.getRiverMinMax(flysArtifact); | |
43 } | |
44 | |
45 | |
46 /** Misuse to set location mode. */ | |
47 @Override | |
48 public boolean validate(Artifact artifact) | |
49 throws IllegalArgumentException | |
50 { | |
51 ((FLYSArtifact) artifact).addStringData("ld_mode", "distance"); | |
52 return super.validate(artifact); | |
53 } | |
54 } | |
55 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |