Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/LocationSelect.java @ 4865:1358d0c8481c
RangeState and descendants: Use RangeAccess, resolve direct ld_* usage.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 24 Jan 2013 16:09:46 +0100 |
parents | 90ef6fdcf688 |
children | acfd48384835 |
comparison
equal
deleted
inserted
replaced
4864:dc0d37715e16 | 4865:1358d0c8481c |
---|---|
16 public class LocationSelect extends RangeState { | 16 public class LocationSelect extends RangeState { |
17 | 17 |
18 /** The logger used in this class. */ | 18 /** The logger used in this class. */ |
19 private static Logger logger = Logger.getLogger(LocationSelect.class); | 19 private static Logger logger = Logger.getLogger(LocationSelect.class); |
20 | 20 |
21 private static final String LOWER = "from"; | |
22 | |
23 private static final String UPPER = "to"; | |
24 | |
25 private static final String STEP = "step"; | |
26 | |
27 | |
28 /** | 21 /** |
29 * The default constructor that initializes an empty State object. | 22 * The default constructor that initializes an empty State object. |
30 */ | 23 */ |
31 public LocationSelect() { | 24 public LocationSelect() { |
32 } | 25 } |
40 protected double[] getMinMax(Artifact artifact) { | 33 protected double[] getMinMax(Artifact artifact) { |
41 FLYSArtifact flysArtifact = (FLYSArtifact) artifact; | 34 FLYSArtifact flysArtifact = (FLYSArtifact) artifact; |
42 return FLYSUtils.getRiverMinMax(flysArtifact); | 35 return FLYSUtils.getRiverMinMax(flysArtifact); |
43 } | 36 } |
44 | 37 |
45 @Override | |
46 protected String getLowerField() { | |
47 return LOWER; | |
48 } | |
49 | |
50 @Override | |
51 protected String getUpperField() { | |
52 return UPPER; | |
53 } | |
54 | |
55 @Override | |
56 protected String getStepField() { | |
57 return STEP; | |
58 } | |
59 | |
60 | 38 |
61 /** Misuse to set location mode. */ | 39 /** Misuse to set location mode. */ |
62 @Override | 40 @Override |
63 public boolean validate(Artifact artifact) | 41 public boolean validate(Artifact artifact) |
64 throws IllegalArgumentException | 42 throws IllegalArgumentException |
65 { | 43 { |
66 ((FLYSArtifact) artifact).addStringData("ld_mode", "distance"); | 44 ((FLYSArtifact) artifact).addStringData("ld_mode", "distance"); |
67 return super.validate(artifact); | 45 return super.validate(artifact); |
68 } | 46 } |
69 | |
70 | |
71 } | 47 } |
72 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : | 48 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |