# HG changeset patch # User Felix Wolfsteller # Date 1321521483 0 # Node ID d99fdc234da185ef7a099a96ae4a9389df3d4d94 # Parent 346044bd523ddc5f87d60040966bdd4d82789573 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves. flys-artifacts/trunk@3281 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 346044bd523d -r d99fdc234da1 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Thu Nov 17 09:16:20 2011 +0000 +++ b/flys-artifacts/ChangeLog Thu Nov 17 09:18:03 2011 +0000 @@ -1,3 +1,8 @@ +2011-11-17 Felix Wolfsteller + + * src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java: + Handle STATIC_WKMS_INTERPOL and WQ/Points as Annotations. + 2011-11-17 Felix Wolfsteller * src/main/java/de/intevation/flys/artifacts/WQKmsInterpolArtifact.java: diff -r 346044bd523d -r d99fdc234da1 flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java Thu Nov 17 09:16:20 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java Thu Nov 17 09:18:03 2011 +0000 @@ -121,6 +121,9 @@ doAnnotations((FLYSAnnotation) f.getData(artifact, context), facet, attr, visible); } + else if (name.equals(STATIC_WKMS_INTERPOL)) { + doWAnnotations(f.getData(artifact, context), facet, attr, visible); + } else { logger.warn("Unknown facet type for computed discharge: " + name); return; @@ -185,5 +188,27 @@ doAnnotations(new FLYSAnnotation(facet.getDescription(), xy), facet, theme, visible); } + + /** + * Add W-Annotations to plot. + * @param wqkms actual data + * @param theme theme to use. + */ + protected void doWAnnotations( + Object wqkms, + Facet facet, + Document theme, + boolean visible + ) { + List xy = new ArrayList(); + double [][] data = (double [][]) wqkms; + for (int i = 0; i< data[0].length; i++) { + xy.add(new StickyAxisAnnotation(facet.getDescription(), + (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS)); + } + + doAnnotations(new FLYSAnnotation(facet.getDescription(), xy), + facet, theme, visible); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :