[PATCH] collisions multiple epochs ui input

Wald Commits scm-commit at wald.intevation.org
Fri Sep 21 18:19:40 CEST 2018


# HG changeset patch
# User gernotbelger
# Date 1537546781 -7200
# Node ID 7c3d689294e890693b30d5215642c5ee20226cb5
# Parent  10530f1d7dd53c1b046fe4b38632695d9033a2fc
collisions multiple epochs ui input

diff -r 10530f1d7dd5 -r 7c3d689294e8 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/AbstractEpochPanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/AbstractEpochPanel.java	Thu Sep 20 14:00:30 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/AbstractEpochPanel.java	Fri Sep 21 18:19:41 2018 +0200
@@ -210,7 +210,7 @@
         switch (this.type) {
 
         case single:
-            data.add(buildResult(this.start.getValueAsString(), this.end.getValueAsString()));
+            data.add(resultToData(buildResult(this.start.getValueAsString(), this.end.getValueAsString())));
 
             break;
         case multi:
@@ -218,9 +218,13 @@
             if (lgr.length == 0) {
                 return new Data[0];
             }
+            final StringBuilder resultBuilder = new StringBuilder();
             for (final ListGridRecord element : lgr) {
-                data.add(buildResult(element.getAttribute("from"), element.getAttribute("to")));
+                resultBuilder.append(buildResult(element.getAttribute("from"), element.getAttribute("to")));
+
             }
+            data.add(resultToData(resultBuilder.toString()));
+
             break;
         default:
             throw new IllegalStateException();
@@ -228,14 +232,17 @@
         return data.toArray(new Data[data.size()]);
     }
 
-    private final Data buildResult(final String startStr, final String endStr) {
+    private final String buildResult(final String startStr, final String endStr) {
         final StringBuilder builder = new StringBuilder();
         builder.append(startStr);
         builder.append(",");
         builder.append(endStr);
         builder.append(";");
-        final DataItem item = new DefaultDataItem(getDatakey(), null, builder.toString());
+        return builder.toString();
+    }
+
+    final Data resultToData(final String resultStr) {
+        final DataItem item = new DefaultDataItem(getDatakey(), null, resultStr);
         return new DefaultData(getDatakey(), null, null, new DataItem[] { item });
     }
-
 }


More information about the Dive4Elements-commits mailing list