Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/LoadYearSelect.java @ 9058:d3bef221b7d9
sinfo.collision states
author | gernotbelger |
---|---|
date | Fri, 04 May 2018 16:13:10 +0200 |
parents | |
children | b6919e3c2d86 |
comparison
equal
deleted
inserted
replaced
9057:2be202a8cb89 | 9058:d3bef221b7d9 |
---|---|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU AGPL (>=v3) | |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
6 * documentation coming with Dive4Elements River for details. | |
7 */ | |
8 | |
9 package org.dive4elements.river.artifacts.sinfo.collision; | |
10 | |
11 import org.apache.log4j.Logger; | |
12 import org.dive4elements.artifacts.Artifact; | |
13 import org.dive4elements.river.artifacts.D4EArtifact; | |
14 import org.dive4elements.river.artifacts.states.DefaultState; | |
15 | |
16 /** State in which to fetch years for sedminent load calculation. */ | |
17 public class LoadYearSelect extends DefaultState { | |
18 private static final long serialVersionUID = 1L; | |
19 /** The log used in this class. */ | |
20 private static Logger log = Logger.getLogger(LoadYearSelect.class); | |
21 | |
22 /** | |
23 * The default constructor that initializes an empty State object. | |
24 */ | |
25 public LoadYearSelect() { | |
26 } | |
27 | |
28 /** Year Select Widget. */ | |
29 @Override | |
30 protected String getUIProvider() { | |
31 return "minfo.sedimentload_year_select"; | |
32 } | |
33 | |
34 @Override | |
35 public boolean validate(final Artifact artifact) throws IllegalArgumentException { | |
36 final CollisionLoadYearEpochAccess access = new CollisionLoadYearEpochAccess((D4EArtifact) artifact); | |
37 | |
38 // Second year should be later than first. | |
39 if (access.getYears() == null || access.getYears().length == 0) | |
40 return true; // TODO: richtig in CollisionLoadYear... implementieren | |
41 // throw new IllegalArgumentException("error_years_wrong"); | |
42 | |
43 return true; | |
44 } | |
45 } | |
46 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |