changeset 3409:97ad960f5579

Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s) flys-artifacts/trunk@5062 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Christian Lins <christian.lins@intevation.de>
date Thu, 19 Jul 2012 12:59:56 +0000
parents 50d61a2494cb
children f382127df48e
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/HistoricalDischargeCurveGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java flys-artifacts/src/main/resources/messages.properties flys-artifacts/src/main/resources/messages_de.properties flys-artifacts/src/main/resources/messages_de_DE.properties flys-artifacts/src/main/resources/messages_en.properties
diffstat 16 files changed, 125 insertions(+), 241 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu Jul 19 12:55:45 2012 +0000
+++ b/flys-artifacts/ChangeLog	Thu Jul 19 12:59:56 2012 +0000
@@ -1,3 +1,24 @@
+2012-07-19	Christian Lins	<christian.lins@intevation.de>
+
+	* src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java,
+	  src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java,
+	  src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java,
+	  src/main/java/de/intevation/flys/exports/HistoricalDischargeCurveGenerator.java,
+	  src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java,
+	  src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java,
+	  src/main/java/de/intevation/flys/exports/ChartGenerator.java,
+	  src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java,
+	  src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java,
+	  src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java,
+	  src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java,
+	  src/main/resources/messages.properties,
+	  src/main/resources/messages_de_DE.properties,
+	  src/main/resources/messages_en.properties,
+	  src/main/resources/messages_de.properties:
+	  Add subtitle to Fix W/Q chart.
+	  Move addSubtitle() code from generators up to ChartGenerate which saves 
+	  a lot of duplicate code.
+
 2012-07-19	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/access/FixationArtifactAccess.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java	Thu Jul 19 12:55:45 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java	Thu Jul 19 12:59:56 2012 +0000
@@ -53,6 +53,7 @@
 import org.jfree.chart.axis.NumberAxis;
 import org.jfree.chart.plot.XYPlot;
 import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
+import org.jfree.chart.title.TextTitle;
 import org.jfree.data.Range;
 import org.jfree.data.general.Series;
 import org.jfree.data.xy.XYDataset;
@@ -570,13 +571,21 @@
 
 
     /**
-     * This method should be used by concrete subclasses to add subtitle to
-     * <i>chart</i>. <b>The method in this implementation is empty</b>.
+     * This method retrieves the chart subtitle by calling getChartSubtitle()
+     * and adds it as TextTitle to the chart.
+     * The default implementation of getChartSubtitle() returns the same
+     * as getDefaultChartSubtitle() which must be implemented by derived
+     * classes. If you want to add multiple subtitles to the chart override
+     * this method and add your subtitles manually.
      *
      * @param chart The JFreeChart chart object.
      */
     protected void addSubtitles(JFreeChart chart) {
-        // do nothing
+        String subtitle = getChartSubtitle();
+
+        if (subtitle != null && subtitle.length() > 0) {
+            chart.addSubtitle(new TextTitle(subtitle));
+        }
     }
 
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java	Thu Jul 19 12:55:45 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java	Thu Jul 19 12:59:56 2012 +0000
@@ -1,30 +1,23 @@
 package de.intevation.flys.exports;
 
-import java.util.List;
-import java.util.ArrayList;
-
-import org.apache.log4j.Logger;
-
-import org.w3c.dom.Document;
-
-import org.jfree.chart.JFreeChart;
-import org.jfree.chart.title.TextTitle;
-import org.jfree.data.xy.XYSeries;
-
 import de.intevation.artifactdatabase.state.ArtifactAndFacet;
 import de.intevation.artifactdatabase.state.Facet;
-
 import de.intevation.flys.artifacts.StaticWKmsArtifact;
 import de.intevation.flys.artifacts.WINFOArtifact;
-
 import de.intevation.flys.artifacts.model.FacetTypes;
+import de.intevation.flys.artifacts.model.WKms;
 import de.intevation.flys.artifacts.model.WQKms;
