[PATCH] Further subtitle cleanup (including obsolete classes using them)

Wald Commits scm-commit at wald.intevation.org
Wed Oct 8 15:41:50 CEST 2014


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1412775707 -7200
# Node ID caba2157ed97fa544751a57c1ed6d3d6d974e16f
# Parent  47e96ce9bd790aede566b0c5c534770bfd6a2ec2
Further subtitle cleanup (including obsolete classes using them).

diff -r 47e96ce9bd79 -r caba2157ed97 artifacts/doc/conf/generators/discharge-diagrams.xml
--- a/artifacts/doc/conf/generators/discharge-diagrams.xml	Wed Oct 08 12:27:53 2014 +0200
+++ b/artifacts/doc/conf/generators/discharge-diagrams.xml	Wed Oct 08 15:41:47 2014 +0200
@@ -72,6 +72,9 @@
       injectors="org.dive4elements.river.exports.injector.KmFromLocationInjector,org.dive4elements.river.exports.injector.PNPInjector"
       converter="org.dive4elements.river.exports.DiagramAttributes">
     <title key="chart.sq_relation_a.title" default=""/>
+    <subtitle key="chart.discharge.curve.subtitle" default="-">
+        <arg expr="artifact.river"/>
+    </subtitle>
     &sqrelation-defaults;
   </output-generator>
 
@@ -80,6 +83,9 @@
       injectors="org.dive4elements.river.exports.injector.KmFromLocationInjector,org.dive4elements.river.exports.injector.PNPInjector"
       converter="org.dive4elements.river.exports.DiagramAttributes">
     <title key="chart.sq_relation_b.title" default=""/>
+    <subtitle key="chart.discharge.curve.subtitle" default="-">
+        <arg expr="artifact.river"/>
+    </subtitle>
     &sqrelation-defaults;
   </output-generator>
 
@@ -88,6 +94,9 @@
       injectors="org.dive4elements.river.exports.injector.KmFromLocationInjector,org.dive4elements.river.exports.injector.PNPInjector"
       converter="org.dive4elements.river.exports.DiagramAttributes">
     <title key="chart.sq_relation_c.title" default=""/>
+    <subtitle key="chart.discharge.curve.subtitle" default="-">
+        <arg expr="artifact.river"/>
+    </subtitle>
     &sqrelation-defaults;
   </output-generator>
 
@@ -96,6 +105,9 @@
       injectors="org.dive4elements.river.exports.injector.KmFromLocationInjector,org.dive4elements.river.exports.injector.PNPInjector"
       converter="org.dive4elements.river.exports.DiagramAttributes">
     <title key="chart.sq_relation_d.title" default=""/>
+    <subtitle key="chart.discharge.curve.subtitle" default="-">
+        <arg expr="artifact.river"/>
+    </subtitle>
     &sqrelation-defaults;
   </output-generator>
 
@@ -104,6 +116,9 @@
       injectors="org.dive4elements.river.exports.injector.KmFromLocationInjector,org.dive4elements.river.exports.injector.PNPInjector"
       converter="org.dive4elements.river.exports.DiagramAttributes">
     <title key="chart.sq_relation_e.title" default=""/>
+    <subtitle key="chart.discharge.curve.subtitle" default="-">
+        <arg expr="artifact.river"/>
+    </subtitle>
     &sqrelation-defaults;
   </output-generator>
 
@@ -112,20 +127,31 @@
       injectors="org.dive4elements.river.exports.injector.KmFromLocationInjector,org.dive4elements.river.exports.injector.PNPInjector"
       converter="org.dive4elements.river.exports.DiagramAttributes">
     <title key="chart.sq_relation_f.title" default=""/>
+    <subtitle key="chart.discharge.curve.subtitle" default="-">
+        <arg expr="artifact.river"/>
+    </subtitle>
     &sqrelation-defaults;
   </output-generator>
+
   <output-generator names="sq_relation_g,sq_relation_g_chartinfo"
       class="org.dive4elements.river.exports.DischargeGenerator"
       injectors="org.dive4elements.river.exports.injector.KmFromLocationInjector,org.dive4elements.river.exports.injector.PNPInjector"
       converter="org.dive4elements.river.exports.DiagramAttributes">
     <title key="chart.sq_relation_f.title" default=""/>
