teichmann@5863: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
teichmann@5863: * Software engineering by Intevation GmbH
teichmann@5863: *
teichmann@5863: * This file is Free Software under the GNU AGPL (>=v3)
teichmann@5863: * and comes with ABSOLUTELY NO WARRANTY! Check out the
teichmann@5863: * documentation coming with Dive4Elements River for details.
teichmann@5863: */
teichmann@5863:
teichmann@5831: package org.dive4elements.river.artifacts.states.fixation;
raimund@2651:
raimund@2698: import java.util.Collection;
raimund@2698:
raimund@2651: import org.w3c.dom.Element;
raimund@2651:
teichmann@5831: import org.dive4elements.artifacts.Artifact;
teichmann@5831: import org.dive4elements.artifacts.CallContext;
teichmann@5831: import org.dive4elements.artifacts.common.utils.XMLUtils;
teichmann@5831: import org.dive4elements.river.artifacts.math.fitting.Function;
teichmann@5831: import org.dive4elements.river.artifacts.math.fitting.FunctionFactory;
teichmann@5831: import org.dive4elements.river.artifacts.states.DefaultState;
raimund@2651:
raimund@2651: /**
raimund@2651: * @author Raimund Renkert
raimund@2651: */
raimund@2651: public class FunctionSelect extends DefaultState {
raimund@2651:
raimund@2651: /**
raimund@2651: * The default constructor that initializes an empty State object.
raimund@2651: */
raimund@2651: public FunctionSelect() {
raimund@2651: }
raimund@2651:
ingo@3785: @Override
raimund@3594: public String getUIProvider() {
raimund@3594: return "fix.functionselect";
raimund@3594: }
raimund@2698:
raimund@2698: @Override
raimund@2698: protected Element[] createItems(
raimund@2698: XMLUtils.ElementCreator ec,
raimund@2698: Artifact artifact,
raimund@2698: String name,
raimund@2698: CallContext context)
raimund@2698: {
raimund@2698: FunctionFactory ff = FunctionFactory.getInstance();
ingo@3785: Collection fc = ff.getFunctions();
raimund@2698: Element[] functions = new Element[fc.size()];
raimund@2698:
raimund@2698: int j = 0;
teichmann@4049: for (Function f: fc) {
raimund@2698: String n = f.getName();
raimund@2698: String d = f.getDescription();
raimund@2698: functions[j] = createItem(ec, new String[] {d, n});
raimund@2698: j++;
raimund@2698: }
raimund@2698:
raimund@2698: return functions;
raimund@2698: }
raimund@2651: }
raimund@2651: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :