diff flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java @ 1684:bdb05dc9b763

Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained. flys-artifacts/trunk@2902 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 07 Oct 2011 10:51:09 +0000
parents 69929c471646
children 7eb9015489b0
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Fri Oct 07 09:40:15 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Fri Oct 07 10:51:09 2011 +0000
@@ -172,7 +172,12 @@
     }
 
 
-    public void doOut(Artifact artifact, Facet facet, Document attr) {
+    public void doOut(
+        Artifact artifact,
+        Facet    facet,
+        Document attr,
+        boolean  visible
+    ) {
         String name = facet.getName();
 
         logger.debug("LongitudinalSectionGenerator.doOut: " + name);
@@ -190,13 +195,13 @@
         }
 
         if (name.equals(LONGITUDINAL_W)) {
-            doWOut((WQKms) f.getData(artifact, context), attr);
+            doWOut((WQKms) f.getData(artifact, context), attr, visible);
         }
         else if (name.equals(LONGITUDINAL_Q)) {
-            doQOut((WQKms) f.getData(artifact, context), attr);
+            doQOut((WQKms) f.getData(artifact, context), attr, visible);
         }
         else if (name.equals(LONGITUDINAL_ANNOTATION)) {
-            doAnnotationsOut(f.getData(artifact, context), attr);
+            doAnnotationsOut(f.getData(artifact, context), attr, visible);
         }
         else {
             logger.warn("Unknown facet name: " + name);
@@ -211,12 +216,12 @@
      * @param o     list of annotations (data of facet).
      * @param theme yet ignored.
      */
-    protected void doAnnotationsOut(Object o, Document theme) {
+    protected void doAnnotationsOut(Object o, Document theme, boolean visible) {
         logger.debug("LongitudinalSectionGenerator.doAnnotationsOut");
 
         // Add all annotations in list o to our annotation pool.
         FLYSAnnotation fa = (FLYSAnnotation) o;
-        addAnnotations(fa);
+        addAnnotations(fa, visible);
     }
 
 
@@ -226,7 +231,7 @@
      * @param wqkms An array of WQKms values.
      * @param theme The theme that contains styling information.
      */
-    protected void doWOut(WQKms wqkms, Document theme) {
+    protected void doWOut(WQKms wqkms, Document theme, boolean visible) {
         logger.debug("LongitudinalSectionGenerator.doWOut");
 
         XYSeries series = new StyledXYSeries(getSeriesName(wqkms, "W"), theme);
@@ -246,7 +251,7 @@
             series.add(wqkms.getKm(i), wqkms.getW(i));
         }
 
-        addFirstAxisSeries(series);
+        addFirstAxisSeries(series, visible);
 
         if (wqkms.guessWaterIncreasing()) {
             setInverted(true);
@@ -260,7 +265,7 @@
      * @param wqkms An array of WQKms values.
      * @param theme The theme that contains styling information.
      */
-    protected void doQOut(WQKms wqkms, Document theme) {
+    protected void doQOut(WQKms wqkms, Document theme, boolean visible) {
         logger.debug("LongitudinalSectionGenerator.doQOut");
 
         XYSeries series = new StyledXYSeries(getSeriesName(wqkms, "Q"), theme);
@@ -280,7 +285,7 @@
             series.add(wqkms.getKm(i), wqkms.getQ(i));
         }
 
-        addSecondAxisSeries(series);
+        addSecondAxisSeries(series, visible);
 
         if (wqkms.guessWaterIncreasing()) {
             setInverted(true);

http://dive4elements.wald.intevation.org