diff artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java @ 7877:43f18dc56c5a

Fixed subtitle handling and added flowvelocity subtitle.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 16 May 2014 10:55:59 +0200
parents ad4a3980092f
children cfb3a4d0c637
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java	Fri May 16 09:32:51 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java	Fri May 16 10:55:59 2014 +0200
@@ -63,22 +63,29 @@
          * actually does the output and accesses the facet data.
          */
         D4EArtifact artifact = (D4EArtifact)bundle.getArtifact();
-
+        if (context.getContextValue("bounds_defined") != null &&
+            (Boolean)context.getContextValue("bounds_defined")) {
+            super.doOut(bundle, theme, visible);
+            return;
+        }
         if (getXBounds(0) != null && getDomainAxisRange() != null) {
             Bounds bounds =
                 calculateZoom(getXBounds(0), getDomainAxisRange());
             context.putContextValue("startkm", bounds.getLower());
             context.putContextValue("endkm", bounds.getUpper());
+            context.putContextValue("bounds_defined", true);
         }
         else if (getXBounds(0) != null && getDomainAxisRange() == null) {
             context.putContextValue("startkm", getXBounds(0).getLower());
             context.putContextValue("endkm", getXBounds(0).getUpper());
+            context.putContextValue("bounds_defined", true);
         }
         else if (getXBounds(0) == null && getDomainAxisRange() == null) {
             RangeAccess access = new RangeAccess(artifact);
             if (access.hasFrom() && access.hasTo()) {
                 context.putContextValue("startkm", access.getFrom());
                 context.putContextValue("endkm", access.getTo());
+                context.putContextValue("bounds_defined", true);
             }
         }
         else if (getXBounds(0) == null && getDomainAxisRange() != null){
@@ -89,6 +96,7 @@
                     calculateZoom(b, getDomainAxisRange());
                 context.putContextValue("startkm", bounds.getLower());
                 context.putContextValue("endkm", bounds.getUpper());
+                context.putContextValue("bounds_defined", true);
             }
         }
         super.doOut(bundle, theme, visible);

http://dive4elements.wald.intevation.org