Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java @ 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 | 3b83341e0cf4 |
children | e006da5679d2 |
line wrap: on
line diff
--- 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 :