# HG changeset patch # User Ingo Weinzierl # Date 1351486767 -3600 # Node ID 8b49888159747dc28de7a327becf1a6a93bea657 # Parent 7b6c313904273c5de2e3c7976d6f665f8d01274a Added marker for Ws and Qs in Historical Discharge WQ charts. Therefore, the XYChartGenerator got two new methods addDomainMarker(Marker, boolean) and addValueMarker(Marker, boolean). The boolean parameters determine, if the marker should be visible or not. This is analogous to addAxisSeries(XYSeries, int, boolean). diff -r 7b6c31390427 -r 8b4988815974 flys-artifacts/src/main/java/de/intevation/flys/exports/HistoricalDischargeWQCurveGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/HistoricalDischargeWQCurveGenerator.java Mon Oct 29 05:56:36 2012 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/HistoricalDischargeWQCurveGenerator.java Mon Oct 29 05:59:27 2012 +0100 @@ -10,6 +10,7 @@ import de.intevation.flys.artifacts.model.FacetTypes; import de.intevation.flys.artifacts.model.Timerange; import de.intevation.flys.artifacts.model.WQKms; +import de.intevation.flys.jfree.StyledValueMarker; import de.intevation.flys.jfree.StyledXYSeries; import de.intevation.flys.utils.FLYSUtils; @@ -128,16 +129,14 @@ protected void doHistoricalDischargeOutQ(FLYSArtifact artifact, Object data, String desc, Document theme, boolean visible) { - logger.debug("doHistoricalDischargeOutQ(): description = " + desc); - - // addAxisDataset(series, YAXIS.Q.idx, visible); + double value = Double.valueOf(data.toString()); + addDomainMarker(new StyledValueMarker(value, theme), visible); } protected void doHistoricalDischargeOutW(FLYSArtifact artifact, Object data, String desc, Document theme, boolean visible) { - logger.debug("doHistoricalDischargeOutW(): description = " + desc); - - // addAxisDataset(series, YAXIS.W.idx, visible); + double value = Double.valueOf(data.toString()); + addValueMarker(new StyledValueMarker(value, theme), visible); } protected void doHistoricalDischargeCurveOut(FLYSArtifact artifact, diff -r 7b6c31390427 -r 8b4988815974 flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Mon Oct 29 05:56:36 2012 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Mon Oct 29 05:59:27 2012 +0100 @@ -503,11 +503,20 @@ * Add the given vertical marker to the chart. */ public void addDomainMarker(Marker marker) { - if (marker == null) { - return; + addDomainMarker(marker, true); + } + + + /** + * Add the given vertical marker to the chart.Note: the marker is + * added to the chart only if it is not null and if visible is true. + * @param marker The marker that should be added to the chart. + * @param visible The visibility of the marker. + */ + public void addDomainMarker(Marker marker, boolean visible) { + if (visible && marker != null) { + domainMarkers.add(marker); } - - domainMarkers.add(marker); } @@ -515,11 +524,20 @@ * Add the given vertical marker to the chart. */ public void addValueMarker(Marker marker) { - if (marker == null) { - return; + addValueMarker(marker, true); + } + + + /** + * Add the given horizontal marker to the chart.Note: the marker is + * added to the chart only if it is not null and if visible is true. + * @param marker The marker that should be added to the chart. + * @param visible The visibility of the marker. + */ + public void addValueMarker(Marker marker, boolean visible) { + if (visible && marker != null) { + valueMarkers.add(marker); } - - valueMarkers.add(marker); }