# HG changeset patch # User Ingo Weinzierl # Date 1337091699 0 # Node ID 885b0213052820bcf069da82c91c6655b06c150d # Parent 6455bb59a26e023da54a8a352ceb0f83052d29f9 Implemented ParameterMatrixPanel.getData(). flys-client/trunk@4410 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 6455bb59a26e -r 885b02130528 flys-client/ChangeLog --- 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 + + * 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 * src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.java: diff -r 6455bb59a26e -r 885b02130528 flys-client/pom.xml --- 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 @@ target/www true + 8881 + 9991 + INFO' -bindAddress 0.0.0.0 -codeServerPort 9991 -logLevel 'INFO diff -r 6455bb59a26e -r 885b02130528 flys-client/src/main/java/de/intevation/flys/client/client/config.xml --- 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 @@ - http://localhost:8181 + http://localhost:1610 diff -r 6455bb59a26e -r 885b02130528 flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterMatrixPanel.java --- 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> selection = matrix.getSelection(); + Set>> entries = selection.entrySet(); + + Data[] list = new Data[selection.size()]; + + int i = 0; + + for (Map.Entry> 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 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; } diff -r 6455bb59a26e -r 885b02130528 flys-client/src/main/webapp/WEB-INF/web.xml --- 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 @@ server-url - http://localhost:8181 + http://localhost:1610