changeset 9493:7c3d689294e8

collisions multiple epochs ui input
author gernotbelger
date Fri, 21 Sep 2018 18:19:41 +0200
parents 10530f1d7dd5
children 879c902c4a2d
files gwt-client/src/main/java/org/dive4elements/river/client/client/ui/AbstractEpochPanel.java
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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 });
     }
-
 }

http://dive4elements.wald.intevation.org