-import de.intevation.flys.artifacts.model.WKms;
-
 import de.intevation.flys.jfree.FLYSAnnotation;
 import de.intevation.flys.jfree.StickyAxisAnnotation;
 import de.intevation.flys.jfree.StyledXYSeries;
 
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jfree.data.xy.XYSeries;
+import org.w3c.dom.Document;
+
 
 /**
  * An OutGenerator that generates discharge curves.
@@ -80,16 +73,6 @@
 
 
     @Override
-    protected void addSubtitles(JFreeChart chart) {
-        String subtitle = getChartSubtitle();
-
-        if (subtitle != null && subtitle.length() > 0) {
-            chart.addSubtitle(new TextTitle(subtitle));
-        }
-    }
-
-
-    @Override
     protected String getDefaultYAxisLabel(int pos) {
         return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT);
     }
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java	Thu Jul 19 12:55:45 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java	Thu Jul 19 12:59:56 2012 +0000
@@ -21,12 +21,10 @@
 import java.util.List;
 
 import org.apache.log4j.Logger;
-import org.jfree.chart.JFreeChart;
 import org.jfree.chart.LegendItemCollection;
 import org.jfree.chart.annotations.XYBoxAnnotation;
 import org.jfree.chart.annotations.XYTextAnnotation;
 import org.jfree.chart.plot.XYPlot;
-import org.jfree.chart.title.TextTitle;
 import org.jfree.data.xy.XYSeries;
 import org.w3c.dom.Document;
 
@@ -128,12 +126,6 @@
     }
 
 
-    @Override
-    protected void addSubtitles(JFreeChart chart) {
-        String subtitle = getChartSubtitle();
-        chart.addSubtitle(new TextTitle(subtitle));
-    }
-
     /** Get color for hyk zones by their type (which is the name). */
     protected Paint colorForHYKZone(String zoneName) {
         if (zoneName.startsWith("R")) {
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java	Thu Jul 19 12:55:45 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java	Thu Jul 19 12:59:56 2012 +0000
@@ -1,30 +1,22 @@
 package de.intevation.flys.exports;
 
+import de.intevation.artifactdatabase.state.ArtifactAndFacet;
+import de.intevation.flys.artifacts.WINFOArtifact;
+import de.intevation.flys.artifacts.model.FacetTypes;
+import de.intevation.flys.artifacts.model.WQKms;
+import de.intevation.flys.jfree.Bounds;
+import de.intevation.flys.jfree.FLYSAnnotation;
+import de.intevation.flys.jfree.StyledXYSeries;
+import de.intevation.flys.model.Gauge;
+import de.intevation.flys.model.River;
+import de.intevation.flys.utils.FLYSUtils;
+
 import org.apache.log4j.Logger;
-
-
-import org.w3c.dom.Document;
-
-import org.jfree.chart.JFreeChart;
 import org.jfree.chart.axis.ValueAxis;
 import org.jfree.chart.plot.XYPlot;
 import org.jfree.data.Range;
 import org.jfree.data.xy.XYSeries;
-
-import de.intevation.artifactdatabase.state.ArtifactAndFacet;
-
-import de.intevation.flys.artifacts.model.FacetTypes;
-import de.intevation.flys.model.Gauge;
-import de.intevation.flys.model.River;
-
-import de.intevation.flys.artifacts.WINFOArtifact;
-
-import de.intevation.flys.artifacts.model.WQKms;
-
-import de.intevation.flys.utils.FLYSUtils;
-import de.intevation.flys.jfree.Bounds;
-import de.intevation.flys.jfree.FLYSAnnotation;
-import de.intevation.flys.jfree.StyledXYSeries;
+import org.w3c.dom.Document;
 
 
 /**
@@ -87,17 +79,12 @@
     }
 
 
+    /**
+     * Returns always null to suppress subtitles.
+     */
     @Override
     protected String getDefaultChartTitle() {
-        return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT);
-    }
-
-
-    /**
-     * Empty (suppress subtitle).
-     */
-    @Override
-    protected void addSubtitles(JFreeChart chart) {
+        return null;
     }
 
 
@@ -125,6 +112,7 @@
     }
 
 
