comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/MeasurementState.java @ 744:6290ab85782b

Changed the structure for parameter/measurement matrix in the describe document (issue199). gnv-artifacts/trunk@783 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 16 Mar 2010 10:29:16 +0000
parents 078ba6799bd2
children c4156275c1e1
comparison
equal deleted inserted replaced
743:a4b66195d55a 744:6290ab85782b
216 ParameterMatrix matrix = new ParameterMatrix(all, inputParam.splitValue()); 216 ParameterMatrix matrix = new ParameterMatrix(all, inputParam.splitValue());
217 217
218 int measurements = matrix.measurementSize(); 218 int measurements = matrix.measurementSize();
219 int parameters = matrix.parameterSize(); 219 int parameters = matrix.parameterSize();
220 220
221 for (int i = 0; i < measurements; i++) { 221 for (int i = 0; i < parameters; i++) {
222 Element select = creator.create("select"); 222 Element select = creator.create("select");
223 creator.addAttr(select, "label", matrix.getMDescription(i)); 223 creator.addAttr(select, "label", inputParam.getDescription(matrix.getParameter(i)));
224 creator.addAttr(select, "ref", name); 224 creator.addAttr(select, "ref", name);
225 225
226 for (int j = 0; j < parameters; j++) { 226 for (int j = 0; j < measurements; j++) {
227 Element item = creator.create("item"); 227 Element item = creator.create("item");
228 Element label = creator.create("label"); 228 Element label = creator.create("label");
229 Element value = creator.create("value"); 229 Element value = creator.create("value");
230 230
231 creator.addAttr(item, "ref", name); 231 creator.addAttr(item, "ref", name);
232 creator.addAttr( 232 creator.addAttr(
233 item, 233 item,
234 "parameter", 234 "parameter",
235 inputParam.getDescription(matrix.getParameter(j))); 235 matrix.getMDescription(j));
236 236
237 if (!matrix.isValid(i, j)) { 237 if (!matrix.isValid(j, i)) {
238 creator.addAttr(item, "disabled", "true"); 238 creator.addAttr(item, "disabled", "true");
239 } 239 }
240 else { 240 else {
241 creator.addAttr(item, "disabled", "false"); 241 creator.addAttr(item, "disabled", "false");
242 } 242 }
243 243
244 label.setTextContent(matrix.getMDescription(i)); 244 label.setTextContent(matrix.getMDescription(j));
245 value.setTextContent(matrix.getMeasurement(i)); 245 value.setTextContent(matrix.getMeasurement(j));
246 246
247 item.appendChild(label); 247 item.appendChild(label);
248 item.appendChild(value); 248 item.appendChild(value);
249 select.appendChild(item); 249 select.appendChild(item);
250 } 250 }

http://dive4elements.wald.intevation.org