changeset 4392:0dace49f89a0

Merged
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 05 Nov 2012 09:18:59 +0100
parents 19ab9e23bc21 (diff) 0f93da769082 (current diff)
children 0b4926d93029
files flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties
diffstat 6 files changed, 29 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/extreme/ExtremeWQCurveGenerator.java	Sun Nov 04 23:24:16 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/extreme/ExtremeWQCurveGenerator.java	Mon Nov 05 09:18:59 2012 +0100
@@ -24,6 +24,9 @@
 import de.intevation.flys.jfree.JFreeUtil;
 import de.intevation.flys.jfree.StyledXYSeries;
 
+import de.intevation.flys.utils.ThemeUtil;
+
+
 /**
  * Generator for WQ fixing charts.
  * @author <a href="mailto:christian.lins@intevation.de">Christian Lins</a>
@@ -88,7 +91,7 @@
             return;
         }
 
-        XYSeries qwseries = new StyledXYSeries("meas", theme);
+        XYSeries qwseries = new StyledXYSeries(aaf.getFacetDescription(), theme);
         StyledSeriesBuilder.addPointsQW(qwseries, curve.getQs(), curve.getWs());
  
         addAxisSeries(qwseries, YAXIS.W.idx, visible);
@@ -119,12 +122,14 @@
                 maxQ); // end
 
         // Add marker from where on its extrapolated.
-        double[] qs = curve.getQs();
-        double extrapolateFrom = qs[qs.length-1];
+        if (ThemeUtil.parseShowExtraMark(theme)) {
+            double[] qs = curve.getQs();
+            double extrapolateFrom = qs[qs.length-1];
 
-        Marker m = new ValueMarker(extrapolateFrom);
-        m.setPaint(Color.black);
-        addDomainMarker(m);
+            Marker m = new ValueMarker(extrapolateFrom);
+            m.setPaint(Color.black);
+            addDomainMarker(m);
+        }
 
         addAxisSeries(series, 0, visible);
     }
@@ -139,6 +144,7 @@
                 context.getContextValue(CURRENT_KM));
     }
 
+
     @Override
     protected String getDefaultChartTitle() {
         return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT);
@@ -174,28 +180,6 @@
         }
 
         chart.addSubtitle(new TextTitle(defaultSubtitle));
-
-        StringBuilder buf = new StringBuilder();
-
-        // Add analysis periods as additional subtitle
-        FixAnalysisAccess access = new FixAnalysisAccess(artifact);
-        DateRange[] aperiods = access.getAnalysisPeriods();
-        buf.append(msg("fix.analysis.periods"));
-        buf.append(": ");
-        for(int n = 0; n < aperiods.length; n++) {
-            buf.append(
-                    Resources.format(
-                            context.getMeta(),
-                            I18N_CHART_SUBTITLE1,
-                            "",
-                            aperiods[n].getFrom(),
-                            aperiods[n].getTo()));
-            if(n + 1 < aperiods.length) {
-                buf.append("; ");
-            }
-        }
-
-        chart.addSubtitle(new TextTitle(buf.toString()));
     }
 
     @Override
@@ -207,21 +191,5 @@
     protected String getDefaultYAxisLabel(int pos) {
         return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT);
     }
-
-    @Override
-    protected ChartGenerator.YAxisWalker getYAxisWalker() {
-        return new YAxisWalker() {
-            @Override
-            public int length() {
-                return YAXIS.values().length;
-            }
-
-            @Override
-            public String getId(int idx) {
-                YAXIS[] yaxes = YAXIS.values();
-                return yaxes[idx].toString();
-            }
-        };
-    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java	Sun Nov 04 23:24:16 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java	Mon Nov 05 09:18:59 2012 +0100
@@ -121,6 +121,9 @@
     public final static String XPATH_BANDWIDTH =
             "/theme/field[@name='bandwidth']/@default";
 
+    /** XPATH to find showextramark field. */
+    public final static String XPATH_SHOWEXTRAMARK =
+            "/theme/field[@name='showextramark']/@default";
 
     /** Parse string to be boolean with default if empty or unrecognized. */
     public static boolean parseBoolean(String value, boolean defaultsTo) {
@@ -286,6 +289,15 @@
 
 
     /**
+     * Parses the attribute 'showextramark', defaults to false.
+     * @param theme The theme.
+     */
+    public static boolean parseShowExtraMark(Document theme) {
+        String show = XMLUtils.xpathString(theme, XPATH_SHOWEXTRAMARK, null);
+        return parseBoolean(show, false);
+    }
+
+    /**
      * Parses the attribute 'showpoints', defaults to false.
      * @param theme The theme.
      */
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Sun Nov 04 23:24:16 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Mon Nov 05 09:18:59 2012 +0100
@@ -462,6 +462,8 @@
 
     String extreme_wq_curve();
 
+    String showextramark();
+
     String fix_wq_curve();
 
     String fix_deltawt_curve();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Sun Nov 04 23:24:16 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Mon Nov 05 09:18:59 2012 +0100
@@ -225,6 +225,7 @@
 w_differences_export = Differences Export
 reference_curve_export = Reference Curve Export
 historical_discharge_export = Historical Discharge Curve Export
+showextramark = Show begin of extrapolation
 extreme_wq_curve = W/Q
 fix_wq_curve = W/Q
 fix_deltawt_curve = \u0394 W/t
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Sun Nov 04 23:24:16 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Mon Nov 05 09:18:59 2012 +0100
@@ -226,6 +226,7 @@
 w_differences_export = Differenzen Export
 reference_curve_export = Bezugslinien Export
 historical_discharge_export = Historische Abflusskurven Export
+showextramark = Zeige Anfang der Extrapolation
 extreme_wq_curve = W/Q
 fix_wq_curve = W/Q
 fix_deltawt_curve = \u0394 W/t
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Sun Nov 04 23:24:16 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Mon Nov 05 09:18:59 2012 +0100
@@ -226,6 +226,7 @@
 w_differences_export = Differences Export
 reference_curve_export = Reference Curve Export
 historical_discharge_export = Historical Discharge Curve Export
+showextramark = Show begin of extrapolation
 extreme_wq_curve = W/Q
 fix_wq_curve = W/Q
 fix_deltawt_curve = \u0394 W/t

http://dive4elements.wald.intevation.org