diff artifacts/src/main/java/org/dive4elements/river/jfree/EnhancedLineAndShapeRenderer.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 eec4df8165a1 0a5239a1e46e
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/jfree/EnhancedLineAndShapeRenderer.java	Thu Jan 18 20:10:59 2018 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/jfree/EnhancedLineAndShapeRenderer.java	Thu Jan 18 20:12:01 2018 +0100
@@ -89,7 +89,8 @@
         String text, float textX, float textY, Color bgColor
     ) {
         Rectangle2D hotspotBox = g2.getFontMetrics().getStringBounds(text, g2);
-        float w = (float) hotspotBox.getWidth(), h = (float) hotspotBox.getHeight();
+        float w = (float)hotspotBox.getWidth();
+        float h = (float)hotspotBox.getHeight();
         hotspotBox.setRect(textX, textY-h, w, h);
         Color oldColor = g2.getColor();
         g2.setColor(bgColor);
@@ -102,16 +103,24 @@
      * Whether or not a specific item in a series (maybe the maxima) should
      * be rendered with shape.
      */
-    public boolean getItemShapeVisible(XYDataset dataset, int series, int item){
+    public boolean getItemShapeVisible(
+        XYDataset dataset,
+        int series,
+        int item
+    ){
         if (super.getItemShapeVisible(series, item)) {
             return true;
         }
 
-        if (isMinimumShapeVisible(series) && isMinimum(dataset, series, item)) {
+        if (isMinimumShapeVisible(series)
+            && isMinimum(dataset, series, item)
+        ) {
             return true;
         }
 
-        if (isMaximumShapeVisible(series) && isMaximum(dataset, series, item)) {
+        if (isMaximumShapeVisible(series)
+            && isMaximum(dataset, series, item)
+        ) {
             return true;
         }
 
@@ -215,7 +224,8 @@
             // OPTIMIZE: instead of calculating minimum and maximum for every
             //           point, calculate it just once (assume that dataset
             //           content does not change during rendering).
-            // NOTE:     Above OPTIMIZE might already be fulfilled to most extend.
+            // NOTE:     Above OPTIMIZE might already be fulfilled to
+            //           most extend.
             boolean isMinimum = isMinimumShapeVisible(series)
                 && isMinimum(dataset, series, item);
 
@@ -299,11 +309,13 @@
             && isShowLineLabel(series)
             && isMinimumX (dataset, series, item)
             ) {
-            XYSeries xYSeries = ((XYSeriesCollection) dataset).getSeries(series);
+            XYSeries xYSeries = ((XYSeriesCollection)dataset)
+                .getSeries(series);
             String waterlevelLabel = (xYSeries instanceof HasLabel)
                 ? ((HasLabel)xYSeries).getLabel()
                 : xYSeries.getKey().toString();
-            // TODO Force water of some German rivers to flow direction mountains.
+            // TODO Force water of some German rivers to flow
+            // direction mountains.
 
             Font oldFont = g2.getFont();
 
@@ -330,8 +342,13 @@
                                       CollisionFreeLineLabelEntity.class)) {
                 xx += 5f;
                 hotspot = TextUtilities.calculateRotatedStringBounds(
-                    waterlevelLabel, g2, (float)xx, (float)yy-3f, TextAnchor.CENTER_LEFT,
-                    0f, TextAnchor.CENTER_LEFT);
+                    waterlevelLabel,
+                    g2,
+                    (float)xx,
+                    (float)yy-3f,
+                    TextAnchor.CENTER_LEFT,
+                    0f,
+                    TextAnchor.CENTER_LEFT);
             }
 
             // Register to avoid collissions.

http://dive4elements.wald.intevation.org