# HG changeset patch # User gernotbelger # Date 1525443190 -7200 # Node ID d3bef221b7d924e38be9adaf48933cda49a77b2f # Parent 2be202a8cb893034ba1b0d7ab41db423aad8314d# Parent ddebd4c2fe933495eb2f1b1b0a6e949e930b9c8b sinfo.collision states diff -r ddebd4c2fe93 -r d3bef221b7d9 artifacts/doc/conf/artifacts/sinfo.xml --- a/artifacts/doc/conf/artifacts/sinfo.xml Fri May 04 14:05:21 2018 +0200 +++ b/artifacts/doc/conf/artifacts/sinfo.xml Fri May 04 16:13:10 2018 +0200 @@ -3,84 +3,85 @@ - + - - + + - + - - - + + + - - + + - - - + + + - + - - - + + + - + - - - + + + - - - + + + - - + + - + - + - - + + - + @@ -88,50 +89,50 @@ - - - + + + - - - + + + - + - - - + + + - - - - + + + + - + - - + + - + @@ -139,75 +140,75 @@ - - - + + + - - - + + + - + - - - + + + - + - - - + + + - - - - - + + - - - - + + - + + + + + + - - + + - + - - + + - + @@ -217,224 +218,256 @@ - + - - - - - - - - - + + + - - - + + + + + + + + + - - - + + - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - + + - + - + - - + + - + - - - - - - - + + + + + + + - - - - - + + + + + - + - - - - - + - - - - - - - - - - - - + + + + + + + + + - + + - - - + + + - + - - - + + + - - - + + + + + + + + + - - - + + + - - + + - + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - + - - - + + + - + - + - - - + - - - - - - + + + + + + + + - + - - + + - + - + diff -r ddebd4c2fe93 -r d3bef221b7d9 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/CollisionLoadYearEpochAccess.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/CollisionLoadYearEpochAccess.java Fri May 04 16:13:10 2018 +0200 @@ -0,0 +1,34 @@ +/** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde + * Software engineering by + * Björnsen Beratende Ingenieure GmbH + * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ +package org.dive4elements.river.artifacts.sinfo.collision; + +import org.dive4elements.river.artifacts.D4EArtifact; +import org.dive4elements.river.artifacts.access.RangeAccess; + +/** + * @author Domenico Nardi Tironi + * + */ +public class CollisionLoadYearEpochAccess extends RangeAccess { + + private int[][] epochs; + + private int[] years; + + public CollisionLoadYearEpochAccess(final D4EArtifact artifact) { + // TODO Auto-generated constructor stub + } + + public int[] getYears() { + // TODO Auto-generated method stub + return null; + } + +} diff -r ddebd4c2fe93 -r d3bef221b7d9 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/LoadYearSelect.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/LoadYearSelect.java Fri May 04 16:13:10 2018 +0200 @@ -0,0 +1,46 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + +package org.dive4elements.river.artifacts.sinfo.collision; + +import org.apache.log4j.Logger; +import org.dive4elements.artifacts.Artifact; +import org.dive4elements.river.artifacts.D4EArtifact; +import org.dive4elements.river.artifacts.states.DefaultState; + +/** State in which to fetch years for sedminent load calculation. */ +public class LoadYearSelect extends DefaultState { + private static final long serialVersionUID = 1L; + /** The log used in this class. */ + private static Logger log = Logger.getLogger(LoadYearSelect.class); + + /** + * The default constructor that initializes an empty State object. + */ + public LoadYearSelect() { + } + + /** Year Select Widget. */ + @Override + protected String getUIProvider() { + return "minfo.sedimentload_year_select"; + } + + @Override + public boolean validate(final Artifact artifact) throws IllegalArgumentException { + final CollisionLoadYearEpochAccess access = new CollisionLoadYearEpochAccess((D4EArtifact) artifact); + + // Second year should be later than first. + if (access.getYears() == null || access.getYears().length == 0) + return true; // TODO: richtig in CollisionLoadYear... implementieren + // throw new IllegalArgumentException("error_years_wrong"); + + return true; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r ddebd4c2fe93 -r d3bef221b7d9 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/YearChoice.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/YearChoice.java Fri May 04 14:05:21 2018 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/YearChoice.java Fri May 04 16:13:10 2018 +0200 @@ -8,16 +8,27 @@ package org.dive4elements.river.artifacts.sinfo.collision; -import org.dive4elements.river.artifacts.states.BooleanChoiceState; +import java.util.ArrayList; +import java.util.List; + +import org.dive4elements.river.artifacts.states.RadioSelect; /** * @author Ingo Weinzierl */ -public class YearChoice extends BooleanChoiceState { - +public class YearChoice extends RadioSelect { private static final long serialVersionUID = 1L; public YearChoice() { - super("option", "active", "inactive"); // TODO: RADIO-Btn-Impl + super(); + } + + @Override + protected List makeEntries() { + final List entries = new ArrayList<>(); + entries.add("state.sinfo.year"); + entries.add("state.sinfo.epoch"); + return entries; + } } \ No newline at end of file diff -r ddebd4c2fe93 -r d3bef221b7d9 artifacts/src/main/resources/messages.properties --- a/artifacts/src/main/resources/messages.properties Fri May 04 14:05:21 2018 +0200 +++ b/artifacts/src/main/resources/messages.properties Fri May 04 16:13:10 2018 +0200 @@ -75,6 +75,13 @@ state.minfo.t_per_a = t/a state.minfo.m3_per_a = m\u00b3/a +state.sinfo.year_epoch = Year/Epoch +state.sinfo.year=Year +state.sinfo.epoch=Epoch +state.sinfo.riverside.left = Linkes Ufer +state.sinfo.riverside.right = Rechtes Ufer +state.sinfo.riverside.both = Beide Ufer + year=Year epoch=Epoch off_epoch = off. Epochs