+    @Override
     public void doOut(
         ArtifactAndFacet artifactFacet,
         Document         theme,
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java	Thu Jul 19 12:55:45 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java	Thu Jul 19 12:59:56 2012 +0000
@@ -1,28 +1,22 @@
 package de.intevation.flys.exports;
 
+import de.intevation.artifactdatabase.state.ArtifactAndFacet;
+import de.intevation.flys.artifacts.model.FacetTypes;
+import de.intevation.flys.artifacts.model.WQDay;
+import de.intevation.flys.jfree.Bounds;
+import de.intevation.flys.jfree.FLYSAnnotation;
+import de.intevation.flys.jfree.StyledXYSeries;
+
 import java.awt.Font;
 import java.awt.geom.Point2D;
 
-import org.w3c.dom.Document;
-
 import org.apache.log4j.Logger;
-
-import org.jfree.chart.JFreeChart;
 import org.jfree.chart.axis.NumberAxis;
 import org.jfree.chart.axis.ValueAxis;
 import org.jfree.chart.plot.XYPlot;
-import org.jfree.chart.title.TextTitle;
 import org.jfree.data.Range;
 import org.jfree.data.xy.XYSeries;
-
-import de.intevation.artifactdatabase.state.ArtifactAndFacet;
-
-import de.intevation.flys.artifacts.model.FacetTypes;
-import de.intevation.flys.artifacts.model.WQDay;
-
-import de.intevation.flys.jfree.Bounds;
-import de.intevation.flys.jfree.FLYSAnnotation;
-import de.intevation.flys.jfree.StyledXYSeries;
+import org.w3c.dom.Document;
 
 
 /**
@@ -111,16 +105,6 @@
 
 
     @Override
-    protected void addSubtitles(JFreeChart chart) {
-        String subtitle = getChartSubtitle();
-
-        if (subtitle != null && subtitle.length() > 0) {
-            chart.addSubtitle(new TextTitle(subtitle));
-        }
-    }
-
-
-    @Override
     protected String getDefaultXAxisLabel() {
         return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT);
     }
@@ -257,7 +241,7 @@
             int  day = wqdays.getDay(i);
             double w = wqdays.getW(i);
 
-            series.add((double) day, w);
+            series.add(day, w);
         }
 
         addAxisSeries(series, YAXIS.W.idx, visible);
@@ -300,7 +284,7 @@
             int  day = wqdays.getDay(i);
             double q = wqdays.getQ(i);
 
-            series.add((double) day, q);
+            series.add(day, q);
         }
 
         addAxisSeries(series, YAXIS.Q.idx, visible);
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/HistoricalDischargeCurveGenerator.java	Thu Jul 19 12:55:45 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/HistoricalDischargeCurveGenerator.java	Thu Jul 19 12:59:56 2012 +0000
@@ -1,22 +1,6 @@
 package de.intevation.flys.exports;
 
-import java.util.Date;
-
-import org.w3c.dom.Document;
-
-import org.apache.log4j.Logger;
-
-import org.jfree.chart.JFreeChart;
-import org.jfree.chart.title.TextTitle;
-
-import org.jfree.data.general.SeriesException;
-import org.jfree.data.time.Day;
-import org.jfree.data.time.RegularTimePeriod;
-import org.jfree.data.time.TimeSeries;
-import org.jfree.data.time.TimeSeriesCollection;
-
 import de.intevation.artifactdatabase.state.ArtifactAndFacet;
-
 import de.intevation.flys.artifacts.FLYSArtifact;
 import de.intevation.flys.artifacts.model.FacetTypes;
 import de.intevation.flys.artifacts.model.HistoricalWQTimerange;
@@ -25,6 +9,16 @@
 import de.intevation.flys.jfree.StyledTimeSeries;
 import de.intevation.flys.utils.FLYSUtils;
 
+import java.util.Date;
+
+import org.apache.log4j.Logger;
+import org.jfree.data.general.SeriesException;
+import org.jfree.data.time.Day;
+import org.jfree.data.time.RegularTimePeriod;
+import org.jfree.data.time.TimeSeries;
+import org.jfree.data.time.TimeSeriesCollection;
+import org.w3c.dom.Document;
+
 
 /**
  * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
@@ -95,19 +89,6 @@
     }
 
 
-    /**
-     * Empty (suppress subtitle).
-     */
-    @Override
-    protected void addSubtitles(JFreeChart chart) {
-        String subtitle = getChartSubtitle();
-
-        if (subtitle != null && subtitle.length() > 0) {
-            chart.addSubtitle(new TextTitle(subtitle));
-        }
-    }
-
-
     @Override
     protected String getDefaultXAxisLabel() {
         return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL);
@@ -127,6 +108,7 @@
     }
 
 
