Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveGenerator.java @ 8856:5e38e2924c07 3.2.x
Fix code style.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 18 Jan 2018 20:12:01 +0100 |
parents | e4606eae8ea5 |
children | 1cc7653ca84f 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8855:d7c005e12af0 | 8856:5e38e2924c07 |
---|---|
45 implements FacetTypes { | 45 implements FacetTypes { |
46 | 46 |
47 private static Logger log = Logger | 47 private static Logger log = Logger |
48 .getLogger(HistoricalDischargeCurveGenerator.class); | 48 .getLogger(HistoricalDischargeCurveGenerator.class); |
49 | 49 |
50 public static final String I18N_CHART_TITLE = "chart.historical.discharge.title"; | 50 public static final String I18N_CHART_TITLE = |
51 | 51 "chart.historical.discharge.title"; |
52 public static final String I18N_CHART_SUBTITLE = "chart.historical.discharge.subtitle"; | 52 |
53 | 53 public static final String I18N_CHART_SUBTITLE = |
54 public static final String I18N_XAXIS_LABEL = "chart.historical.discharge.xaxis.label"; | 54 "chart.historical.discharge.subtitle"; |
55 | 55 |
56 public static final String I18N_YAXIS_LABEL = "chart.historical.discharge.yaxis.label"; | 56 public static final String I18N_XAXIS_LABEL = |
57 | 57 "chart.historical.discharge.xaxis.label"; |
58 public static final String I18N_YAXIS_SECOND_LABEL = "chart.historical.discharge.yaxis.second.label"; | 58 |
59 public static final String I18N_YAXIS_LABEL = | |
60 "chart.historical.discharge.yaxis.label"; | |
61 | |
62 public static final String I18N_YAXIS_SECOND_LABEL = | |
63 "chart.historical.discharge.yaxis.second.label"; | |
59 | 64 |
60 public static enum YAXIS { | 65 public static enum YAXIS { |
61 W(0), Q(1); | 66 W(0), Q(1); |
62 | 67 |
63 protected int idx; | 68 protected int idx; |
157 artifactFacet.getData(context), | 162 artifactFacet.getData(context), |
158 artifactFacet.getFacetDescription(), theme, visible); | 163 artifactFacet.getFacetDescription(), theme, visible); |
159 } | 164 } |
160 else if (FacetTypes.IS.MANUALPOINTS(name)) { | 165 else if (FacetTypes.IS.MANUALPOINTS(name)) { |
161 HistoricalDischargeAccess.EvaluationMode mode = | 166 HistoricalDischargeAccess.EvaluationMode mode = |
162 new HistoricalDischargeAccess((D4EArtifact)getMaster()).getEvaluationMode(); | 167 new HistoricalDischargeAccess( |
168 (D4EArtifact)getMaster()).getEvaluationMode(); | |
163 int axis = mode == HistoricalDischargeAccess.EvaluationMode.W | 169 int axis = mode == HistoricalDischargeAccess.EvaluationMode.W |
164 ? YAXIS.Q.idx | 170 ? YAXIS.Q.idx |
165 : YAXIS.W.idx; | 171 : YAXIS.W.idx; |
166 | 172 |
167 doPoints(artifactFacet.getData(context), artifactFacet, theme, | 173 doPoints(artifactFacet.getData(context), artifactFacet, theme, |
226 * TimeSeries will consist of two RegularTimePeriods for each W/Q value | 232 * TimeSeries will consist of two RegularTimePeriods for each W/Q value |
227 * provided by <i>wqt</i>. This has the effect, that the line in the chart | 233 * provided by <i>wqt</i>. This has the effect, that the line in the chart |
228 * looks like a "step chart". | 234 * looks like a "step chart". |
229 */ | 235 */ |
230 protected TimeSeriesCollection newTimeSeriesCollection( | 236 protected TimeSeriesCollection newTimeSeriesCollection( |
231 Timerange[] timeranges, double[] values, ThemeDocument theme, String desc) { | 237 Timerange[] timeranges, |
238 double[] values, | |
239 ThemeDocument theme, | |
240 String desc | |
241 ) { | |
232 log.debug("Create new TimeSeriesCollection for: " + desc); | 242 log.debug("Create new TimeSeriesCollection for: " + desc); |
233 | 243 |
234 TimeSeriesCollection tsc = new TimeSeriesCollection(); | 244 TimeSeriesCollection tsc = new TimeSeriesCollection(); |
235 TimeSeries series = new StyledTimeSeries(desc, theme); | 245 TimeSeries series = new StyledTimeSeries(desc, theme); |
236 | 246 |
261 | 271 |
262 return tsc; | 272 return tsc; |
263 } | 273 } |
264 | 274 |
265 /** | 275 /** |
266 * Creates an array that consists of two <i>FixedMillisecond</i> periods [start, end]. | 276 * Create array that consists of two |
277 * <i>FixedMillisecond</i> periods [start, end]. | |
267 * | 278 * |
268 * @param timerange | 279 * @param timerange |
269 * Supports start and end time. | 280 * Supports start and end time. |
270 * | 281 * |
271 * @return an array with two <i>FixedMillisecond</i> periods [start, end]. | 282 * @return an array with two <i>FixedMillisecond</i> periods [start, end]. |
272 */ | 283 */ |
273 protected RegularTimePeriod[] newRegularTimePeriod(Timerange timerange) { | 284 protected RegularTimePeriod[] newRegularTimePeriod(Timerange timerange) { |
274 Date start = new Date(timerange.getStart()); | 285 Date start = new Date(timerange.getStart()); |
275 Date end = new Date(timerange.getEnd() - 1000 * 60 * 60 * 24); | 286 Date end = new Date(timerange.getEnd() - 1000 * 60 * 60 * 24); |
276 | 287 |
277 return new RegularTimePeriod[] { new FixedMillisecond(start), new FixedMillisecond(end) }; | 288 return new RegularTimePeriod[] { |
289 new FixedMillisecond(start), | |
290 new FixedMillisecond(end) }; | |
278 } | 291 } |
279 } | 292 } |
280 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : | 293 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |