Mercurial > dive4elements > river
changeset 448:88d9e1d75d64
W and Q curves in longitudinal section curves will now have names.
flys-artifacts/trunk@1940 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 18 May 2011 09:02:50 +0000 |
parents | 5606ba4139e0 |
children | 9814d4808410 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java |
diffstat | 2 files changed, 15 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Wed May 18 08:04:54 2011 +0000 +++ b/flys-artifacts/ChangeLog Wed May 18 09:02:50 2011 +0000 @@ -1,3 +1,9 @@ +2011-05-18 Ingo Weinzierl <ingo@intevation.de> + + * src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java: + W and Q curves will now have names based on the defined W or Q values + for the waterlevel computation. + 2011-05-18 Ingo Weinzierl <ingo@intevation.de> * src/main/java/de/intevation/flys/artifacts/model/NamedObject.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java Wed May 18 08:04:54 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java Wed May 18 09:02:50 2011 +0000 @@ -227,7 +227,7 @@ int idx = 0; for (WQKms tmp: wqkms) { - XYSeries series = new XYSeries(getSeriesName(tmp, "w", idx++)); + XYSeries series = new XYSeries(getSeriesName(tmp, "W")); double[] target = new double[3]; int size = tmp.size(); @@ -262,7 +262,7 @@ int idx = 0; for (WQKms tmp: wqkms) { - XYSeries series = new XYSeries(getSeriesName(tmp, "Q", idx++)); + XYSeries series = new XYSeries(getSeriesName(tmp, "Q")); double[] target = new double[3]; int size = tmp.size(); @@ -288,8 +288,13 @@ } - protected String getSeriesName(WQKms wqkms, String prefix, int idx) { - return prefix + "-" + idx; + protected String getSeriesName(WQKms wqkms, String mode) { + String name = wqkms.getName(); + String prefix = name != null && name.indexOf(mode) >= 0 ? null : mode; + + return prefix != null && prefix.length() > 0 + ? prefix + "(" + name +")" + : name; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :