view artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/inundationduration/YearChoice.java @ 9178:2f5052835b76

uinfo inundationduration langjähr. Mittel, Uedauern.properties, Meldung
author gernotbelger
date Tue, 26 Jun 2018 19:48:35 +0200
parents 766890addcb2
children dace17e26d33
line wrap: on
line source
/* 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.uinfo.inundationduration;

import java.util.LinkedHashMap;

import org.dive4elements.artifacts.Artifact;
import org.dive4elements.artifacts.CallMeta;
import org.dive4elements.river.artifacts.states.RadioSelect;
import org.dive4elements.river.artifacts.uinfo.UINFOArtifact;

/**
 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
 */
public class YearChoice extends RadioSelect {
    private static final long serialVersionUID = 1L;
    private InundationDurationAccess access = null;

    @Override
    protected LinkedHashMap<String, String> makeEntries(final CallMeta meta, final Artifact artifact) {
        // in helper-klasse; dann hier label lazy loaden
        final LinkedHashMap<String, String> entries = new LinkedHashMap<>();
        if (artifact != null && artifact instanceof UINFOArtifact) {
            this.access = new InundationDurationAccess((UINFOArtifact) artifact);
        }
        if (this.access != null) {
            final UedauernPropertiesHelper helper = UedauernPropertiesHelper.getInstance(this.access.getRiverName());
            final LinkedHashMap<String, String> extras = helper.getExtraLayers(meta);
            entries.put("state.uinfo.year", null);
            entries.putAll(extras);
        }
        return entries;
    }

}

http://dive4elements.wald.intevation.org