Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/LoadSingleYearSelectState.java @ 9321:a978b601a034
Salix: Fixed ArrrayoutOfBoundsException; minor cleanup
author | gernotbelger |
---|---|
date | Fri, 27 Jul 2018 10:25:09 +0200 |
parents | f5cff8708531 |
children |
rev | line source |
---|---|
9225 | 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.uinfo.salix; | |
10 | |
9245 | 11 import java.util.List; |
9225 | 12 |
13 import org.dive4elements.artifacts.Artifact; | |
14 import org.dive4elements.artifacts.CallContext; | |
15 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator; | |
16 import org.dive4elements.river.artifacts.states.DefaultState; | |
9245 | 17 import org.dive4elements.river.artifacts.uinfo.UINFOArtifact; |
18 import org.dive4elements.river.model.BedHeight; | |
9225 | 19 import org.w3c.dom.Element; |
20 | |
21 /** State in which to fetch years for sedminent load calculation. */ | |
22 public class LoadSingleYearSelectState extends DefaultState { | |
9321
a978b601a034
Salix: Fixed ArrrayoutOfBoundsException; minor cleanup
gernotbelger
parents:
9245
diff
changeset
|
23 |
9225 | 24 private static final long serialVersionUID = 1L; |
25 | |
26 /** | |
27 * The default constructor that initializes an empty State object. | |
28 */ | |
29 public LoadSingleYearSelectState() { | |
30 } | |
31 | |
32 /** Year Select Widget. */ | |
33 @Override | |
34 protected String getUIProvider() { | |
35 return "common.state.load_single_year_select"; | |
36 } | |
37 | |
38 @Override | |
39 protected void appendItems(final Artifact artifact, final ElementCreator creator, final String name, final CallContext context, final Element select) { | |
40 | |
9245 | 41 final String dataKeyofState = "singleyear";// siehe .xml |
42 try { | |
43 if (dataKeyofState.equals(name)) { | |
44 final SalixLineAccess access = new SalixLineAccess((UINFOArtifact) artifact); | |
45 final List<BedHeight> bhs = BedHeight.getBedHeightYear(access.getRiver(), access.getLowerKm(), access.getUpperKm()); | |
9321
a978b601a034
Salix: Fixed ArrrayoutOfBoundsException; minor cleanup
gernotbelger
parents:
9245
diff
changeset
|
46 LoadSingleEpochSelectState.makeDataSourceYearEpoch(creator, select, context, bhs); |
9225 | 47 } |
48 } | |
9245 | 49 catch ( |
50 | |
9321
a978b601a034
Salix: Fixed ArrrayoutOfBoundsException; minor cleanup
gernotbelger
parents:
9245
diff
changeset
|
51 final IllegalArgumentException iae) { |
9225 | 52 iae.printStackTrace(); |
53 } | |
54 } | |
9321
a978b601a034
Salix: Fixed ArrrayoutOfBoundsException; minor cleanup
gernotbelger
parents:
9245
diff
changeset
|
55 } |