Mercurial > dive4elements > river
changeset 1921:d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
flys-artifacts/trunk@3281 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 17 Nov 2011 09:18:03 +0000 |
parents | 346044bd523d |
children | 7e7522c9e663 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java |
diffstat | 2 files changed, 30 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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 <felix.wolfsteller@intevation.de> + + * src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java: + Handle STATIC_WKMS_INTERPOL and WQ/Points as Annotations. + 2011-11-17 Felix Wolfsteller <felix.wolfsteller@intevation.de> * src/main/java/de/intevation/flys/artifacts/WQKmsInterpolArtifact.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<XYTextAnnotation> xy = new ArrayList<XYTextAnnotation>(); + 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 :