Mercurial > dive4elements > river
changeset 1162:588798ef4791
Cosmetics.
flys-artifacts/trunk@2699 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 12 Sep 2011 11:26:32 +0000 |
parents | 9bdf738abbad |
children | 2e0739853807 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WKmsImpl.java flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java |
diffstat | 3 files changed, 36 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Mon Sep 12 09:06:05 2011 +0000 +++ b/flys-artifacts/ChangeLog Mon Sep 12 11:26:32 2011 +0000 @@ -1,3 +1,11 @@ +2011-09-12 Felix Wolfsteller <felix.wolfsteller@intevation.de> + + Cosmetics. + + * src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java, + src/main/java/de/intevation/flys/artifacts/model/WKmsImpl.java: + Cosmetics. + 2011-09-12 Felix Wolfsteller <felix.wolfsteller@intevation.de> Added CSV Export for W-Differences.
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WKmsImpl.java Mon Sep 12 09:06:05 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WKmsImpl.java Mon Sep 12 11:26:32 2011 +0000 @@ -15,16 +15,19 @@ ws = new TDoubleArrayList(); } + public WKmsImpl(int capacity) { super(""); kms = new TDoubleArrayList(capacity); ws = new TDoubleArrayList(capacity); } + public WKmsImpl(TDoubleArrayList kms, TDoubleArrayList ws) { this(kms, ws, ""); } + public WKmsImpl( TDoubleArrayList kms, TDoubleArrayList ws, @@ -35,19 +38,23 @@ this.ws = ws; } + public void add(double km, double w) { kms.add(km); ws .add(w); } + public double getW(int index) { return ws.getQuick(index); } + public double getKm(int index) { return kms.getQuick(index); } + public int size() { return kms.size(); }
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java Mon Sep 12 09:06:05 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java Mon Sep 12 11:26:32 2011 +0000 @@ -13,10 +13,11 @@ import de.intevation.artifactdatabase.state.Facet; import de.intevation.flys.artifacts.FLYSArtifact; - import de.intevation.flys.artifacts.model.FacetTypes; import de.intevation.flys.artifacts.model.WKms; +import de.intevation.flys.utils.DataUtil; + /** * An OutGenerator that generates w differences curves. @@ -93,25 +94,28 @@ if (wkms == null) { logger.warn("No data to add to WDifferencesChart."); return; + } + + int size = wkms.size(); + XYSeries series = new StyledXYSeries(seriesName, theme); + + if (logger.isDebugEnabled()) { + if (wkms.size() > 0) { + logger.debug("Generate series: " + series.getKey()); + logger.debug("Start km: " + wkms.getKm(0)); + logger.debug("End km: " + wkms.getKm(size-1)); + logger.debug("Values : " + size); + } } - int size = wkms.size(); - XYSeries series = new StyledXYSeries(seriesName, theme); + for (int i = 0; i < size; i++) { + series.add(wkms.getKm(i), wkms.getW(i)); + } - if (logger.isDebugEnabled()) { - if (wkms.size() > 0) { - logger.debug("Generate series: " + series.getKey()); - logger.debug("Start km: " + wkms.getKm(0)); - logger.debug("End km: " + wkms.getKm(size-1)); - logger.debug("Values : " + size); - } - } - - for (int i = 0; i < size; i++) { - series.add(wkms.getKm(i), wkms.getW(i)); - } - - addFirstAxisSeries(series); + addFirstAxisSeries(series); + if (DataUtil.guessWaterIncreasing(wkms)) { + setInverted(true); + } }