changeset 9242:2ea7b61797d3

SupraRegionalTable final review
author gernotbelger
date Wed, 11 Jul 2018 10:19:53 +0200
parents cbe393451ab0
children da0bdbcd6f09
files artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixZone.java gwt-client/src/main/java/org/dive4elements/river/client/client/ui/uinfo/SupraRegionalTablePanel.java gwt-client/src/main/java/org/dive4elements/river/client/shared/model/SalixZone.java
diffstat 3 files changed, 9 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixZone.java	Tue Jul 10 18:53:04 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixZone.java	Wed Jul 11 10:19:53 2018 +0200
@@ -134,14 +134,14 @@
         final double otherLower = otherZone.getLowerFromTo();
         final double otherUpper = otherZone.getUpperFromTo();
 
-        final double upper = getUpperFromTo() - DELTA;
-        final double lower = getLowerFromTo() + DELTA;
+        final double upper = getUpperFromTo();
+        final double lower = getLowerFromTo();
         final double otherSchwerpunkt = (otherLower + otherUpper) / 2;
         if ((otherUpper < upper && otherUpper > lower)) {
             return true;
         } else if (otherLower > lower && otherLower < upper) {
             return true;
-        } else if (otherSchwerpunkt > lower && otherSchwerpunkt < upper) {
+        } else if (otherSchwerpunkt > (lower - DELTA) && otherSchwerpunkt < (upper + DELTA)) {
             return true;
         }
         return false;
@@ -164,16 +164,13 @@
         if (differenceAbs > DELTA) {
             return false;
         }
-
         return true;
     }
 
     private static double getAnschluss(final List<SalixZone> list, final double minKm) {
-
         if (list.size() > 0) {
             return list.get(list.size() - 1).getUpperFromTo();
         }
         return minKm;
     }
-
 }
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/uinfo/SupraRegionalTablePanel.java	Tue Jul 10 18:53:04 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/uinfo/SupraRegionalTablePanel.java	Wed Jul 11 10:19:53 2018 +0200
@@ -160,7 +160,7 @@
         final DynamicForm newEntryForm = new DynamicForm();
         newEntryForm.setWidth(320);
         newEntryForm.setNumCols(12);
-        newEntryForm.setFields(dwspl, start, end);
+        newEntryForm.setFields(start, end, dwspl);
 
         add.addClickHandler(new ClickHandler() {
             @Override
@@ -249,7 +249,7 @@
         final Label title = new Label(data.get(0).getDescription());
         title.setHeight("35px");
         this.validationLabel.setHeight("10px");
-
+        this.validationLabel.getElement().getStyle().setColor("red");
         final ListGrid elements = new ListGrid();
         elements.setWidth(320);
         elements.setHeight(300);
@@ -288,7 +288,7 @@
                 }
             }
         });
-        elements.setFields(dmwsplField, fromField, toField, removeField);
+        elements.setFields(fromField, toField, dmwsplField, removeField);
         addDataInit(elements, tableData);
 
         root.addMember(title);
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/SalixZone.java	Tue Jul 10 18:53:04 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/SalixZone.java	Wed Jul 11 10:19:53 2018 +0200
@@ -135,14 +135,14 @@
         final double otherLower = otherZone.getLowerFromTo();
         final double otherUpper = otherZone.getUpperFromTo();
 
-        final double upper = getUpperFromTo() - DELTA;
-        final double lower = getLowerFromTo() + DELTA;
+        final double upper = getUpperFromTo();
+        final double lower = getLowerFromTo();
         final double otherSchwerpunkt = (otherLower + otherUpper) / 2;
         if ((otherUpper < upper && otherUpper > lower)) {
             return true;
         } else if (otherLower > lower && otherLower < upper) {
             return true;
-        } else if (otherSchwerpunkt > lower && otherSchwerpunkt < upper) {
+        } else if (otherSchwerpunkt > (lower - DELTA) && otherSchwerpunkt < (upper + DELTA)) {
             return true;
         }
         return false;
@@ -165,16 +165,13 @@
         if (differenceAbs > DELTA) {
             return false;
         }
-
         return true;
     }
 
     private static double getAnschluss(final List<SalixZone> list, final double minKm) {
-
         if (list.size() > 0) {
             return list.get(list.size() - 1).getUpperFromTo();
         }
         return minKm;
     }
-
 }

http://dive4elements.wald.intevation.org