diff flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java @ 2758:b05faaa9099b

Create points for ref.curve in facet, handle these in generator. flys-artifacts/trunk@4493 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 24 May 2012 04:41:57 +0000
parents 664f97b6d48f
children de60d1dfdcdf
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java	Thu May 24 04:38:49 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java	Thu May 24 04:41:57 2012 +0000
@@ -1,5 +1,7 @@
 package de.intevation.flys.exports;
 
+import java.awt.geom.Point2D;
+
 import org.w3c.dom.Document;
 
 import org.apache.log4j.Logger;
@@ -167,6 +169,13 @@
                 visible,
                 YAXIS.W.idx);
         }
+        else if (name.equals(RELATIVE_POINT)) {
+            doPointOut(
+                (Point2D) artifactFacet.getData(context),
+                artifactFacet,
+                theme,
+                visible);
+        }
         else {
             logger.warn("Unknown facet name: " + name);
         }
@@ -206,6 +215,22 @@
         addAxisSeries(series, YAXIS.W.idx, visible);
     }
 
+    // TODO resolve duplicate in DurationCurveGenerator
+    protected void doPointOut(
+        Point2D point,
+        ArtifactAndFacet aandf,
+        Document theme,
+        boolean visible
+    ){
+        logger.debug("ReferenceCurveGenerator.doPointOut");
+
+        XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
+
+        series.add(point.getX(), point.getY());
+
+        addAxisSeries(series, YAXIS.W.idx, visible);
+    }
+
     protected void setAxisTickUnit(ValueAxis axis) {
         TickUnits units = new TickUnits();
         units.add(new NumberTickUnit(1d, Formatter.getWaterlevelW(context)));

http://dive4elements.wald.intevation.org