diff flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java @ 2420:65ff8ff20be4

Fix flys/issue150 ('water increasing'). flys-artifacts/trunk@4056 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 16 Feb 2012 11:54:10 +0000
parents 1fcaeced48f2
children 1d1cf502a360
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Thu Feb 16 06:47:46 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Thu Feb 16 11:54:10 2012 +0000
@@ -431,10 +431,8 @@
 
         addAxisSeries(series, YAXIS.W.idx, visible);
 
-        if (wkms instanceof WQKms) {
-            if (needInvertAxis((WQKms) wkms)) {
-                setInverted(true);
-            }
+        if (needInvertAxis(wkms)) {
+            setInverted(true);
         }
     }
 
@@ -504,7 +502,6 @@
         }
     }
 
-
     /**
      * This method determines - taking JFreeCharts auto x value ordering into
      * account - if the x axis need to be inverted. Waterlines in these charts
@@ -513,18 +510,18 @@
      * @param wqkms The data object that stores the x and y values used for this
      * chart.
      */
-    public boolean needInvertAxis(WQKms wqkms) {
-        boolean wsUp = wqkms.guessWaterIncreasing();
-        boolean kmUp = DataUtil.guessWaterIncreasing(wqkms.allKms());
+    public boolean needInvertAxis(WKms wkms) {
+        boolean wsUp = wkms.guessWaterIncreasing();
+        boolean kmUp = DataUtil.guessWaterIncreasing(wkms.allKms());
         boolean inv = (wsUp && kmUp) || (!wsUp && !kmUp);
 
-        int size = wqkms.size();
+        int size = wkms.size();
 
         if (logger.isDebugEnabled()) {
-            logger.debug("Values  : " + size);
+            logger.debug("(Wkms)Values  : " + size);
             if (size > 0) {
-                logger.debug("Start km: " + wqkms.getKm(0));
-                logger.debug("End   km: " + wqkms.getKm(size-1));
+                logger.debug("Start km: " + wkms.getKm(0));
+                logger.debug("End   km: " + wkms.getKm(size-1));
             }
             logger.debug("wsUp: " + wsUp);
             logger.debug("kmUp: " + kmUp);
@@ -566,6 +563,8 @@
 
     /**
      * Do Area out.
+     * @param theme styling information.
+     * @param visible whether or not visible.
      */
     protected void doArea(
         Object     o,
@@ -602,6 +601,8 @@
             }
         }
 
+        // TODO Depending on style, the area (e.g. 20m^2) should be added as annotation.
+
         if (data.getLowerData() != null) {
             // TODO: Sort this out: when the two series have the same name,
             // the renderer (or anything in between) will not work correctly.

http://dive4elements.wald.intevation.org