# HG changeset patch # User Ingo Weinzierl # Date 1329394511 0 # Node ID a992ab2588a85351a755698c84eb5661db1393fb # Parent 75146a1261c46536d36fb1e07412eb19ffa3b341 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place. flys-artifacts/trunk@4061 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 75146a1261c4 -r a992ab2588a8 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Thu Feb 16 11:58:10 2012 +0000 +++ b/flys-artifacts/ChangeLog Thu Feb 16 12:15:11 2012 +0000 @@ -1,3 +1,11 @@ +2012-02-16 Ingo Weinzierl + + 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 * src/main/java/de/intevation/flys/artifacts/model/WKmsImpl.java, diff -r 75146a1261c4 -r a992ab2588a8 flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java Thu Feb 16 11:58:10 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java Thu Feb 16 12:15:11 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,