changeset 2421:59047dfed8be

Picked rev4061 from trunk. flys-artifacts/tags/2.6.1@4064 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 16 Feb 2012 12:35:51 +0000
parents 65ff8ff20be4
children 44dc117aa2b7
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java
diffstat 2 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu Feb 16 11:54:10 2012 +0000
+++ b/flys-artifacts/ChangeLog	Thu Feb 16 12:35:51 2012 +0000
@@ -1,3 +1,11 @@
+2012-02-16  Ingo Weinzierl <ingo@intevation.de>
+
+	flys/issue509 (Dauerlinie: Q-Achse sollte bei 0 beginnen)
+
+	* src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java:
+	  Set the lower bounds of the Q axis to 0 to avoid displaying negative
+	  discharge values.
+
 2012-02-16	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	Fix flys/issue150 (exposure of gravitational anomalies)
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java	Thu Feb 16 11:54:10 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java	Thu Feb 16 12:35:51 2012 +0000
@@ -161,6 +161,27 @@
     }
 
 
+    /**
+     * This method overrides the method in the parent class to set the lower
+     * bounds of the Q axis to 0. This axis should never display negative
+     * values on its own.
+     */
+    @Override
+    protected boolean zoomY(XYPlot plot, ValueAxis axis, Range range, Range x) {
+        boolean zoomin = super.zoom(plot, axis, range, x);
+
+        if (!zoomin && axis instanceof IdentifiableNumberAxis) {
+            String id = ((IdentifiableNumberAxis) axis).getId();
+
+            if (YAXIS.Q.toString().equals(id)) {
+                axis.setLowerBound(0d);
+            }
+        }
+
+        return zoomin;
+    }
+
+
     @Override
     public void doOut(
         ArtifactAndFacet artifactFacet,

http://dive4elements.wald.intevation.org