Mercurial > dive4elements > river
changeset 745:f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
flys-artifacts/trunk@2247 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 27 Jun 2011 09:42:21 +0000 |
parents | b385577bcaca |
children | 6af7f385555f |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeLongitudinalSectionGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java |
diffstat | 3 files changed, 31 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Mon Jun 27 09:17:41 2011 +0000 +++ b/flys-artifacts/ChangeLog Mon Jun 27 09:42:21 2011 +0000 @@ -1,3 +1,11 @@ +2011-06-27 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + Fix for flys/issue150 + + * src/main/java/de/intevation/flys/exports/DischargeLongitudinalSectionGenerator.java, + src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java: + Invert the x axis if its guessed that water is increasing. + 2011-06-27 Sascha L. Teichmann <sascha.teichmann@intevation.de> * src/main/java/de/intevation/flys/artifacts/model/WQ.java(guessWaterIncreasing):
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeLongitudinalSectionGenerator.java Mon Jun 27 09:17:41 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeLongitudinalSectionGenerator.java Mon Jun 27 09:42:21 2011 +0000 @@ -137,6 +137,10 @@ } cw.addSeries(series); } + + if (wqckms.guessWaterIncreasing()) { + setInverted(true); + } }
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java Mon Jun 27 09:17:41 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java Mon Jun 27 09:42:21 2011 +0000 @@ -20,8 +20,6 @@ import de.intevation.artifactdatabase.state.Facet; -import de.intevation.flys.model.River; - import de.intevation.flys.artifacts.FLYSArtifact; import de.intevation.flys.artifacts.model.FacetTypes; @@ -67,6 +65,8 @@ /** The storage for the Q series to be drawn in this chart.*/ protected XYSeriesCollection q; + protected boolean inverted; + public LongitudinalSectionGenerator() { super(); @@ -80,6 +80,13 @@ return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT); } + public boolean isInverted() { + return inverted; + } + + public void setInverted(boolean inverted) { + this.inverted = inverted; + } @Override protected void addSubtitles(JFreeChart chart) { @@ -182,13 +189,9 @@ * @param xaxis The domain axis. */ protected void invertXAxis(ValueAxis xaxis) { - FLYSArtifact artifact = (FLYSArtifact) master; - River river = artifact.getRiver(); - boolean up = river.getKmUp(); - - if (up) { - logger.info("Invert X-Axis."); + if (inverted) { + logger.debug("Invert X-Axis."); xaxis.setInverted(true); } } @@ -250,6 +253,10 @@ } w.addSeries(series); + + if (wqkms.guessWaterIncreasing()) { + setInverted(true); + } } @@ -279,6 +286,10 @@ } q.addSeries(series); + + if (wqkms.guessWaterIncreasing()) { + setInverted(true); + } }