comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixationSelect.java @ 5838:5aa05a7a34b7

Rename modules to more fitting names.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 15:23:37 +0200
parents flys-artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixationSelect.java@bd047b71ab37
children 4897a58c8746
comparison
equal deleted inserted replaced
5837:d9901a08d0a6 5838:5aa05a7a34b7
1 package org.dive4elements.river.artifacts.states.fixation;
2
3 import org.w3c.dom.Element;
4
5 import org.dive4elements.artifacts.Artifact;
6 import org.dive4elements.artifacts.CallContext;
7 import org.dive4elements.artifacts.CallMeta;
8
9 import org.dive4elements.artifacts.common.utils.XMLUtils;
10
11 import org.dive4elements.river.artifacts.resources.Resources;
12 import org.dive4elements.river.artifacts.states.DefaultState;
13
14
15 /**
16 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
17 */
18 public class FixationSelect extends DefaultState {
19
20 /** Constant value for the default fixation calculation. */
21 public static final String CALCULATION_DEFAULT = "calculation.analysis";
22
23 /** Constant value for the vollmer fixation analysis. */
24 public static final String CALCULATION_VOLLMER = "calculation.vollmer";
25
26 /** An Array that holds all available calculation modes.*/
27 public static final String[] CALCULATIONS = {
28 CALCULATION_DEFAULT,
29 CALCULATION_VOLLMER
30 };
31
32 /** Error message that is thrown if no mode has been chosen. */
33 public static final String ERROR_NO_CALCULATION_MODE =
34 "error_feed_no_calculation_mode";
35
36 /** Error message that is thrown if an invalid calculation mode has been
37 * chosen. */
38 public static final String ERROR_INVALID_CALCULATION_MODE =
39 "error_feed_invalid_calculation_mode";
40
41
42 /**
43 * The default constructor that initializes an empty State object.
44 */
45 public FixationSelect() {
46 }
47
48
49 @Override
50 protected Element[] createItems(
51 XMLUtils.ElementCreator ec,
52 Artifact artifact,
53 String name,
54 CallContext context)
55 {
56 CallMeta meta = context.getMeta();
57 Element[] calculations = new Element[CALCULATIONS.length];
58
59 for (int i = 0; i < CALCULATIONS.length; i++) {
60 String calc = CALCULATIONS[i];
61 calculations[i] = createItem(
62 ec,
63 new String[] {Resources.getMsg(meta, calc, calc), calc});
64 }
65 return calculations;
66 }
67 }
68 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org