diff 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
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/MeasurementState.java	Tue Mar 16 08:51:50 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/MeasurementState.java	Tue Mar 16 10:29:16 2010 +0000
@@ -218,12 +218,12 @@
         int measurements = matrix.measurementSize();
         int parameters   = matrix.parameterSize();
 
-        for (int i = 0; i < measurements; i++) {
+        for (int i = 0; i < parameters; i++) {
             Element select = creator.create("select");
-            creator.addAttr(select, "label", matrix.getMDescription(i));
+            creator.addAttr(select, "label", inputParam.getDescription(matrix.getParameter(i)));
             creator.addAttr(select, "ref", name);
 
-            for (int j = 0; j < parameters; j++) {
+            for (int j = 0; j < measurements; j++) {
                 Element item  = creator.create("item");
                 Element label = creator.create("label");
                 Element value = creator.create("value");
@@ -232,17 +232,17 @@
                 creator.addAttr(
                     item,
                     "parameter",
-                    inputParam.getDescription(matrix.getParameter(j)));
+                    matrix.getMDescription(j));
 
-                if (!matrix.isValid(i, j)) {
+                if (!matrix.isValid(j, i)) {
                     creator.addAttr(item, "disabled", "true");
                 }
                 else {
                     creator.addAttr(item, "disabled", "false");
                 }
 
-                label.setTextContent(matrix.getMDescription(i));
-                value.setTextContent(matrix.getMeasurement(i));
+                label.setTextContent(matrix.getMDescription(j));
+                value.setTextContent(matrix.getMeasurement(j));
 
                 item.appendChild(label);
                 item.appendChild(value);

http://dive4elements.wald.intevation.org