comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java @ 401:34de11dcf355

Small bugfix in the adapted WQ state and further i18n strings. flys-artifacts/trunk@1836 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 05 May 2011 12:34:53 +0000
parents 53cc794fee07
children e54053bc0e70
comparison
equal deleted inserted replaced
400:7e5c2e93e449 401:34de11dcf355
26 26
27 /** The logger used in this state.*/ 27 /** The logger used in this state.*/
28 private static Logger logger = Logger.getLogger(WQAdapted.class); 28 private static Logger logger = Logger.getLogger(WQAdapted.class);
29 29
30 30
31 public static final String FIELD_WQ_MODE = "wq_mode";
32
33 public static final String FIELD_WQ_VALUES = "wq_values";
34
35
31 /** 36 /**
32 * This method creates one element for each gauge of the selected river that 37 * This method creates one element for each gauge of the selected river that
33 * is intersected by the given kilometer range. Each element is a tuple of 38 * is intersected by the given kilometer range. Each element is a tuple of
34 * (from;to) where <i>from</i> is the lower bounds of the gauge or the lower 39 * (from;to) where <i>from</i> is the lower bounds of the gauge or the lower
35 * kilometer range. <i>to</i> is the upper bounds of the gauge or the upper 40 * kilometer range. <i>to</i> is the upper bounds of the gauge or the upper
48 Artifact artifact, 53 Artifact artifact,
49 String name, 54 String name,
50 CallContext context) 55 CallContext context)
51 { 56 {
52 logger.debug("WQAdapted.createItems"); 57 logger.debug("WQAdapted.createItems");
58
59 if (name != null && name.equals(FIELD_WQ_MODE)) {
60 return createModeItems(cr, artifact, name, context);
61 }
62 else if (name != null && name.equals(FIELD_WQ_VALUES)) {
63 return createValueItems(cr, artifact, name, context);
64 }
65 else {
66 logger.warn("Unknown data object: " + name);
67 return null;
68 }
69 }
70
71
72 protected Element[] createModeItems(
73 XMLUtils.ElementCreator cr,
74 Artifact artifact,
75 String name,
76 CallContext context)
77 {
78 logger.debug("WQAdapted.createModeItems");
79
80 Element w = createItem(cr, new String[] { "w", "W" });
81 Element q = createItem(cr, new String[] { "q", "Q" });
82
83 return new Element[] { w, q };
84 }
85
86
87 protected Element[] createValueItems(
88 XMLUtils.ElementCreator cr,
89 Artifact artifact,
90 String name,
91 CallContext context)
92 {
93 logger.debug("WQAdapted.createValueItems");
53 94
54 FLYSArtifact flysArtifact = (FLYSArtifact) artifact; 95 FLYSArtifact flysArtifact = (FLYSArtifact) artifact;
55 96
56 double[] dist = flysArtifact.getDistance(); 97 double[] dist = flysArtifact.getDistance();
57 List<Gauge> gauges = flysArtifact.getGauges(); 98 List<Gauge> gauges = flysArtifact.getGauges();

http://dive4elements.wald.intevation.org