+    @Override
     public void doOut(
         ArtifactAndFacet artifactFacet,
         Document         theme,
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Thu Jul 19 12:55:45 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Thu Jul 19 12:59:56 2012 +0000
@@ -1,35 +1,26 @@
 package de.intevation.flys.exports;
 
-import org.apache.log4j.Logger;
-
-import org.jfree.chart.JFreeChart;
-import org.jfree.chart.axis.NumberAxis;
-import org.jfree.chart.title.TextTitle;
-import org.jfree.chart.axis.ValueAxis;
-import org.jfree.chart.plot.XYPlot;
-import org.jfree.data.xy.XYSeries;
-
-import org.w3c.dom.Document;
-
 import de.intevation.artifactdatabase.state.ArtifactAndFacet;
 import de.intevation.artifactdatabase.state.Facet;
-
 import de.intevation.flys.artifacts.FLYSArtifact;
-
+import de.intevation.flys.artifacts.geom.Lines;
 import de.intevation.flys.artifacts.model.AreaFacet;
 import de.intevation.flys.artifacts.model.FacetTypes;
 import de.intevation.flys.artifacts.model.WKms;
 import de.intevation.flys.artifacts.model.WQKms;
-
 import de.intevation.flys.jfree.FLYSAnnotation;
 import de.intevation.flys.jfree.StyledAreaSeriesCollection;
 import de.intevation.flys.jfree.StyledXYSeries;
-
+import de.intevation.flys.utils.DataUtil;
 import de.intevation.flys.utils.FLYSUtils;
-import de.intevation.flys.utils.DataUtil;
 import de.intevation.flys.utils.ThemeUtil;
 
-import de.intevation.flys.artifacts.geom.Lines;
+import org.apache.log4j.Logger;
+import org.jfree.chart.axis.NumberAxis;
+import org.jfree.chart.axis.ValueAxis;
+import org.jfree.chart.plot.XYPlot;
+import org.jfree.data.xy.XYSeries;
+import org.w3c.dom.Document;
 
 
 /**
@@ -189,20 +180,6 @@
 
 
     /**
-     * Add (internationalized) subtitle to chart.
-     * @see getChartSubtitleKey
-     */
-    @Override
-    protected void addSubtitles(JFreeChart chart) {
-        String subtitle = getChartSubtitle();
-
-        if (subtitle != null && subtitle.length() > 0) {
-            chart.addSubtitle(new TextTitle(subtitle));
-        }
-    }
-
-
-    /**
      * Get internationalized label for the x axis.
      */
     @Override
@@ -316,6 +293,7 @@
      * @param artifactAndFacet current facet and artifact.
      * @param attr  theme for facet
      */
+    @Override
     public void doOut(
         ArtifactAndFacet artifactAndFacet,
         Document         attr,
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java	Thu Jul 19 12:55:45 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java	Thu Jul 19 12:59:56 2012 +0000
@@ -1,33 +1,23 @@
 package de.intevation.flys.exports;
 
-import java.awt.geom.Point2D;
-
-import org.w3c.dom.Document;
-
-import org.apache.log4j.Logger;
-
-import org.jfree.chart.JFreeChart;
-
-import org.jfree.chart.title.TextTitle;
-
-import org.jfree.data.xy.XYSeries;
-
-import org.jfree.chart.axis.ValueAxis;
-import org.jfree.chart.axis.NumberAxis;
-import org.jfree.chart.axis.NumberTickUnit;
-import org.jfree.chart.axis.TickUnits;
-
 import de.intevation.artifactdatabase.state.ArtifactAndFacet;
-
 import de.intevation.flys.artifacts.model.FacetTypes;
 import de.intevation.flys.artifacts.model.WW;
 import de.intevation.flys.artifacts.model.WW.ApplyFunctionIterator;
 import de.intevation.flys.artifacts.model.WWAxisTypes;
-
+import de.intevation.flys.jfree.FLYSAnnotation;
 import de.intevation.flys.jfree.StyledXYSeries;
-import de.intevation.flys.jfree.FLYSAnnotation;
+import de.intevation.flys.utils.Formatter;
 
-import de.intevation.flys.utils.Formatter;
+import java.awt.geom.Point2D;
+
+import org.apache.log4j.Logger;
+import org.jfree.chart.axis.NumberAxis;
+import org.jfree.chart.axis.NumberTickUnit;
+import org.jfree.chart.axis.TickUnits;
+import org.jfree.chart.axis.ValueAxis;
+import org.jfree.data.xy.XYSeries;
+import org.w3c.dom.Document;
 
 /**
  * An OutGenerator that generates reference curves.
@@ -102,15 +92,6 @@
     }
 
 
-    @Override
-    protected void addSubtitles(JFreeChart chart) {
-        String subtitle = getChartSubtitle();
-
-        if (subtitle != null && subtitle.length() > 0) {
-            chart.addSubtitle(new TextTitle(subtitle));
-        }
-    }
-
     protected boolean getInCm(int index) {
         Object obj = context.getContextValue("reference.curve.axis.scale");
         return obj instanceof WWAxisTypes && ((WWAxisTypes)obj).getInCm(index);
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java	Thu Jul 19 12:55:45 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java	Thu Jul 19 12:59:56 2012 +0000
@@ -1,15 +1,12 @@
 package de.intevation.flys.exports;
 
-import org.apache.log4j.Logger;
-
-import org.jfree.chart.title.TextTitle;
-
-import org.jfree.chart.JFreeChart;
-import org.jfree.chart.plot.XYPlot;
-
 import de.intevation.flys.artifacts.model.FacetTypes;
 import de.intevation.flys.artifacts.model.WKms;
 
+import org.apache.log4j.Logger;
+import org.jfree.chart.JFreeChart;
+import org.jfree.chart.plot.XYPlot;
+
 
 /**
  * An OutGenerator that generates w differences curves.
@@ -86,21 +83,6 @@
 
 
     /**
-     * Add (internationalized) subtitle to chart.
-     * Overridden to avoid trying to access the range of masterartifact.
-     * @see getChartSubtitleKey
-     */
-    @Override
-    protected void addSubtitles(JFreeChart chart) {
-        String subtitle = getChartSubtitle();
-
-        if (subtitle != null && subtitle.length() > 0) {
-            chart.addSubtitle(new TextTitle(subtitle));
-        }
-    }
-
-
-    /**
      *
      */
     @Override
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java	Thu Jul 19 12:55:45 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java	Thu Jul 19 12:59:56 2012 +0000
@@ -28,9 +28,7 @@
 import javax.xml.xpath.XPathConstants;
 
 import org.apache.log4j.Logger;
-import org.jfree.chart.JFreeChart;
 import org.jfree.chart.annotations.XYTextAnnotation;
-import org.jfree.chart.title.TextTitle;
 import org.jfree.data.time.Day;
 import org.jfree.data.time.Month;
 import org.jfree.data.time.RegularTimePeriod;
@@ -118,27 +116,17 @@
     @Override
     protected String getDefaultChartSubtitle() {
         FixAnalysisAccess access = new FixAnalysisAccess(artifact);
-        DateRange range = access.getDateRange();
+        DateRange dateRange = access.getDateRange();
+        DateRange refRange  = access.getReferencePeriod();
         return Resources.format(
                 context.getMeta(),
                 I18N_CHART_SUBTITLE,
                 "",
                 access.getRiver(),
-                range.getFrom(),
-                range.getTo());
-    }
-
-
-    /**
-     * Empty (suppress subtitle).
-     */
-    @Override
-    protected void addSubtitles(JFreeChart chart) {
-        String subtitle = getChartSubtitle();
-
-        if (subtitle != null && subtitle.length() > 0) {
-            chart.addSubtitle(new TextTitle(subtitle));
-        }
+                dateRange.getFrom(),
+                dateRange.getTo(),
+                refRange.getFrom(),
+                refRange.getTo());
     }
 
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java	Thu Jul 19 12:55:45 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java	Thu Jul 19 12:59:56 2012 +0000
@@ -214,16 +214,17 @@
     @Override
     protected String getDefaultChartSubtitle() {
         FixAnalysisAccess access = new FixAnalysisAccess(artifact);
-        DateRange range = access.getDateRange();
-        String subtitle = Resources.format(
+        DateRange dateRange = access.getDateRange();
+        DateRange refRange  = access.getReferencePeriod();
+        return Resources.format(
                 context.getMeta(),
                 I18N_CHART_SUBTITLE,
-                null,
+                "",
                 access.getRiver(),
-                range.getFrom(),
-                range.getTo());
-        logger.debug("getDefaultChartSubtitle: " + subtitle);
-        return subtitle;
+                dateRange.getFrom(),
+                dateRange.getTo(),
+                refRange.getFrom(),
+                refRange.getTo());
     }
 
     @Override
--- a/flys-artifacts/src/main/resources/messages.properties	Thu Jul 19 12:55:45 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages.properties	Thu Jul 19 12:59:56 2012 +0000
@@ -139,10 +139,7 @@
 
 chart.normalized.reference.curve.title = Reduced Reference Curve
 
-chart.fixings.derivedcurve.title = Ableitungskurve an Kilometer {0}
-chart.fixings.deltawt.title = Abweichungen von der Ausgleichskurve an Kilometer {0}
-chart.fixings.analysis.title = Längsschnitt an Kilometer {0}
-chart.fixings.wq.title = Fixierungsanalyse an Kilometer {0}
+chart.fixings.wq.subtitle=River: {0}; Range: {1,date,short} to {2,date,short}; Reference period: {3,date,short} to {4,date,short}
 
 chart.sq_relation.xaxis.label = Discharge [m\u00b3/s]
 chart.sq_relation.yaxis.label = Transport [kg/s]
@@ -343,7 +340,7 @@
 fix.reference.deviation=Reference deviation
 
 chart.fix.deltawt.title=Difference from compensating curve at kilometer {0}
-chart.fix.deltawt.subtitle=Water: {0}; Period:  {1,date,short} to {2,date,short}
+chart.fix.deltawt.subtitle=Water: {0}; Period:  {1,date,short} to {2,date,short}; Reference period: {3,date,short} bis {4,date,short}
 chart.fix.deltawt.xaxis.label=Date
 chart.fix.deltawt.yaxis.label=\u0394 W(t) [cm]
 
--- a/flys-artifacts/src/main/resources/messages_de.properties	Thu Jul 19 12:55:45 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_de.properties	Thu Jul 19 12:59:56 2012 +0000
@@ -344,11 +344,11 @@
 fix.reference.deviation=Abweichung im Bezugszeitraum
 
 chart.fix.deltawt.title=Abweichungen von der Ausgleichskurve an Kilometer {0}
-chart.fix.deltawt.subtitle=Gewässer: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}
+chart.fix.deltawt.subtitle=Gewässer: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}; Bezugszeitraum: {3,date,short} bis {4,date,short}
 chart.fix.deltawt.xaxis.label=Datum
 chart.fix.deltawt.yaxis.label=\u0394 W(t) [cm]
 
