diff flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 4282:8b4988815974

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).
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 29 Oct 2012 05:59:27 +0100
parents 3aec5a42696a
children e8a4d2fd25cc
line wrap: on
line diff
--- 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.<b>Note:</b> the marker is
+     * added to the chart only if it is not null and if <i>visible</i> 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.<b>Note:</b> the marker is
+     * added to the chart only if it is not null and if <i>visible</i> 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);
     }
 
 

http://dive4elements.wald.intevation.org