+    <subtitle key="chart.discharge.curve.subtitle" default="-">
+        <arg expr="artifact.river"/>
+    </subtitle>
     &sqrelation-defaults;
   </output-generator>
+
   <output-generator names="sq_overview,sq_overview_chartinfo"
       class="org.dive4elements.river.exports.DischargeGenerator"
       injectors="org.dive4elements.river.exports.injector.KmFromLocationInjector,org.dive4elements.river.exports.injector.PNPInjector"
       converter="org.dive4elements.river.exports.DiagramAttributes">
     <title key="chart.sq_relation_f.title" default=""/>
+    <subtitle key="chart.discharge.curve.subtitle" default="-">
+        <arg expr="artifact.river"/>
+    </subtitle>
     &sqrelation-defaults;
   </output-generator>
 </discharge-diagrams>
diff -r 47e96ce9bd79 -r caba2157ed97 artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeWQCurveGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeWQCurveGenerator.java	Wed Oct 08 12:27:53 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
- * Software engineering by Intevation GmbH
- *
- * This file is Free Software under the GNU AGPL (>=v3)
- * and comes with ABSOLUTELY NO WARRANTY! Check out the
- * documentation coming with Dive4Elements River for details.
- */
-
-package org.dive4elements.river.exports;
-
-import org.apache.log4j.Logger;
-import org.jfree.data.xy.XYSeries;
-
-import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
-import org.dive4elements.river.artifacts.D4EArtifact;
-import org.dive4elements.river.artifacts.access.HistoricalDischargeAccess;
-import org.dive4elements.river.artifacts.model.FacetTypes;
-import org.dive4elements.river.artifacts.model.Timerange;
-import org.dive4elements.river.artifacts.model.WQKms;
-
-import org.dive4elements.river.jfree.RiverAnnotation;
-import org.dive4elements.river.jfree.StyledValueMarker;
-import org.dive4elements.river.jfree.StyledXYSeries;
-import org.dive4elements.river.themes.ThemeDocument;
-import org.dive4elements.river.utils.RiverUtils;
-
-
-/**
- * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
- */
-public class HistoricalDischargeWQCurveGenerator
-extends      XYChartGenerator
-implements   FacetTypes {
-
-    /** Private log. */
-    private static Logger log = Logger
-        .getLogger(HistoricalDischargeWQCurveGenerator.class);
-
-    public static final String I18N_CHART_TITLE = "chart.historical.discharge.wq.title";
-
-    public static final String I18N_CHART_SUBTITLE = "chart.historical.discharge.wq.subtitle";
-
-    public static final String I18N_XAXIS_LABEL = "chart.historical.discharge.wq.xaxis.label";
-
-    public static final String I18N_YAXIS_LABEL = "chart.historical.discharge.wq.yaxis.label";
-
-    /** One Y-Axis only, in this chart. */
-    public static enum YAXIS {
-        W(0);
-
-        protected int idx;
-
-        private YAXIS(int c) {
-            idx = c;
-        }
-    }
-
-    @Override
-    protected 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();
-            }
-        };
-    }
-
-    @Override
-    protected String getDefaultChartTitle() {
-        return msg(I18N_CHART_TITLE, I18N_CHART_TITLE);
-    }
-
-    @Override
-    protected String getDefaultChartSubtitle() {
-        D4EArtifact flys = (D4EArtifact) master;
-        Timerange evalTime = new HistoricalDischargeAccess(flys)
-            .getEvaluationTimerange();
-
-        Object[] args = new Object[] { RiverUtils.getReferenceGaugeName(flys),
-            evalTime.getStart(), evalTime.getEnd() };
-
-        return msg(I18N_CHART_SUBTITLE, "", args);
-    }
-
-    @Override
-    protected String getDefaultXAxisLabel() {
-        return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL);
-    }
-
-    @Override
-    protected String getDefaultYAxisLabel(int pos) {
-        if (pos == 0) {
-            return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL);
-        }
-        else {
-            return "NO TITLE FOR Y AXIS: " + pos;
-        }
-    }
-
-    @Override
-    public void doOut(ArtifactAndFacet artifactFacet, ThemeDocument theme,
-        boolean visible) {
-        String name = artifactFacet.getFacetName();
-        log.debug("HistoricalDischargeWQCurveGenerator.doOut: " + name);
-        log.debug("Theme description is: "
-            + artifactFacet.getFacetDescription());
-
-        if (name.equals(HISTORICAL_DISCHARGE_WQ_Q)) {
-            doHistoricalDischargeOutQ(
-                (D4EArtifact) artifactFacet.getArtifact(),
-                artifactFacet.getData(context),
-                artifactFacet.getFacetDescription(), theme, visible);
-        }
-        else if (name.equals(HISTORICAL_DISCHARGE_WQ_W)) {
-            doHistoricalDischargeOutW(
-                (D4EArtifact) artifactFacet.getArtifact(),
-                artifactFacet.getData(context),
-                artifactFacet.getFacetDescription(), theme, visible);
-        }
-        else if (name.equals(HISTORICAL_DISCHARGE_WQ_CURVE) ||
-                 name.equals(DISCHARGE_CURVE) ||
-                 name.equals(GAUGE_DISCHARGE_CURVE)) {
-            doHistoricalDischargeCurveOut(
-                (D4EArtifact) artifactFacet.getArtifact(),
-                artifactFacet.getData(context),
-                artifactFacet.getFacetDescription(), theme, visible);
-        }
-        else if (FacetTypes.IS.MANUALPOINTS(name)) {
-            doPoints(artifactFacet.getData(context), artifactFacet, theme,
-                visible, YAXIS.W.idx);
-        }
-        else if (name.equals(MAINVALUES_W) || name.equals(MAINVALUES_Q)) {
-            doAnnotations((RiverAnnotation)
-                artifactFacet.getData(context), artifactFacet, theme, visible);
-        }
-        else {
-            log.warn("doOut(): unknown facet name: " + name);
-            return;
-        }
-    }
-
-    protected void doHistoricalDischargeOutQ(D4EArtifact artifact,
-        Object data, String desc, ThemeDocument theme, boolean visible) {
-        double value = Double.valueOf(data.toString());
-        addDomainMarker(new StyledValueMarker(value, theme), visible);
-    }
-
-    protected void doHistoricalDischargeOutW(D4EArtifact artifact,
-        Object data, String desc, ThemeDocument theme, boolean visible) {
-        double value = Double.valueOf(data.toString());
-        addValueMarker(new StyledValueMarker(value, theme), visible);
-    }
-
-    protected void doHistoricalDischargeCurveOut(D4EArtifact artifact,
-        Object data, String desc, ThemeDocument theme, boolean visible) {
-        XYSeries series = new StyledXYSeries(desc, theme);
-        StyledSeriesBuilder.addPointsQW(series, (WQKms) data);
-
-        addAxisSeries(series, YAXIS.W.idx, visible);
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
diff -r 47e96ce9bd79 -r caba2157ed97 artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeWQCurveInfoGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeWQCurveInfoGenerator.java	Wed Oct 08 12:27:53 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
- * Software engineering by Intevation GmbH
- *
- * This file is Free Software under the GNU AGPL (>=v3)
- * and comes with ABSOLUTELY NO WARRANTY! Check out the
- * documentation coming with Dive4Elements River for details.
- */
-
-package org.dive4elements.river.exports;
-
-
-/**
- * A ChartInfoGenerator that generates meta information for specific
- * historical discharge curves.
- *
- * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
- */
-public class HistoricalDischargeWQCurveInfoGenerator
-extends      ChartInfoGenerator
-{
-    public HistoricalDischargeWQCurveInfoGenerator() {
-        super(new HistoricalDischargeWQCurveGenerator());
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r 47e96ce9bd79 -r caba2157ed97 artifacts/src/main/resources/messages.properties
--- a/artifacts/src/main/resources/messages.properties	Wed Oct 08 12:27:53 2014 +0200
+++ b/artifacts/src/main/resources/messages.properties	Wed Oct 08 15:41:47 2014 +0200
@@ -190,7 +190,6 @@
 chart.historical.discharge.yaxis.second.label = Q [m\u00b3/s]
 chart.historical.discharge.yaxis.label = W [cm]
 chart.historical.discharge.wq.title = Discharge Curves
-chart.historical.discharge.wq.subtitle = Gauge {0}
 chart.historical.discharge.wq.xaxis.label = Q [m\u00b3/s]
 chart.historical.discharge.wq.yaxis.label = W [cm]
 
@@ -648,7 +647,6 @@
 chart.fix.deltawt.xaxis.label=Date
 chart.fix.deltawt.yaxis.label=\u0394 W(t) [cm]
 
-chart.fix.wq.subtitle=Water: {0}; Period: {1,date,short} to {2,date,short}
 chart.fixings.derivedcurve.title = Derived curve
 chart.fixings.deltawt.title = Differences from fitted curve at km {0}
 
diff -r 47e96ce9bd79 -r caba2157ed97 artifacts/src/main/resources/messages_de.properties
--- a/artifacts/src/main/resources/messages_de.properties	Wed Oct 08 12:27:53 2014 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Wed Oct 08 15:41:47 2014 +0200
@@ -190,7 +190,6 @@
 chart.historical.discharge.yaxis.second.label = Q [m\u00b3/s]
 chart.historical.discharge.yaxis.label = W [cm]
 chart.historical.discharge.wq.title = Abflusskurven
-chart.historical.discharge.wq.subtitle = Pegel {0}
 chart.historical.discharge.wq.xaxis.label = Q [m\u00b3/s]
 chart.historical.discharge.wq.yaxis.label = W [cm]
 
@@ -667,7 +666,6 @@
 export.fixings.deltawt.csv.reference=B
 export.fixings.deltawt.csv.analysis=A{0,number,integer}
 
-chart.fix.wq.subtitle=Gew\u00e4sser: {0}; Zeitraum: {1,date,short} bis {2,date,short}
 
 fix.missing.river=Kein Gew\u00e4sser gew\u00e4hlt
 fix.missing.from=Kein Startkilometer gew\u00e4hlt
diff -r 47e96ce9bd79 -r caba2157ed97 artifacts/src/main/resources/messages_de_DE.properties
--- a/artifacts/src/main/resources/messages_de_DE.properties	Wed Oct 08 12:27:53 2014 +0200
+++ b/artifacts/src/main/resources/messages_de_DE.properties	Wed Oct 08 15:41:47 2014 +0200
@@ -190,7 +190,6 @@
 chart.historical.discharge.yaxis.second.label = Q [m\u00b3/s]
 chart.historical.discharge.yaxis.label = W [cm]
 chart.historical.discharge.wq.title = Abflusskurven
-chart.historical.discharge.wq.subtitle = Pegel {0}
 chart.historical.discharge.wq.xaxis.label = Q [m\u00b3/s]
 chart.historical.discharge.wq.yaxis.label = W [cm]
 
@@ -651,7 +650,6 @@
 chart.fixings.wq.subtitle=Gew\u00e4sser: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}; Bezugszeitraum: {3,date,short} bis {4,date,short}
 chart.fixings.wq.subtitle1={0,date,short} bis {1,date,short}
 
-chart.fix.wq.subtitle=Gew\u00e4sser: {0}; Zeitraum: {1,date,short} bis {2,date,short}
 
 chart.fixings.longitudinalsection.title=L\u00e4ngsschnitt
 
diff -r 47e96ce9bd79 -r caba2157ed97 artifacts/src/main/resources/messages_en.properties
--- a/artifacts/src/main/resources/messages_en.properties	Wed Oct 08 12:27:53 2014 +0200
+++ b/artifacts/src/main/resources/messages_en.properties	Wed Oct 08 15:41:47 2014 +0200
@@ -189,7 +189,6 @@
 chart.historical.discharge.yaxis.second.label = Q [m\u00b3/s]
 chart.historical.discharge.yaxis.label = W [cm]
 chart.historical.discharge.wq.title = Discharge Curves
-chart.historical.discharge.wq.subtitle = Gauge {0}
 chart.historical.discharge.wq.xaxis.label = Q [m\u00b3/s]
 chart.historical.discharge.wq.yaxis.label = W [cm]
 
@@ -651,7 +650,6 @@
 chart.fix.deltawt.xaxis.label=Date
 chart.fix.deltawt.yaxis.label=\u0394 W(t) [cm]
 
-chart.fix.wq.subtitle=Water: {0}; Period: {1,date,short} to {2,date,short}
 
 chart.fixings.longitudinalsection.title=Longitudinal section
 


More information about the Dive4Elements-commits mailing list