-chart.fixings.wq.subtitle=Gewässer: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}
+chart.fixings.wq.subtitle=Gewässer: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}; Bezugszeitraum: {3,date,short} bis {4,date,short}
 
 chart.fixings.longitudinalsection.title=Längsschnitt
 
--- a/flys-artifacts/src/main/resources/messages_de_DE.properties	Thu Jul 19 12:55:45 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_de_DE.properties	Thu Jul 19 12:59:56 2012 +0000
@@ -342,11 +342,11 @@
 fix.reference.deviation=Abweichung im Bezugszeitraum
 
 chart.fix.deltawt.title=Abweichungen von der Ausgleichskurve an Kilometer {0}
-chart.fix.deltawt.subtitle=Gewässer: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}
+chart.fix.deltawt.subtitle=Gewässer: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}; Bezugszeitraum: {3,date,short} bis {4,date,short}
 chart.fix.deltawt.xaxis.label=Datum
 chart.fix.deltawt.yaxis.label=\u0394 W(t) [cm]
 
-chart.fixings.wq.subtitle=Gewässer: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}
+chart.fixings.wq.subtitle=Gewässer: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}; Bezugszeitraum: {3,date,short} bis {4,date,short}
 
 chart.fixings.longitudinalsection.title=Längsschnitt
 
