# HG changeset patch # User Felix Wolfsteller # Date 1315571368 0 # Node ID 62ad0a753b6863117504c687d25e722721c3c3dd # Parent fc572b30f1b8bf9d49730d8b884d841d21f5772e Fix facet name and legend of w-differences, walk over distance state, too. flys-artifacts/trunk@2684 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r fc572b30f1b8 -r 62ad0a753b68 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Fri Sep 09 10:13:22 2011 +0000 +++ b/flys-artifacts/ChangeLog Fri Sep 09 12:29:28 2011 +0000 @@ -1,3 +1,17 @@ +2011-09-09 Felix Wolfsteller + + Fix Facet name and Legend of W-Differences, also insert state to specify + distance. + + * doc/conf/artifacts/winfo.xml: Add additional transitions to walk over + distances state. + + * src/main/java/de/intevation/flys/artifacts/states/WDifferencesState.java: + Set facets description. + + * src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java: + Take facets description as legend. + 2011-09-09 Felix Wolfsteller Added configuration to kick-in w-differences branch of winfo. @@ -24,7 +38,7 @@ New file, implements naive approach to calculate w-differences (of calculations identified by hardcoded uuids!) and register respective facet. - * src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java, + * src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java: New file, implementing naive approach to display w-differences. 2011-09-09 Felix Wolfsteller diff -r fc572b30f1b8 -r 62ad0a753b68 flys-artifacts/doc/conf/artifacts/winfo.xml --- a/flys-artifacts/doc/conf/artifacts/winfo.xml Fri Sep 09 10:13:22 2011 +0000 +++ b/flys-artifacts/doc/conf/artifacts/winfo.xml Fri Sep 09 12:29:28 2011 +0000 @@ -41,7 +41,7 @@ - + @@ -89,6 +89,12 @@ + + + + + + @@ -112,12 +118,6 @@ - - - - - - diff -r fc572b30f1b8 -r 62ad0a753b68 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WDifferencesState.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WDifferencesState.java Fri Sep 09 10:13:22 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WDifferencesState.java Fri Sep 09 12:29:28 2011 +0000 @@ -74,18 +74,22 @@ logger.warn("One of the artifacts (2) for diff calculation could not be loaded"); } WKms wkms = null; + String facetName = "diff ()"; if (flys1 != null && flys2 != null) { + // TODO also check size. + // TODO also need index of wqkms. WQKms[] minuend = (WQKms[]) flys1.getWaterlevelData().getData(); WQKms[] subtrahend = (WQKms[]) flys2.getWaterlevelData().getData(); wkms = WKmsOperation.SUBTRACTION.operate(minuend[0], subtrahend[0]); + facetName = "W ("+minuend[0].getName() + ") - W (" + subtrahend[0].getName()+")"; logger.warn("Did a WKMSSubtraction"); } if (facets != null) { // TODO: pass computetype and state id. //, ComputeType.ADVANCE, getID(), hash)); - facets.add(new DataFacet(W_DIFFERENCES, "wdiff data")); + facets.add(new DataFacet(W_DIFFERENCES, facetName)); } else { logger.debug("Not adding facets in WDifferencesState."); diff -r fc572b30f1b8 -r 62ad0a753b68 flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java Fri Sep 09 10:13:22 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java Fri Sep 09 12:29:28 2011 +0000 @@ -89,7 +89,7 @@ } if (name.equals(W_DIFFERENCES)) { - doWDifferencesOut((WKms) f.getData(artifact, context), attr); + doWDifferencesOut((WKms) f.getData(artifact, context), f.getDescription(), attr); } else { logger.warn("Unknown facet name: " + name); @@ -97,11 +97,11 @@ } } - + // TODO reenable inversion. /** * Add items to dataseries which describes the differences. */ - protected void doWDifferencesOut(WKms wkms, Document theme) { + protected void doWDifferencesOut(WKms wkms, String seriesName, Document theme) { logger.debug("WDifferencesCurveGenerator.doWDifferencesOut"); if (wkms == null) { logger.warn("No data to add to WDifferencesChart."); @@ -109,8 +109,7 @@ } int size = wkms.size(); - // TODO get series name - XYSeries series = new StyledXYSeries(getSeriesName(wkms, "delta"), theme); + XYSeries series = new StyledXYSeries(seriesName, theme); if (logger.isDebugEnabled()) { if (wkms.size() > 0) {