changeset 1849:5d5dd44d613e

Refactored, move doMainValueAnnotations to XYChartGenerator. flys-artifacts/trunk@3193 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 09 Nov 2011 13:06:08 +0000
parents 3918bd7eb4e1
children 0463e1f80bfd
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java
diffstat 3 files changed, 31 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Nov 09 12:55:13 2011 +0000
+++ b/flys-artifacts/ChangeLog	Wed Nov 09 13:06:08 2011 +0000
@@ -1,3 +1,13 @@
+2011-11-09  Felix Wolfsteller <felix.wolfsteller@intevation.de>
+
+	Move do*Annotation* (like mainvalue) in XYChartGenerator.
+
+	* src/main/java/de/intevation/flys/exports/XYChartGenerator.java
+	  (doAnnotations): New, moved from DischargeCurveGenerator.
+
+	* src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java
+	  (doMainValueAnnotations): Moved to superclass.
+
 2011-11-09  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
 	* src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java	Wed Nov 09 12:55:13 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java	Wed Nov 09 13:06:08 2011 +0000
@@ -130,8 +130,8 @@
                 || name.equals(COMPUTED_DISCHARGE_MAINVALUES_W)
                 || name.equals(MAINVALUES_W))
         {
-            doMainValueAnnotations(
-                nativeFacet.getData(artifact, context), facet, theme, visible);
+            doAnnotations((FLYSAnnotation) nativeFacet.getData(artifact, context),
+                facet, theme, visible);
         }
         else {
            logger.warn("DischargeCurveGenerator.doOut: Unknown facet name: " + name);
@@ -174,24 +174,5 @@
 
         addFirstAxisSeries(series, visible);
     }
-
-            
-
-    /**
-     * Store W MainValues as annotations for later plotting.
-     */
-    protected void doMainValueAnnotations(
-        Object   o,
-        Facet    facet,
-        Document theme,
-        boolean  visible
-    ) {
-        logger.debug("ComputedDischargeCurveGenerator set W MainValues.");
-
-        FLYSAnnotation fa = (FLYSAnnotation) o;
-        fa.setTheme(theme);
-        fa.setLabel(facet.getDescription());
-        addAnnotations(fa, visible);
-    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java	Wed Nov 09 12:55:13 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java	Wed Nov 09 13:06:08 2011 +0000
@@ -34,6 +34,8 @@
 
 import org.jfree.ui.RectangleInsets;
 
+import de.intevation.artifactdatabase.state.Facet;
+
 import de.intevation.flys.exports.ChartExportHelper;
 import de.intevation.flys.jfree.FLYSAnnotation;
 import de.intevation.flys.jfree.StickyAxisAnnotation;
@@ -642,5 +644,22 @@
 
         return new XYLineAndShapeRenderer();
     }
+
+
+    /**
+     * Store themed annotations like MainValues for later plotting.
+     */
+    protected void doAnnotations(
+        FLYSAnnotation annotations,
+        Facet facet,
+        Document theme,
+        boolean visible
+    ){
+        logger.debug("doAnnotations");
+
+        annotations.setTheme(theme);
+        annotations.setLabel(facet.getDescription());
+        addAnnotations(annotations, visible);
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org