view flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/minfo/YearEpochSelect.java @ 4241:49cb65d5932d

Improved the historical discharge calculation. The calculation now creates new HistoricalWQKms (new subclass of WQKms). Those WQKms are used to create new facets from (new) type 'HistoricalDischargeCurveFacet'. The chart generator is improved to support those facets.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 24 Oct 2012 14:34:35 +0200
parents a30647abf009
children
line wrap: on
line source
package de.intevation.flys.artifacts.states.minfo;

import org.w3c.dom.Element;

import de.intevation.artifacts.Artifact;
import de.intevation.artifacts.CallContext;
import de.intevation.artifacts.CallMeta;
import de.intevation.artifacts.common.utils.XMLUtils;
import de.intevation.flys.artifacts.FLYSArtifact;
import de.intevation.flys.artifacts.resources.Resources;
import de.intevation.flys.artifacts.states.DefaultState;

/**
 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
 */
public class YearEpochSelect extends DefaultState {

    /**
     * The default constructor that initializes an empty State object.
     */
    public YearEpochSelect() {
    }

    @Override
    protected String getUIProvider() {
        return "minfo.bed.year_epoch";
    }

    @Override
    protected Element[] createItems(
        XMLUtils.ElementCreator ec,
        Artifact                artifact,
        String                  name,
        CallContext             context)
    {
        CallMeta meta = context.getMeta();
        Element[] elements;
        if (((FLYSArtifact)artifact).getCurrentStateId()
            .equals("state.minfo.sediment.load.year_epoch")
        ) {
            elements = new Element[3];
            elements[2] = createItem(
                ec,
                new String[] {
                    Resources.getMsg(meta,
                        "state.minfo.off_epoch",
                        "state.minfo.off_epoch"),
                    "off_epoch"});
        }
        else {
            elements = new Element[2];
        }
        elements[0] = createItem(
                ec,
                new String[] {
                    Resources.getMsg(meta,
                        "state.minfo.year",
                        "state.minfo.year"),
                    "year"});

        elements[1] = createItem(
            ec,
            new String[] {
                Resources.getMsg(meta,
                    "state.minfo.epoch",
                    "state.minfo.epoch"),
                "epoch"});

       return elements;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org