changeset 2523:885b02130528

Implemented ParameterMatrixPanel.getData(). flys-client/trunk@4410 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 15 May 2012 14:21:39 +0000
parents 6455bb59a26e
children 39cf246b28c4
files flys-client/ChangeLog flys-client/pom.xml flys-client/src/main/java/de/intevation/flys/client/client/config.xml flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterMatrixPanel.java flys-client/src/main/webapp/WEB-INF/web.xml
diffstat 5 files changed, 61 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon May 14 15:25:14 2012 +0000
+++ b/flys-client/ChangeLog	Tue May 15 14:21:39 2012 +0000
@@ -1,3 +1,9 @@
+2012-05-15  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/ParameterMatrixPanel.java:
+	  Implemented getData() which now returns the selected values from
+	  ParameterMatrix as colon separated string.
+
 2012-05-14	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.java:
--- a/flys-client/pom.xml	Mon May 14 15:25:14 2012 +0000
+++ b/flys-client/pom.xml	Tue May 15 14:21:39 2012 +0000
@@ -129,6 +129,9 @@
           <hostedWebapp>target/www</hostedWebapp>
           <!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->
           <soyc>true</soyc>
+          <port>8881</port>
+          <codeServerPort>9991</codeServerPort>
+          <logLevel>INFO' -bindAddress 0.0.0.0 -codeServerPort 9991 -logLevel 'INFO</logLevel>
         </configuration>
       </plugin>
 
--- a/flys-client/src/main/java/de/intevation/flys/client/client/config.xml	Mon May 14 15:25:14 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/config.xml	Tue May 15 14:21:39 2012 +0000
@@ -1,5 +1,5 @@
 <config>
-    <server>http://localhost:8181</server>
+    <server>http://localhost:1610</server>
 
     <projectlist>
         <!-- The interval to update the user's projects (in ms) -->
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterMatrixPanel.java	Mon May 14 15:25:14 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterMatrixPanel.java	Tue May 15 14:21:39 2012 +0000
@@ -1,5 +1,9 @@
 package de.intevation.flys.client.client.ui;
 
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 import com.google.gwt.core.client.GWT;
 
 import com.smartgwt.client.types.FieldType;
@@ -10,6 +14,8 @@
 import de.intevation.flys.client.shared.model.Data;
 import de.intevation.flys.client.shared.model.DataItem;
 import de.intevation.flys.client.shared.model.DataList;
+import de.intevation.flys.client.shared.model.DefaultData;
+import de.intevation.flys.client.shared.model.DefaultDataItem;
 import de.intevation.flys.client.shared.model.IntegerOptionsData;
 
 /**
@@ -17,12 +23,52 @@
  */
 public class ParameterMatrixPanel extends AbstractUIProvider {
 
+    private ParameterMatrix matrix;
+
     @Override
     protected Data[] getData() {
-        GWT.log("TODO: IMPLEMENT RadioPanel.getData()");
-        return new Data[0];
+        Map<String, List<String>> selection = matrix.getSelection();
+        Set<Map.Entry<String, List<String>>> entries = selection.entrySet();
+
+        Data[] list = new Data[selection.size()];
+
+        int i = 0;
+
+        for (Map.Entry<String, List<String>> entry: entries) {
+            String value = buildValueString(entry.getValue());
+
+            DataItem item = new DefaultDataItem(
+                entry.getKey(),
+                null,
+                value);
+
+            list[i++] = new DefaultData(
+                entry.getKey(), null, null, new DataItem[] { item });
+        }
+
+        return list;
     }
 
+
+    protected String buildValueString(List<String> values) {
+        StringBuilder sb = new StringBuilder();
+
+        boolean first = true;
+
+        for (String value: values) {
+            if (!first) {
+                sb.append(";");
+            }
+
+            sb.append(value);
+
+            first = false;
+        }
+
+        return sb.toString();
+    }
+
+
     @Override
     public Canvas createOld(DataList dataList) {
         GWT.log("TODO: IMPLEMENT RadioPanel.createOld()");
@@ -34,7 +80,7 @@
         VLayout v = new VLayout();
         v.addMember(createTitle(dataList));
 
-        ParameterMatrix matrix = new ParameterMatrix();
+        matrix = new ParameterMatrix();
 
         for (Data data: dataList.getAll()) {
             if (data instanceof IntegerOptionsData) {
@@ -43,6 +89,7 @@
         }
 
         v.addMember(matrix.create());
+        v.addMember(getNextButton());
 
         return v;
     }
--- a/flys-client/src/main/webapp/WEB-INF/web.xml	Mon May 14 15:25:14 2012 +0000
+++ b/flys-client/src/main/webapp/WEB-INF/web.xml	Tue May 15 14:21:39 2012 +0000
@@ -7,7 +7,7 @@
 
     <context-param>
         <param-name>server-url</param-name>
-        <param-value>http://localhost:8181</param-value>
+        <param-value>http://localhost:1610</param-value>
     </context-param>
   
   <!-- Servlets -->

http://dive4elements.wald.intevation.org