teichmann@5831: package org.dive4elements.river.artifacts.states.fixation; raimund@2651: 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.CallMeta; raimund@2651: teichmann@5831: import org.dive4elements.artifacts.common.utils.XMLUtils; raimund@2651: teichmann@5831: import org.dive4elements.river.artifacts.resources.Resources; teichmann@5831: import org.dive4elements.river.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: /** Constant value for the default fixation calculation. */ raimund@2668: public static final String CALCULATION_DEFAULT = "calculation.analysis"; raimund@2651: felix@3454: /** Constant value for the vollmer fixation analysis. */ felix@3454: public static final String CALCULATION_VOLLMER = "calculation.vollmer"; raimund@2651: raimund@2651: /** An Array that holds all available calculation modes.*/ raimund@2651: public static final String[] CALCULATIONS = { raimund@2651: CALCULATION_DEFAULT, felix@3454: CALCULATION_VOLLMER 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 :