# HG changeset patch # User Felix Wolfsteller # Date 1315392714 0 # Node ID 01d42a2454f6645fd614811e1776a83b74de1856 # Parent bcba246d9c03ab1d664e0774553603f39f0817f3 Display real km of shown data in crosssection-diagram. flys-artifacts/trunk@2664 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r bcba246d9c03 -r 01d42a2454f6 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Wed Sep 07 10:37:14 2011 +0000 +++ b/flys-artifacts/ChangeLog Wed Sep 07 10:51:54 2011 +0000 @@ -1,3 +1,14 @@ +2011-09-07 Felix Wolfsteller + + In CrossSection Diagram fix subtitle to display the km of which the data is + actually displayed (maybe contrasting users wish). + + * src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java: + (getCrossSectionSnapKm): New method to fetch the actual km of crosssection. + + * src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java: + Add correct km to charts subtitle. + 2011-09-07 Felix Wolfsteller Fix various display-issues like i18n in cross-section diagram. diff -r bcba246d9c03 -r 01d42a2454f6 flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java Wed Sep 07 10:37:14 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java Wed Sep 07 10:51:54 2011 +0000 @@ -682,6 +682,18 @@ /** + * Get km for which a CrossSection is actually available (this may vary + * from the user picked "cross_section.km" data). + * + * @return km for which cross section is calculated. + */ + public double getCrossSectionSnapKm() { + // Note that this is this triggers a linear search. + return searchCrossSectionKmLine().getKm().doubleValue(); + } + + + /** * Get points of Profile of cross section. * * @return an array holding coordinates of points of profile ( diff -r bcba246d9c03 -r 01d42a2454f6 flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java Wed Sep 07 10:37:14 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java Wed Sep 07 10:51:54 2011 +0000 @@ -100,7 +100,7 @@ protected Double getKm() { try { WINFOArtifact winfo = (WINFOArtifact) master; - return Double.parseDouble(winfo.getDataAsString("cross_section.km")); + return winfo.getCrossSectionSnapKm(); } catch (Exception e) { logger.error("Cannot convert cross_section.km to double");