diff flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java @ 2104:bb0dede9294f

Implementation towards areas at other than first axis (flys/issue441). flys-artifacts/trunk@3661 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 12 Jan 2012 12:29:56 +0000
parents a026d005accd
children 51b9899f819d
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java	Thu Jan 12 12:22:40 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java	Thu Jan 12 12:29:56 2012 +0000
@@ -25,7 +25,7 @@
  * An OutGenerator that generates cross section graphs.
  */
 public class CrossSectionGenerator
-extends      XYChartGenerator
+extends      LongitudinalSectionGenerator//XYChartGenerator
 implements   FacetTypes
 {
     /** The logger that is used in this generator. */
@@ -76,7 +76,7 @@
      * Get localized chart title.
      */
     @Override
-    protected String getDefaultChartTitle() {
+    public String getDefaultChartTitle() {
         Object[] i18n_msg_args = new Object[] {
             getRiverName()
         };
@@ -175,55 +175,10 @@
     }
 
 
-    /**
-     * Do Area out.
-     */
-    protected void doArea(
-        Object     o,
-        String     seriesName,
-        Document   theme,
-        boolean    visible
-    ) {
-        logger.debug("CrossSectionGenerator.doArea");
-        StyledAreaSeriesCollection area = new StyledAreaSeriesCollection(theme);
-
-        // TODO make this more stable.
-        Object[] doubles = (Object[]) o;
-        XYSeries up   = null;
-        XYSeries down = null;
-
-        if (doubles[1] != null) {
-            up = new StyledXYSeries(seriesName, false, theme);
-            StyledSeriesBuilder.addPoints(up, (double [][]) doubles[1]);
-        }
-
-        if (doubles[0] != null) {
-            // TODO: Sort this out: when the two series have the same name,
-            // the renderer (or anything in between) will not work correctly.
-            down = new StyledXYSeries(seriesName + " ", false, theme);
-            StyledSeriesBuilder.addPoints(down, (double [][]) doubles[0]);
-        }
-
-        if (up == null && down != null) {
-            area.setMode(StyledAreaSeriesCollection.FILL_MODE.ABOVE);
-            down.setKey(seriesName);
-            area.addSeries(down);
-        }
-        else if (up != null && down == null) {
-            area.setMode(StyledAreaSeriesCollection.FILL_MODE.UNDER);
-            area.addSeries(up);
-        }
-        else if (up != null && down != null) {
-            if (doubles[2] != null && ((Boolean)doubles[2]).booleanValue()) {
-                area.setMode(StyledAreaSeriesCollection.FILL_MODE.BETWEEN);
-            }
-            else {
-                area.setMode(StyledAreaSeriesCollection.FILL_MODE.ABOVE);
-            }
-            area.addSeries(up);
-            area.addSeries(down);
-        }
-        addAreaSeries(area, 0, visible);
+    /** Look up the axis identifier for a given facet type. */
+    public int axisIdxForFacet(String facetName) {
+        // TODO Where to add thid axis too.
+        return 0;
     }
 
 

http://dive4elements.wald.intevation.org