diff artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.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 e4606eae8ea5
children 1cc7653ca84f 0a5239a1e46e
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java	Thu Jan 18 20:10:59 2018 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java	Thu Jan 18 20:12:01 2018 +0100
@@ -156,22 +156,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);
@@ -181,7 +186,11 @@
     }
 
     @Override
-    public void doOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) {
+    public void doOut(
+        ArtifactAndFacet aaf,
+        ThemeDocument doc,
+        boolean visible
+    ) {
         log.debug("doOut: " + aaf.getFacetName());
         if (!prepareChartData(aaf, doc, visible)) {
             log.warn("Unknown facet, name " + aaf.getFacetName());
@@ -192,7 +201,11 @@
      * Return true if data could be handled,
      * to be overridden to add more handled data.
      */
-    public boolean prepareChartData(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) {
+    public boolean prepareChartData(
+        ArtifactAndFacet aaf,
+        ThemeDocument doc,
+        boolean visible
+    ) {
         String name = aaf.getFacetName();
 
         this.artifact = (D4EArtifact) aaf.getArtifact();
@@ -266,7 +279,11 @@
 
 
     /** Add sector average points to chart. */
-    protected void doSectorAverageOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) {
+    protected void doSectorAverageOut(
+        ArtifactAndFacet aaf,
+        ThemeDocument doc,
+        boolean visible
+    ) {
         log.debug("doSectorAverageOut");
 
         QWDDateRange qwdd = (QWDDateRange) aaf.getData(context);
@@ -321,7 +338,8 @@
 
         if (visible && doc.parseShowPointLabel()) {
 
-            List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>();
+            List<XYTextAnnotation> textAnnos =
+                new ArrayList<XYTextAnnotation>();
 
             DateFormat dateFormat = DateFormat.getDateInstance(
                 DateFormat.SHORT);
@@ -331,7 +349,8 @@
                 w);
             textAnnos.add(anno);
 
-            RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, doc);
+            RiverAnnotation flysAnno =
+                new RiverAnnotation(null, null, null, doc);
             flysAnno.setTextAnnotations(textAnnos);
             addAnnotations(flysAnno);
         }
@@ -339,7 +358,11 @@
 
 
     /** Add reference event points to chart. */
-    protected void doReferenceEventsOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) {
+    protected void doReferenceEventsOut(
+        ArtifactAndFacet aaf,
+        ThemeDocument doc,
+        boolean visible
+    ) {
         log.debug("doReferenceEventsOut");
 
         QWI qwd = (QWI)aaf.getData(context);
@@ -379,9 +402,11 @@
                 qwd.getQ(),
                 w);
 
-            List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>();
+            List<XYTextAnnotation> textAnnos =
+                new ArrayList<XYTextAnnotation>();
             textAnnos.add(anno);
-            RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, doc);
+            RiverAnnotation flysAnno =
+                new RiverAnnotation(null, null, null, doc);
             flysAnno.setTextAnnotations(textAnnos);
             addAnnotations(flysAnno);
         }
@@ -409,13 +434,15 @@
                 series.add(wqkms.getQ(i), wqkms.getW(i), false);
                 addAxisSeries(series, YAXIS.W.idx, visible);
                 if(visible && theme.parseShowPointLabel()) {
-                    List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>();
+                    List<XYTextAnnotation> textAnnos =
+                        new ArrayList<XYTextAnnotation>();
                     XYTextAnnotation anno = new CollisionFreeXYTextAnnotation(
                             title,
                             wqkms.getQ(i),
                             factor*(wqkms.getW(i)-gaugeDatum));
                     textAnnos.add(anno);
-                    RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, theme);
+                    RiverAnnotation flysAnno =
+                        new RiverAnnotation(null, null, null, theme);
                     flysAnno.setTextAnnotations(textAnnos);
                     addAnnotations(flysAnno);
                 }
@@ -424,7 +451,11 @@
         }
     }
 
