# HG changeset patch # User Ingo Weinzierl # Date 1305709370 0 # Node ID 88d9e1d75d64ddd1b58833415754c5e8f5844423 # Parent 5606ba4139e04b21e22aa1d8681283ba58a6ac80 W and Q curves in longitudinal section curves will now have names. flys-artifacts/trunk@1940 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 5606ba4139e0 -r 88d9e1d75d64 flys-artifacts/ChangeLog --- 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 + + * 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 * src/main/java/de/intevation/flys/artifacts/model/NamedObject.java: diff -r 5606ba4139e0 -r 88d9e1d75d64 flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.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 :