diff artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java @ 6687:641f93a5fa9e

Do not translate river annotations twice. (issue1370) This fixes mainvaluesW at gauge becuase they are already translated when fetched from the artifact. I hope this is not necessary for other annotations. I could not see any.
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 29 Jul 2013 10:14:32 +0200
parents 6791411ed1fc
children 08e3c22500f3
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java	Fri Jul 26 16:28:34 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java	Mon Jul 29 10:14:32 2013 +0200
@@ -174,24 +174,6 @@
         }
     }
 
-    /** Translate River annotations if not at gauge. */
-    public void translateRiverAnnotation(RiverAnnotation riverAnnotation) {
-        if (getCurrentGaugeDatum() == 0d) {
-            return;
-        }
-        logger.debug("Translate some river annotation.");
-        double translate = getCurrentGaugeDatum();
-        double factor    = 100d;
-        for (StickyAxisAnnotation annotation: riverAnnotation.getAxisTextAnnotations()){
-            if (!annotation.atX()) {
-                annotation.setPos((annotation.getPos() - translate)*factor);
-            }
-        }
-        for (XYTextAnnotation annotation: riverAnnotation.getTextAnnotations()) {
-            annotation.setY((annotation.getY() - translate)*factor);
-        }
-    }
-
     @Override
     public void doOut(ArtifactAndFacet aaf, Document doc, boolean visible) {
         logger.debug("doOut: " + aaf.getFacetName());
@@ -256,7 +238,6 @@
         }
         else if (name.equals(MAINVALUES_W) || name.equals(MAINVALUES_Q)) {
             RiverAnnotation mainValues = (RiverAnnotation) aaf.getData(context);
-            translateRiverAnnotation(mainValues);
             doAnnotations(
                 mainValues,
                 aaf,

http://dive4elements.wald.intevation.org