diff artifacts/src/main/java/org/dive4elements/river/exports/DischargeCurveGenerator.java @ 8856:5e38e2924c07 3.2.x

Fix code style.
author Tom Gottfried <tom@intevation.de>
date Thu, 18 Jan 2018 20:12:01 +0100
parents 7f1fb07e4e3d
children 1cc7653ca84f 0a5239a1e46e
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DischargeCurveGenerator.java	Thu Jan 18 20:10:59 2018 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DischargeCurveGenerator.java	Thu Jan 18 20:12:01 2018 +0100
@@ -81,7 +81,11 @@
     /**
      * Returns the PNP (Datum) of gauge, if at gauge, 0 otherwise.
      */
-    public static double getCurrentGaugeDatum(double km, D4EArtifact artifact, double tolerance) {
+    public static double getCurrentGaugeDatum(
+        double km,
+        D4EArtifact artifact,
+        double tolerance
+    ) {
         // Look if there is a gauge at chosen km:
         // Get gauge which is defined for km
         Gauge gauge = new RiverAccess(artifact).getRiver()
@@ -154,22 +158,27 @@
                     fixedWinMRange.getUpperBound());
         }
 
-        log.debug("Syncing Axis Bounds. Bounds W: " + boundsInMGauge.toString() +
-                " Bounds Wcm: " + boundsInCM.toString());
+        log.debug("Syncing Axis Bounds. Bounds W: "
+            + boundsInMGauge.toString()
+            + " Bounds Wcm: " + boundsInCM.toString());
 
         double datum = getCurrentGaugeDatum();
 
         // Convert boundsInMGauge to Datum+cm
-        double convertedLower = ((Double)boundsInMGauge.getLower() - datum) * 100;
-        double convertedUpper = ((Double)boundsInMGauge.getUpper() - datum) * 100;
-        Bounds convertedBounds = new DoubleBounds(convertedLower, convertedUpper);
+        double convertedLower =
+            ((Double)boundsInMGauge.getLower() - datum) * 100;
+        double convertedUpper =
+            ((Double)boundsInMGauge.getUpper() - datum) * 100;
+        Bounds convertedBounds =
+            new DoubleBounds(convertedLower, convertedUpper);
 
         // Now combine both Ranges
         boundsInCM = boundsInCM.combine(convertedBounds);
 
         // Recalculate absolute bounds
-        boundsInMGauge = new DoubleBounds((Double)boundsInCM.getLower() / 100d + datum,
-                                          (Double)boundsInCM.getUpper() / 100d + datum);
+        boundsInMGauge = new DoubleBounds(
+            (Double)boundsInCM.getLower() / 100d + datum,
+            (Double)boundsInCM.getUpper() / 100d + datum);
 
         // Set the new combined bounds
         setYBounds(YAXIS.W.idx, boundsInMGauge);
@@ -222,7 +231,12 @@
 
     /* TODO is this one really needed? */
     @Override
-    protected boolean zoomX(XYPlot plot, ValueAxis axis, Bounds bounds, Range x) {
+    protected boolean zoomX(
+        XYPlot plot,
+        ValueAxis axis,
+        Bounds bounds,
+        Range x
+    ) {
         boolean zoomin = super.zoom(plot, axis, bounds, x);
 
         if (!zoomin) {
@@ -240,12 +254,16 @@
         log.debug("Translate some river annotation.");
         double translate = getCurrentGaugeDatum();
         double factor    = 100d;
-        for (StickyAxisAnnotation annotation: riverAnnotation.getAxisTextAnnotations()){
+        for (StickyAxisAnnotation annotation:
+                 riverAnnotation.getAxisTextAnnotations()
+        ){
             if (!annotation.atX()) {
                 annotation.setPos((annotation.getPos() - translate)*factor);
             }
         }
-        for (XYTextAnnotation annotation: riverAnnotation.getTextAnnotations()) {
+        for (
+            XYTextAnnotation annotation: riverAnnotation.getTextAnnotations()
+        ) {
             annotation.setY((annotation.getY() - translate)*factor);
         }
     }
@@ -260,10 +278,12 @@
         String name = artifactFacet.getFacetName();
         log.debug("DischargeCurveGenerator.doOut: " + name);
 
-        MiscDischargeProcessor dProcessor = new MiscDischargeProcessor(getRange()[0]);
+        MiscDischargeProcessor dProcessor = new MiscDischargeProcessor(
+            getRange()[0]);
         if (dProcessor.canHandle(name)) {
             // In Base DischargeCurveGenerator, always at gauge, use WCm axis.
-            dProcessor.doOut(this, artifactFacet, theme, visible, YAXIS.WCm.idx);
+            dProcessor.doOut(
+                this, artifactFacet, theme, visible, YAXIS.WCm.idx);
         }
         else if (name.equals(DISCHARGE_CURVE)
                 || name.equals(GAUGE_DISCHARGE_CURVE)) {
@@ -286,7 +306,8 @@
                 visible);
         }
         else {
-           log.warn("DischargeCurveGenerator.doOut: Unknown facet name: " + name);
+           log.warn("DischargeCurveGenerator.doOut: Unknown facet name: "
+               + name);
            return;
         }
     }
@@ -408,7 +429,8 @@
 
         // If no Q values (i.e. all -1) found, add annotations.
         if (hasNoDischarge(data)) {
-            List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>();
+            List<StickyAxisAnnotation> xy =
+                new ArrayList<StickyAxisAnnotation>();
 
             for (double y: data[1]) {
                 if (translate != 0d) {

http://dive4elements.wald.intevation.org