diff artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java @ 7081:3c4efd4b2c19 generator-refactoring

Simplyfy / unify "invert axis" logic - DataUtil now can check if two datasets are in the same direction - In the case of WKM data a no means that the Water flows Right to Left - If the water flows from right to left do inversion of diagrams
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 20 Sep 2013 17:36:11 +0200
parents 7f600001c807
children f0731aa7b735
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Fri Sep 20 17:04:37 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Fri Sep 20 17:36:11 2013 +0200
@@ -1083,37 +1083,6 @@
         return diagramAttributes.getAxisName(index);
     }
 
-    /** Guess if the axis should be inverted to ensure ltr diagram water flow.
-     *
-     * A processor should decide if it is appropiate to activate this
-     * handling in a diagram by calling this function.
-     *
-     * Merke: In Deutschland fliesst Wasser in Diagrammen immer von
-     * links nach rechts!!!
-     */
-    public void handleLTRWaterFlowInversion(WKms wkms)
-    {
-        boolean wsUp = wkms.guessWaterIncreasing();
-        boolean kmUp = DataUtil.guessWaterIncreasing(wkms.allKms());
-        int size = wkms.size();
-        boolean inv = ((wsUp && kmUp) || (!wsUp && !kmUp)) && size > 1;
-
-        if (logger.isDebugEnabled()) {
-            logger.debug("handleLTRWaterFlowInversion: (Wkms)Values  : " + size);
-            if (size > 0) {
-                logger.debug("Start km: " + wkms.getKm(0));
-                logger.debug("End   km: " + wkms.getKm(size-1));
-            }
-            logger.debug("wsUp: " + wsUp);
-            logger.debug("kmUp: " + kmUp);
-            if (size == 1) {
-                logger.debug("Not inverting because we have just one km");
-        }
-            logger.debug("inv:  " + inv);
-        }
-        setInverted(inv);
-    }
-
     /** Add the acutal data to the diagram according to the processors.
      * For every outable facets, this function is
      * called and handles the data accordingly. */

http://dive4elements.wald.intevation.org