changeset 8776:1116079e6624

Tidied.
author Tom Gottfried <tom@intevation.de>
date Wed, 02 Dec 2015 19:35:11 +0100
parents 76c84294c1d3
children 9d2a0827ec03
files artifacts/src/main/java/org/dive4elements/river/artifacts/states/ComputationRangeState.java artifacts/src/main/java/org/dive4elements/river/artifacts/states/RangeState.java artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/LocationSelect.java artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityDistanceSelect.java
diffstat 4 files changed, 19 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/ComputationRangeState.java	Tue Nov 24 18:52:24 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/ComputationRangeState.java	Wed Dec 02 19:35:11 2015 +0100
@@ -60,12 +60,6 @@
         Element label = ProtocolUtils.createArtNode(
             cr, "label", null, null);
 
-        // XXX: DEAD CODE
-        /*
-        Element choices = ProtocolUtils.createArtNode(
-            cr, "choices", null, null);
-        */
-
         label.setTextContent(Resources.getMsg(
             context.getMeta(),
             data.getName(),
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/RangeState.java	Tue Nov 24 18:52:24 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/RangeState.java	Wed Dec 02 19:35:11 2015 +0100
@@ -41,11 +41,13 @@
         if (from < fromValid) {
             log.error(
                 "Invalid 'from'. " + from + " is smaller than " + fromValid);
+            // error message used in client to resolve i18n
             throw new IllegalArgumentException("error_feed_from_out_of_range");
         }
         else if (to > toValid) {
             log.error(
                 "Invalid 'to'. " + to + " is bigger than " + toValid);
+            // error message used in client to resolve i18n
             throw new IllegalArgumentException("error_feed_to_out_of_range");
         }
 
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/LocationSelect.java	Tue Nov 24 18:52:24 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/LocationSelect.java	Wed Dec 02 19:35:11 2015 +0100
@@ -41,9 +41,12 @@
     protected double[] getMinMax(Artifact artifact) {
         D4EArtifact flysArtifact = (D4EArtifact) artifact;
         String riverName = flysArtifact.getDataAsString("river");
-        FixingsOverview overview = FixingsOverviewFactory.getOverview(riverName);
+        FixingsOverview overview = FixingsOverviewFactory
+            .getOverview(riverName);
 
-        return new double[]{overview.getExtent().getStart(), overview.getExtent().getEnd()};
+        return new double[]{
+            overview.getExtent().getStart(),
+            overview.getExtent().getEnd()};
     }
 
 
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityDistanceSelect.java	Tue Nov 24 18:52:24 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityDistanceSelect.java	Wed Dec 02 19:35:11 2015 +0100
@@ -48,7 +48,8 @@
         CallContext context)
     {
         Element ele = super.createData(cr, artifact, data, context);
-        if (!data.getName().equals("ld_from") && !data.getName().equals("ld_to")) {
+        if (!data.getName().equals("ld_from")
+            && !data.getName().equals("ld_to")) {
             return ele;
         }
 
@@ -57,26 +58,31 @@
 
         /* Bit of an overkill here but it will be cached and accessed
          * in the next state anyway. */
-        BedOverview overview = BedOverviewFactory.getOverview(access.getRiverName());
+        BedOverview overview = BedOverviewFactory
+            .getOverview(access.getRiverName());
 
         if (overview == null) {
-            log.warn("No overview found for river '" + access.getRiverName() + "'");
+            log.warn("No overview found for river '"
+                + access.getRiverName() + "'");
             return ele;
         }
 
         KMIndex<List<Date>> entries = overview.filter(BedOverview.ACCEPT);
         if (entries.size() == 0) {
-            log.warn("No data found for river '" + access.getRiverName() + "'");
+            log.warn("No data found for river '"
+                + access.getRiverName() + "'");
             return ele;
         }
         entries.sort();
 
         if (data.getName().equals("ld_from")) {
             cr.addAttr(ele, "defaultLabel", data.getName(), true);
-            cr.addAttr(ele, "defaultValue", Double.toString(entries.get(0).getKm()), true);
+            cr.addAttr(ele, "defaultValue",
+                Double.toString(entries.get(0).getKm()), true);
         } else if (data.getName().equals("ld_to")) {
             cr.addAttr(ele, "defaultLabel", data.getName(), true);
-            cr.addAttr(ele, "defaultValue", Double.toString(entries.get(entries.size()-1).getKm()), true);
+            cr.addAttr(ele, "defaultValue",
+                Double.toString(entries.get(entries.size()-1).getKm()), true);
         }
 
         return ele;

http://dive4elements.wald.intevation.org