raimund@2651: package de.intevation.flys.artifacts.states.fixation; raimund@2651: raimund@2651: import org.apache.log4j.Logger; raimund@2651: raimund@2651: import org.w3c.dom.Element; raimund@2651: import org.w3c.dom.Node; raimund@2651: raimund@2651: import de.intevation.artifacts.Artifact; raimund@2651: import de.intevation.artifacts.CallContext; raimund@2651: import de.intevation.artifacts.CallMeta; raimund@2651: raimund@2651: import de.intevation.artifacts.common.utils.XMLUtils; raimund@2651: raimund@2651: import de.intevation.artifactdatabase.ProtocolUtils; raimund@2651: import de.intevation.artifactdatabase.data.StateData; raimund@2651: raimund@2651: import de.intevation.flys.artifacts.FLYSArtifact; raimund@2651: import de.intevation.flys.artifacts.resources.Resources; raimund@2651: import de.intevation.flys.artifacts.states.DefaultState; raimund@2651: raimund@2651: raimund@2651: /** raimund@2651: * @author Raimund Renkert raimund@2651: */ raimund@2651: public class FixationSelect extends DefaultState { raimund@2651: raimund@2651: /** The logger used in this class. */ raimund@2651: private static Logger logger = Logger.getLogger(FixationSelect.class); raimund@2651: raimund@2651: raimund@2651: /** Constant value for the default fixation calculation. */ raimund@2668: public static final String CALCULATION_DEFAULT = "calculation.analysis"; raimund@2651: raimund@2651: /** Constant value for the volmer fixation analysis. */ raimund@2668: public static final String CALCULATION_VOLMER = "calculation.volmer"; raimund@2651: raimund@2651: /** An Array that holds all available calculation modes.*/ raimund@2651: public static final String[] CALCULATIONS = { raimund@2651: CALCULATION_DEFAULT, raimund@2651: CALCULATION_VOLMER raimund@2651: }; raimund@2651: raimund@2651: /** Error message that is thrown if no mode has been chosen. */ raimund@2651: public static final String ERROR_NO_CALCULATION_MODE = raimund@2651: "error_feed_no_calculation_mode"; raimund@2651: raimund@2651: /** Error message that is thrown if an invalid calculation mode has been raimund@2651: * chosen. */ raimund@2651: public static final String ERROR_INVALID_CALCULATION_MODE = raimund@2651: "error_feed_invalid_calculation_mode"; raimund@2651: raimund@2651: raimund@2651: /** raimund@2651: * The default constructor that initializes an empty State object. raimund@2651: */ raimund@2651: public FixationSelect() { raimund@2651: } raimund@2651: raimund@2651: raimund@2651: @Override raimund@2651: protected Element[] createItems( raimund@2651: XMLUtils.ElementCreator ec, raimund@2651: Artifact artifact, raimund@2651: String name, raimund@2651: CallContext context) raimund@2651: { raimund@2651: CallMeta meta = context.getMeta(); raimund@2651: Element[] calculations = new Element[CALCULATIONS.length]; raimund@2651: raimund@2651: for (int i = 0; i < CALCULATIONS.length; i++) { raimund@2651: String calc = CALCULATIONS[i]; raimund@2651: calculations[i] = createItem( raimund@2651: ec, raimund@2651: new String[] {Resources.getMsg(meta, calc, calc), calc}); raimund@2651: } raimund@2651: return calculations; raimund@2651: } raimund@2651: } raimund@2651: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :