diff flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java @ 2000:e71719483546

Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings. flys-artifacts/trunk@3441 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 16 Dec 2011 13:37:58 +0000
parents 210020108ca4
children 3c3693e9c538
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Fri Dec 16 11:47:57 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Fri Dec 16 13:37:58 2011 +0000
@@ -100,6 +100,23 @@
     }
 
 
+    @Override
+    protected YAxisWalker getYAxisWalker() {
+        return new YAxisWalker() {
+            @Override
+            public int length() {
+                return YAXIS.values().length;
+            }
+
+            @Override
+            public String getId(int idx) {
+                YAXIS[] yaxes = YAXIS.values();
+                return yaxes[idx].toString();
+            }
+        };
+    }
+
+
     public boolean isInverted() {
         return inverted;
     }
@@ -463,32 +480,5 @@
             ? prefix + "(" + name +")"
             : name;
     }
-
-
-    @Override
-    protected List<Section> buildAxisSections() {
-        List<Section> axisSections = super.buildAxisSections();
-
-        for (YAXIS axis: YAXIS.values()) {
-            String identifier = axis.toString();
-
-            AxisSection axisSection = new AxisSection();
-            axisSection.setIdentifier(identifier);
-            axisSection.setLabel(getYAxisLabel(axis.idx));
-            axisSection.setFontSize(14);
-            axisSection.setFixed(false);
-
-            // XXX We are able to find better default ranges that [0,0], the
-            // only problem is, that we do NOT have a better range than [0,0]
-            // for each axis, because the initial chart will not have a dataset
-            // for each axis set!
-            axisSection.setUpperRange(0d);
-            axisSection.setLowerRange(0d);
-
-            axisSections.add(axisSection);
-        }
-
-        return axisSections;
-    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org