# HG changeset patch # User Ingo Weinzierl # Date 1333019366 0 # Node ID 15a3684c6bce138a915ef99aea58d8b1a373558b # Parent 83c117b639f99361f1aae8634aa4a90e4bfdac7d #366 Display correct descriptions in legend panel of charts. flys-artifacts/trunk@4183 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 83c117b639f9 -r 15a3684c6bce flys-artifacts/ChangeLog --- 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 + + 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 flys/issue362 (W-Info / Abflusskurve, Diagramm) diff -r 83c117b639f9 -r 15a3684c6bce flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java --- 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); diff -r 83c117b639f9 -r 15a3684c6bce flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java --- 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++) {