diff artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveGenerator.java @ 6453:f11165468f0a

issue1370: swap default axis (now in cm), translate annotations if in cm.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 26 Jun 2013 22:06:15 +0200
parents dad4f0424783
children e860fa106f56
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveGenerator.java	Wed Jun 26 21:13:43 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveGenerator.java	Wed Jun 26 22:06:15 2013 +0200
@@ -102,6 +102,18 @@
         return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT, new Object[] { unit });
     }
 
+    /**
+     * Generate a ForceAxisDataset for the second y axis, if requested,
+     * to force display of second Y axis.
+    @Override
+    protected AxisDataset createAxisDataset(int idx) {
+        logger.debug("Create new ForceAxisDataset for index: " + idx);
+        if (true || idx == 1) {
+            return new ForceAxisDataset(1);
+        }
+        return new XYAxisDataset(idx);
+    }
+     */
 
     /**
      * Create Y (range) axis for given index, here with a special axis
@@ -173,8 +185,11 @@
                 || name.equals(COMPUTED_DISCHARGE_MAINVALUES_W)
                 || name.equals(MAINVALUES_W)
         ) {
-            doAnnotations((RiverAnnotation)
-                artifactFacet.getData(context), artifactFacet, attr, visible);
+            RiverAnnotation mainValues = (RiverAnnotation) artifactFacet.getData(context);
+            translateRiverAnnotation(mainValues);
+            doAnnotations(
+                mainValues,
+                artifactFacet, attr, visible);
         }
         else if (name.equals(STATIC_WKMS_INTERPOL) || name.equals(HEIGHTMARKS_POINTS)) {
             doWAnnotations(

http://dive4elements.wald.intevation.org