Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/CalculationSelect.java @ 1148:302461d5d071
Cosmetics.
flys-artifacts/trunk@2678 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 08 Sep 2011 11:29:04 +0000 |
parents | eccf966fb677 |
children | fc572b30f1b8 |
comparison
equal
deleted
inserted
replaced
1147:e7d5452a7381 | 1148:302461d5d071 |
---|---|
19 /** | 19 /** |
20 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 20 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
21 */ | 21 */ |
22 public class CalculationSelect extends DefaultState { | 22 public class CalculationSelect extends DefaultState { |
23 | 23 |
24 /** The logger that is used in this class.*/ | 24 /** The logger that is used in this class. */ |
25 private static Logger logger = Logger.getLogger(CalculationSelect.class); | 25 private static Logger logger = Logger.getLogger(CalculationSelect.class); |
26 | |
27 | 26 |
28 | 27 |
29 public static final String FIELD_MODE = "calculation_mode"; | 28 public static final String FIELD_MODE = "calculation_mode"; |
30 | 29 |
31 /** Constant value for the reference line calculation.*/ | 30 /** Constant value for the reference line calculation. */ |
32 public static final String CALCULATION_SURFACE_CURVE = | 31 public static final String CALCULATION_SURFACE_CURVE = |
33 "calc.surface.curve"; | 32 "calc.surface.curve"; |
34 | 33 |
35 /** Constant value for the differences calculation.*/ | 34 /** Constant value for the differences calculation. */ |
36 public static final String CALCULATION_DURATION_CURVE = | 35 public static final String CALCULATION_DURATION_CURVE = |
37 "calc.duration.curve"; | 36 "calc.duration.curve"; |
38 | 37 |
39 /** Constant value for the flood map calculation.*/ | 38 /** Constant value for the flood map calculation. */ |
40 public static final String CALCULATION_FLOOD_MAP = | 39 public static final String CALCULATION_FLOOD_MAP = |
41 "calc.flood.map"; | 40 "calc.flood.map"; |
42 | 41 |
43 /** Constant value for the profile calculation.*/ | 42 /** Constant value for the profile calculation. */ |
44 public static final String CALCULATION_DISCHARGE_LONGITUDINAL_CURVE = | 43 public static final String CALCULATION_DISCHARGE_LONGITUDINAL_CURVE = |
45 "calc.discharge.longitudinal.section"; | 44 "calc.discharge.longitudinal.section"; |
46 | 45 |
47 /** Constant value for the state discharge curve calculation.*/ | 46 /** Constant value for the state discharge curve calculation. */ |
48 public static final String CALCULATION_DISCHARGE_CURVE = | 47 public static final String CALCULATION_DISCHARGE_CURVE = |
49 "calc.discharge.curve"; | 48 "calc.discharge.curve"; |
50 | 49 |
51 /** An array that holds all available calculation modes.*/ | 50 /** An array that holds all available calculation modes.*/ |
52 public static final String[] CALCULATIONS = { | 51 public static final String[] CALCULATIONS = { |
55 CALCULATION_DISCHARGE_CURVE, | 54 CALCULATION_DISCHARGE_CURVE, |
56 CALCULATION_DURATION_CURVE, | 55 CALCULATION_DURATION_CURVE, |
57 CALCULATION_DISCHARGE_LONGITUDINAL_CURVE }; | 56 CALCULATION_DISCHARGE_LONGITUDINAL_CURVE }; |
58 | 57 |
59 | 58 |
60 /** Error message that is thrown if no mode has been chosen.*/ | 59 /** Error message that is thrown if no mode has been chosen. */ |
61 public static final String ERROR_NO_CALCULATION_MODE = | 60 public static final String ERROR_NO_CALCULATION_MODE = |
62 "error_feed_no_calculation_mode"; | 61 "error_feed_no_calculation_mode"; |
63 | 62 |
64 /** Error message that is thrown if an invalid calculation mode has been | 63 /** Error message that is thrown if an invalid calculation mode has been |
65 * chosen.*/ | 64 * chosen. */ |
66 public static final String ERROR_INVALID_CALCULATION_MODE = | 65 public static final String ERROR_INVALID_CALCULATION_MODE = |
67 "error_feed_invalid_calculation_mode"; | 66 "error_feed_invalid_calculation_mode"; |
68 | 67 |
69 | 68 |
70 public CalculationSelect() { | 69 public CalculationSelect() { |
118 { | 117 { |
119 logger.debug("CalculationSelect.validate"); | 118 logger.debug("CalculationSelect.validate"); |
120 FLYSArtifact flys = (FLYSArtifact) artifact; | 119 FLYSArtifact flys = (FLYSArtifact) artifact; |
121 | 120 |
122 StateData data = getData(flys, FIELD_MODE); | 121 StateData data = getData(flys, FIELD_MODE); |
123 String calc = data != null ? (String) data.getValue() : null; | 122 String calc = (data != null) ? (String) data.getValue() : null; |
124 | 123 |
125 if (calc == null) { | 124 if (calc == null) { |
126 throw new IllegalArgumentException(ERROR_NO_CALCULATION_MODE); | 125 throw new IllegalArgumentException(ERROR_NO_CALCULATION_MODE); |
127 } | 126 } |
128 | 127 |