diff flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java @ 1712:7e19449d7826

#253 Modified the title creation of chart curves - titles will now equal the Facet's description. flys-artifacts/trunk@2984 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 17 Oct 2011 10:47:36 +0000
parents 6e59208839ae
children 62983d0ced51
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Mon Oct 17 08:45:26 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Mon Oct 17 10:47:36 2011 +0000
@@ -259,13 +259,13 @@
         }
 
         if (name.equals(LONGITUDINAL_W)) {
-            doWOut((WQKms) f.getData(artifact, context), attr, visible);
+            doWOut((WQKms) f.getData(artifact, context), facet, attr, visible);
         }
         else if (name.equals(LONGITUDINAL_Q)) {
-            doQOut((WQKms) f.getData(artifact, context), attr, visible);
+            doQOut((WQKms) f.getData(artifact, context), facet, attr, visible);
         }
         else if (name.equals(LONGITUDINAL_ANNOTATION)) {
-            doAnnotationsOut(f.getData(artifact, context), attr, visible);
+            doAnnotationsOut(f.getData(artifact, context), facet, attr,visible);
         }
         else {
             logger.warn("Unknown facet name: " + name);
@@ -278,13 +278,23 @@
      * Register annotations available for the diagram.
      *
      * @param o     list of annotations (data of facet).
+     * @param facet The facet. This facet does NOT support any data objects. Use
+     * FLYSArtifact.getNativeFacet() instead to retrieve a Facet which supports
+     * data.
      * @param theme yet ignored.
+     * @param visible The visibility of the annotations.
      */
-    protected void doAnnotationsOut(Object o, Document theme, boolean visible) {
+    protected void doAnnotationsOut(
+        Object   o,
+        Facet    facet,
+        Document theme,
+        boolean  visible
+    ) {
         logger.debug("LongitudinalSectionGenerator.doAnnotationsOut");
 
         // Add all annotations in list o to our annotation pool.
         FLYSAnnotation fa = (FLYSAnnotation) o;
+        fa.setLabel(facet.getDescription());
         addAnnotations(fa, visible);
     }
 
@@ -293,12 +303,21 @@
      * Process the output for W facets in a longitudinal section curve.
      *
      * @param wqkms An array of WQKms values.
+     * @param facet The facet. This facet does NOT support any data objects. Use
+     * FLYSArtifact.getNativeFacet() instead to retrieve a Facet which supports
+     * data.
      * @param theme The theme that contains styling information.
+     * @param visible The visibility of the curve.
      */
-    protected void doWOut(WQKms wqkms, Document theme, boolean visible) {
+    protected void doWOut(
+        WQKms    wqkms,
+        Facet    facet,
+        Document theme,
+        boolean  visible
+    ) {
         logger.debug("LongitudinalSectionGenerator.doWOut");
 
-        XYSeries series = new StyledXYSeries(getSeriesName(wqkms, "W"), theme);
+        XYSeries series = new StyledXYSeries(facet.getDescription(), theme);
 
         int size = wqkms.size();
 
@@ -318,12 +337,21 @@
      * Process the output for Q facets in a longitudinal section curve.
      *
      * @param wqkms An array of WQKms values.
+     * @param facet The facet. This facet does NOT support any data objects. Use
+     * FLYSArtifact.getNativeFacet() instead to retrieve a Facet which supports
+     * data.
      * @param theme The theme that contains styling information.
+     * @param visible The visibility of the curve.
      */
-    protected void doQOut(WQKms wqkms, Document theme, boolean visible) {
+    protected void doQOut(
+        WQKms    wqkms,
+        Facet    facet,
+        Document theme,
+        boolean  visible
+    ) {
         logger.debug("LongitudinalSectionGenerator.doQOut");
 
-        XYSeries series = new StyledXYSeries(getSeriesName(wqkms, "Q"), theme);
+        XYSeries series = new StyledXYSeries(facet.getDescription(), theme);
 
         int size = wqkms.size();
 

http://dive4elements.wald.intevation.org