-    protected void doEventsOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) {
+    protected void doEventsOut(
+        ArtifactAndFacet aaf,
+        ThemeDocument doc,
+        boolean visible
+    ) {
         log.debug("doEventsOut");
         // Find W/Q at km.
         addPointFromWQKms((WQKms) aaf.getData(context),
@@ -432,7 +463,11 @@
     }
 
 
-    protected void doWQCurveOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) {
+    protected void doWQCurveOut(
+        ArtifactAndFacet aaf,
+        ThemeDocument doc,
+        boolean visible
+    ) {
         log.debug("doWQCurveOut");
 
         FixWQCurveFacet facet = (FixWQCurveFacet)aaf.getFacet();
@@ -472,7 +507,10 @@
                 // Use second axis at cm if at gauge.
                 for (int i = 0, N = series.getItemCount(); i < N; i++) {
                     series.updateByIndex(
-                        i, new Double(100d*(series.getY(i).doubleValue()-gaugeDatum)));
+                        i,
+                        new Double(100d *
+                                (series.getY(i).doubleValue() - gaugeDatum))
+                    );
                 }
                 addAxisSeries(series, YAXIS.WCm.idx, visible);
             }
@@ -482,7 +520,11 @@
         }
     }
 
-    protected void doOutlierOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) {
+    protected void doOutlierOut(
+        ArtifactAndFacet aaf,
+        ThemeDocument doc,
+        boolean visible
+    ) {
         log.debug("doOutlierOut");
 
         QWI[] qws = (QWI[])aaf.getData(context);
@@ -491,7 +533,11 @@
 
 
     /** Add markers for q sectors. */
-    protected void doQSectorOut(ArtifactAndFacet aaf, ThemeDocument theme, boolean visible) {
+    protected void doQSectorOut(
+        ArtifactAndFacet aaf,
+        ThemeDocument theme,
+        boolean visible
+    ) {
         log.debug("doQSectorOut");
         if (!visible) {
             return;
@@ -504,7 +550,9 @@
         }
 
         List<?> qsectorsList = (List<?>) qsectorsObj;
-        if (qsectorsList.size() == 0 || !(qsectorsList.get(0) instanceof NamedDouble)) {
+        if (qsectorsList.size() == 0
+            || !(qsectorsList.get(0) instanceof NamedDouble)
+        ) {
             log.warn("No QSectors coming from data.");
             return;
         }
@@ -571,7 +619,8 @@
             double [][] data = (double [][]) wqkms;
             for (int i = 0; i< data[0].length; i++) {
                 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(),
-                        (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS));
+                        (float) data[1][i],
+                        StickyAxisAnnotation.SimpleAxis.Y_AXIS));
             }
 
             doAnnotations(new RiverAnnotation(facet.getDescription(), xy),
@@ -660,13 +709,15 @@
             // be delivered by the facet already (instead of in the Generator).
             log.debug("FixWQCurveGenerator: doWQOut: WQKms");
 
-            addPointFromWQKms((WQKms) aaf.getData(context), aaf.getFacetDescription(), theme, visible);
+            addPointFromWQKms((WQKms)aaf.getData(context),
+                aaf.getFacetDescription(), theme, visible);
         }
         else {
             log.debug("FixWQCurveGenerator: doWQOut: double[][]");
             double [][] data = (double [][]) wqkms;
 
-            XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), false, true, theme);
+            XYSeries series = new StyledXYSeries(
+                aaf.getFacetDescription(), false, true, theme);
             StyledSeriesBuilder.addPoints(series, data, true);
 
             addAxisSeries(series, YAXIS.W.idx, visible);
@@ -802,7 +853,10 @@
             ? "cm"
             : RiverUtils.getRiver(flys).getWstUnit().getName();
 
-        return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT, new Object[] { unit });
+        return msg(
+            I18N_YAXIS_LABEL,
+            I18N_YAXIS_LABEL_DEFAULT,
+            new Object[] { unit });
     }
 
     @Override

http://dive4elements.wald.intevation.org