Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/LoadYearSelect.java @ 9067:2ed3824a3d53
sinfo access collision, floodDuration
author | gernotbelger |
---|---|
date | Mon, 14 May 2018 14:59:10 +0200 |
parents | b5d7a9d79837 |
children |
comparison
equal
deleted
inserted
replaced
9066:b5d7a9d79837 | 9067:2ed3824a3d53 |
---|---|
8 | 8 |
9 package org.dive4elements.river.artifacts.sinfo.collision; | 9 package org.dive4elements.river.artifacts.sinfo.collision; |
10 | 10 |
11 import org.apache.log4j.Logger; | 11 import org.apache.log4j.Logger; |
12 import org.dive4elements.artifacts.Artifact; | 12 import org.dive4elements.artifacts.Artifact; |
13 import org.dive4elements.river.artifacts.D4EArtifact; | 13 import org.dive4elements.river.artifacts.sinfo.SINFOArtifact; |
14 import org.dive4elements.river.artifacts.states.DefaultState; | 14 import org.dive4elements.river.artifacts.states.DefaultState; |
15 | 15 |
16 /** State in which to fetch years for sedminent load calculation. */ | 16 /** State in which to fetch years for sedminent load calculation. */ |
17 public class LoadYearSelect extends DefaultState { | 17 public class LoadYearSelect extends DefaultState { |
18 private static final long serialVersionUID = 1L; | 18 private static final long serialVersionUID = 1L; |
26 } | 26 } |
27 | 27 |
28 /** Year Select Widget. */ | 28 /** Year Select Widget. */ |
29 @Override | 29 @Override |
30 protected String getUIProvider() { | 30 protected String getUIProvider() { |
31 return "uinfo.inundationduration.load_year_select"; | 31 return "minfo.sedimentload_year_select"; // TODO: eigenes Panel oder allgemeineren Code |
32 } | 32 } |
33 | 33 |
34 @Override | 34 @Override |
35 public boolean validate(final Artifact artifact) throws IllegalArgumentException { | 35 public boolean validate(final Artifact artifact) throws IllegalArgumentException { |
36 final CollisionLoadYearEpochAccess access = new CollisionLoadYearEpochAccess((D4EArtifact) artifact); | 36 // TODO: check verstehen |
37 | |
38 final CollisionAccess access = new CollisionAccess((SINFOArtifact) artifact); | |
37 | 39 |
38 // Second year should be later than first. | 40 // Second year should be later than first. |
41 | |
39 if (access.getYears() == null || access.getYears().length == 0) | 42 if (access.getYears() == null || access.getYears().length == 0) |
40 return true; // TODO: richtig in CollisionLoadYear... implementieren | 43 return true; |
41 // throw new IllegalArgumentException("error_years_wrong"); | 44 // throw new IllegalArgumentException("error_years_wrong"); |
42 | 45 |
43 return true; | 46 return true; |
44 } | 47 } |
45 } | 48 } |