[PATCH 2 of 9] Handle axis include zero setting for the new processing architecture

Wald Commits scm-commit at wald.intevation.org
Tue Sep 24 11:43:59 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1380014848 -7200
# Branch generator-refactoring
# Node ID 564033adf9c64bd61919ab6b25e3500076dbeb26
# Parent  ed8623b989f38c117fca70f38cfb7a4e881267b9
Handle axis include zero setting for the new processing architecture

diff -r ed8623b989f3 -r 564033adf9c6 artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Tue Sep 24 11:26:45 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Tue Sep 24 11:27:28 2013 +0200
@@ -1103,4 +1103,14 @@
             }
         }
     }
+
+    @Override
+    protected NumberAxis createYAxis(int index) {
+        NumberAxis axis = super.createYAxis(index);
+
+        if (diagramAttributes.getAxesAttributes().get(index).includeZero()) {
+            axis.setAutoRangeIncludesZero(true);
+        }
+        return axis;
+    }
 }
diff -r ed8623b989f3 -r 564033adf9c6 artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java	Tue Sep 24 11:26:45 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java	Tue Sep 24 11:27:28 2013 +0200
@@ -38,27 +38,5 @@
         }
         return super.getDefaultChartSubtitle();
     }
-
-    /**
-     * Create Axis for given index.
-     * @return axis with according internationalized label.
-     */
-    @Override
-    protected NumberAxis createYAxis(int index) {
-        // TODO decide what to do with this.
-        return super.createYAxis(index);
-        /*
-        NumberAxis axis = super.createYAxis(index);
-
-        // "Q" Axis shall include 0.
-        if (index == YAXIS.Q.idx) {
-            axis.setAutoRangeIncludesZero(true);
-        }
-        else {
-            axis.setAutoRangeIncludesZero(false);
-        }
-
-        return axis;*/
-    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :


More information about the Dive4elements-commits mailing list