--- a/flys-artifacts/src/main/resources/messages_en.properties	Thu Jul 19 12:55:45 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_en.properties	Thu Jul 19 12:59:56 2012 +0000
@@ -126,9 +126,7 @@
 chart.reference.curve.title = Reference Curve
 chart.reference.curve.subtitle = {0}
 
-chart.fixings.derivedcurve.title = Ableitungskurve an Kilometer {0}
-chart.fixings.analysis.title = Längsschnitt an Kilometer {0}
-chart.fixings.wq.title = Fixierungsanalyse an Kilometer {0}
+chart.fixings.wq.subtitle=River: {0}; Range: {1,date,short} to {2,date,short}; Reference period: {3,date,short} to {4,date,short}
 
 chart.reference.curve.x.axis.in.cm = Reference Gauge(s) [cm]
 chart.reference.curve.x.axis.in.m = Reference Station(s) [NN + m]
@@ -342,7 +340,7 @@
 fix.reference.deviation=Reference deviation
 
 chart.fix.deltawt.title=Difference from compensating curve at kilometer {0}
-chart.fix.deltawt.subtitle=Water: {0}; Period:  {1,date,short} to {2,date,short}
+chart.fix.deltawt.subtitle=Water: {0}; Period:  {1,date,short} to {2,date,short}; Reference period: {3,date,short} bis {4,date,short}
 chart.fix.deltawt.xaxis.label=Date
 chart.fix.deltawt.yaxis.label=\u0394 W(t) [cm]
 

http://dive4elements.wald.intevation.org