Mercurial > dive4elements > river
changeset 2605:15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
flys-artifacts/trunk@4183 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 29 Mar 2012 11:09:26 +0000 |
parents | 83c117b639f9 |
children | 619f6dfec901 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java |
diffstat | 3 files changed, 45 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Wed Mar 28 12:18:44 2012 +0000 +++ b/flys-artifacts/ChangeLog Thu Mar 29 11:09:26 2012 +0000 @@ -1,3 +1,12 @@ +2012-03-29 Ingo Weinzierl <ingo@intevation.de> + + flys/issue366 (W-INFO / Abflusskurve, Diagramm: Umbenennen von Themen und Anzeige im Diagramm) + + * src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java, + src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java: + Use description from ArtifactAndFacet objects for JFreeChart Series + creation. + 2012-03-28 Ingo Weinzierl <ingo@intevation.de> flys/issue362 (W-Info / Abflusskurve, Diagramm)
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java Wed Mar 28 12:18:44 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java Thu Mar 29 11:09:26 2012 +0000 @@ -109,10 +109,10 @@ Facet facet = artifactFacet.getFacet(); if (name.equals(COMPUTED_DISCHARGE_Q)) { - doQOut((WQKms) artifactFacet.getData(context), facet, attr, visible); + doQOut((WQKms) artifactFacet.getData(context), artifactFacet, attr, visible); } else if (name.equals(STATIC_WQ)) { - doWQOut(artifactFacet.getData(context), facet, attr, visible); + doWQOut(artifactFacet.getData(context), artifactFacet, attr, visible); } else if (name.equals(STATIC_WQ_ANNOTATIONS)) { doWQAnnotations( @@ -153,14 +153,14 @@ * @param wqkms data as double[][] */ protected void doWQOut( - Object wqkms, - Facet facet, - Document theme, - boolean visible + Object wqkms, + ArtifactAndFacet aaf, + Document theme, + boolean visible ) { double [][] data = (double [][]) wqkms; - XYSeries series = new StyledXYSeries(facet.getDescription(), theme); + XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); StyledSeriesBuilder.addPoints(series, data); addAxisSeries(series, YAXIS.W.idx, visible); @@ -173,12 +173,12 @@ * @param theme theme to use. */ protected void doQOut( - WQKms wqkms, - Facet facet, - Document theme, - boolean visible + WQKms wqkms, + ArtifactAndFacet aaf, + Document theme, + boolean visible ) { - XYSeries series = new StyledXYSeries(facet.getDescription(), theme); + XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); StyledSeriesBuilder.addPointsQW(series, wqkms); addAxisSeries(series, YAXIS.W.idx, visible);
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java Wed Mar 28 12:18:44 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java Thu Mar 29 11:09:26 2012 +0000 @@ -199,10 +199,18 @@ } if (name.equals(DURATION_W)) { - doWOut((WQDay) artifactFacet.getData(context), attr, visible); + doWOut( + (WQDay) artifactFacet.getData(context), + artifactFacet, + attr, + visible); } else if (name.equals(DURATION_Q)) { - doQOut((WQDay) artifactFacet.getData(context), attr, visible); + doQOut( + (WQDay) artifactFacet.getData(context), + artifactFacet, + attr, + visible); } else if (name.equals(DURATION_MAINVALUES_Q) || name.equals(MAINVALUES_Q) @@ -234,12 +242,15 @@ * @param wqdays The WQDay store that contains the Ws. * @param theme */ - protected void doWOut(WQDay wqdays, Document theme, boolean visible) { + protected void doWOut( + WQDay wqdays, + ArtifactAndFacet aaf, + Document theme, + boolean visible + ) { logger.debug("DurationCurveGenerator.doWOut"); - // TODO find the correct series name - XYSeries series = new StyledXYSeries( - getSeriesName(getRiverName(), DURATION_W), theme); + XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); int size = wqdays.size(); for (int i = 0; i < size; i++) { @@ -259,12 +270,15 @@ * @param wqdays The WQDay store that contains the Qs. * @param theme */ - protected void doQOut(WQDay wqdays, Document theme, boolean visible) { + protected void doQOut( + WQDay wqdays, + ArtifactAndFacet aaf, + Document theme, + boolean visible + ) { logger.debug("DurationCurveGenerator.doQOut"); - // TODO find the correct series name - XYSeries series = new StyledXYSeries( - getSeriesName(getRiverName(), DURATION_Q), theme); + XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); int size = wqdays.size(); for (int i = 0; i < size; i++) {