changeset 2706:d8444fcb4e44

Create chart facets for flow velocity calculation and a chart generator for this. flys-artifacts/trunk@4424 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 16 May 2012 12:39:13 +0000
parents 71f072d8b3d8
children d6e32ae72da6
files flys-artifacts/ChangeLog flys-artifacts/doc/conf/artifacts/minfo.xml flys-artifacts/doc/conf/conf.xml flys-artifacts/doc/conf/themes.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FlowVelocityData.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FlowVelocityFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FlowVelocityState.java flys-artifacts/src/main/java/de/intevation/flys/exports/FlowVelocityGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/FlowVelocityInfoGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.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 15 files changed, 660 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed May 16 10:52:12 2012 +0000
+++ b/flys-artifacts/ChangeLog	Wed May 16 12:39:13 2012 +0000
@@ -1,3 +1,42 @@
+2012-05-16  Ingo Weinzierl <ingo@intevation.de>
+
+	* doc/conf/artifacts/minfo.xml: Added a chart output and relevant facets to
+	  flow velocity state.
+
+	* src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java: Added
+	  new facet types for mainchannel, totalchannel and tau of flow velocity
+	  calculation.
+
+	* src/main/java/de/intevation/flys/artifacts/model/FlowVelocityFacet.java:
+	  New Facet that returns FlowVelocityData in getData().
+
+	* src/main/java/de/intevation/flys/artifacts/model/FlowVelocityData.java:
+	  Added new methods that return xy points for mainchannel, totalchannel and
+	  tau.
+
+	* src/main/java/de/intevation/flys/artifacts/states/FlowVelocityState.java:
+	  Create new mainchannel, totalchannel and tau Facets for each
+	  FlowVelocityData instance retrieved by FlowVelocityCalculation.
+
+	* src/main/java/de/intevation/flys/exports/XYChartGenerator.java: Commented
+	  legend aggregation out.
+
+	* src/main/java/de/intevation/flys/exports/FlowVelocityInfoGenerator.java,
+	  src/main/java/de/intevation/flys/exports/FlowVelocityGenerator.java: New
+	  chart generator for flow velocity data and its info generator.
+
+	* doc/conf/conf.xml: Registered the chart and chart info generator for flow
+	  velocity data.
+
+	* doc/conf/themes.xml: Added new themes for mainchannel, totalchannel and
+	  tau of flow velocity calculation.
+
+	* src/main/resources/messages.properties,
+	  src/main/resources/messages_de_DE.properties,
+	  src/main/resources/messages_en.properties,
+	  src/main/resources/messages_de.properties: Added i18n strings for flow
+	  velocity facets.
+
 2012-05-16  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/states/MultiIntArrayState.java:
--- a/flys-artifacts/doc/conf/artifacts/minfo.xml	Wed May 16 10:52:12 2012 +0000
+++ b/flys-artifacts/doc/conf/artifacts/minfo.xml	Wed May 16 12:39:13 2012 +0000
@@ -43,6 +43,13 @@
 
         <state id="state.minfo.flow_velocity" description="state.minfo.flow_velocity" state="de.intevation.flys.artifacts.states.FlowVelocityState" helpText="help.minfo.flowvelocity">
             <outputmodes>
+                <outputmode name="flow_velocity" description="output.flow_velocity" mime-type="image/png" type="chart">
+                    <facets>
+                        <facet name="flow_velocity.totalchannel" description="A facet for total channels"/>
+                        <facet name="flow_velocity.mainchannel" description="A facet for main channels"/>
+                        <facet name="flow_velocity.tau" description="A facet for tau"/>
+                    </facets>
+                </outputmode>
                 <outputmode name="flow_velocity_export" description="output.flow_velocity_export" mime-type="text/plain" type="export">
                     <facets>
                         <facet name="csv" description="facet.flow_velocity_export.csv" />
--- a/flys-artifacts/doc/conf/conf.xml	Wed May 16 10:52:12 2012 +0000
+++ b/flys-artifacts/doc/conf/conf.xml	Wed May 16 12:39:13 2012 +0000
@@ -227,6 +227,8 @@
         <output-generator name="historical_discharge">de.intevation.flys.exports.HistoricalDischargeCurveGenerator</output-generator>
         <output-generator name="historical_discharge_chartinfo">de.intevation.flys.exports.HistoricalDischargeCurveInfoGenerator</output-generator>
         <output-generator name="historical_discharge_export">de.intevation.flys.exports.HistoricalDischargeCurveExporter</output-generator>
+        <output-generator name="flow_velocity">de.intevation.flys.exports.FlowVelocityGenerator</output-generator>
+        <output-generator name="flow_velocity_chartinfo">de.intevation.flys.exports.FlowVelocityInfoGenerator</output-generator>
         <output-generator name="flow_velocity_export">de.intevation.flys.exports.FlowVelocityExporter</output-generator>
         <!-- Error report generators. -->
         <output-generator name="discharge_longitudinal_section_report">de.intevation.flys.exports.ReportGenerator</output-generator>
--- a/flys-artifacts/doc/conf/themes.xml	Wed May 16 10:52:12 2012 +0000
+++ b/flys-artifacts/doc/conf/themes.xml	Wed May 16 12:39:13 2012 +0000
@@ -968,6 +968,39 @@
 
 
     <!--
+         FLOW VELOCITY
+    -->
+    <theme name="FlowVelocityVMainChannel">
+        <inherits>
+            <inherit from="HiddenColorLines"/>
+            <inherit from="MinMaxPoints"/>
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe" default="204, 204, 204"/>
+        </fields>
+    </theme>
+
+    <theme name="FlowVelocityVTotalChannel">
+        <inherits>
+            <inherit from="FlowVelocityVMainChannel"/>
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe" default="0, 0, 102"/>
+        </fields>
+    </theme>
+
+    <theme name="FlowVelocityTau">
+        <inherits>
+            <inherit from="HiddenColorLines"/>
+            <inherit from="MinMaxPoints"/>
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe" default="0, 204, 204"/>
+        </fields>
+    </theme>
+
+
+    <!--
       Mappings are following now. A mapping maps between a name of a facet
       and a theme.
       Always the first matching mapping is taken, so consider putting most
@@ -1088,5 +1121,8 @@
         <mapping from="manualpoints" to="ManualPoints"/>
         <mapping from="reference_curve" to="ReferenceCurve"/>
         <mapping from="reference_curve_normalized" to="ReferenceCurveNormalized"/>
+        <mapping from="flow_velocity.totalchannel" to="FlowVelocityVTotalChannel"/>
+        <mapping from="flow_velocity.mainchannel" to="FlowVelocityVMainChannel"/>
+        <mapping from="flow_velocity.tau" to="FlowVelocityTau"/>
     </mappings>
 </themes>
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java	Wed May 16 10:52:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java	Wed May 16 12:39:13 2012 +0000
@@ -31,6 +31,13 @@
                 || type.equals(DURATION_Q)
                 || type.equals(STATIC_WQKMS_Q);
         }
+        public static boolean V(String type) {
+            return type.equals(FLOW_VELOCITY_MAINCHANNEL)
+                || type.equals(FLOW_VELOCITY_TOTALCHANNEL);
+        }
+        public static boolean T(String type) {
+            return type.equals(FLOW_VELOCITY_TAU);
+        }
         public static boolean MANUALPOINTS(String type) {
             return type.endsWith("manualpoints");
         }
@@ -135,5 +142,10 @@
 
     String REFERENCE_CURVE = "reference_curve";
     String REFERENCE_CURVE_NORMALIZED = "reference_curve_normalized";
+
+    String FLOW_VELOCITY_MAINCHANNEL  = "flow_velocity.mainchannel";
+    String FLOW_VELOCITY_TOTALCHANNEL = "flow_velocity.totalchannel";
+    String FLOW_VELOCITY_TAU          = "flow_velocity.tau";
+    String FLOW_VELOCITY_ANNOTATION   = "flow_velocity.annotation";
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FlowVelocityData.java	Wed May 16 10:52:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FlowVelocityData.java	Wed May 16 12:39:13 2012 +0000
@@ -75,4 +75,40 @@
     public int size() {
         return km.size();
     }
+
+
+    public double[][] getMainChannelPoints() {
+        double[][] points = new double[2][size()];
+
+        for (int i = 0, n = size(); i < n; i++) {
+            points[0][i] = getKM(i);
+            points[1][i] = getVMain(i);
+        }
+
+        return points;
+    }
+
+
+    public double[][] getTotalChannelPoints() {
+        double[][] points = new double[2][size()];
+
+        for (int i = 0, n = size(); i < n; i++) {
+            points[0][i] = getKM(i);
+            points[1][i] = getVTotal(i);
+        }
+
+        return points;
+    }
+
+
+    public double[][] getTauPoints() {
+        double[][] points = new double[2][size()];
+
+        for (int i = 0, n = size(); i < n; i++) {
+            points[0][i] = getKM(i);
+            points[1][i] = getTauMain(i);
+        }
+
+        return points;
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FlowVelocityFacet.java	Wed May 16 12:39:13 2012 +0000
@@ -0,0 +1,64 @@
+package de.intevation.flys.artifacts.model;
+
+import de.intevation.artifactdatabase.state.Facet;
+
+import de.intevation.artifacts.Artifact;
+import de.intevation.artifacts.CallContext;
+
+import de.intevation.flys.artifacts.FLYSArtifact;
+
+import de.intevation.flys.artifacts.states.DefaultState.ComputeType;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Facet of a FlowVelocity curve.
+ */
+public class FlowVelocityFacet extends DataFacet {
+
+    private static Logger logger = Logger.getLogger(FlowVelocityFacet.class);
+
+
+    public FlowVelocityFacet() {
+        // required for clone operation deepCopy()
+    }
+
+
+    public FlowVelocityFacet(
+        int         idx,
+        String      name,
+        String      description,
+        ComputeType type,
+        String      stateId,
+        String      hash
+    ) {
+        super(idx, name, description, type, hash, stateId);
+    }
+
+
+    public Object getData(Artifact artifact, CallContext context) {
+        logger.debug("Get data for flow velocity at index: " + index);
+
+        FLYSArtifact flys = (FLYSArtifact) artifact;
+
+        CalculationResult res = (CalculationResult)
+            flys.compute(context, hash, stateId, type, false);
+
+        FlowVelocityData[] data = (FlowVelocityData[]) res.getData();
+
+        return data[index];
+    }
+
+
+    /** Copy deeply. */
+    @Override
+    public Facet deepCopy() {
+        FlowVelocityFacet copy = new FlowVelocityFacet();
+        copy.set(this);
+        copy.type    = type;
+        copy.hash    = hash;
+        copy.stateId = stateId;
+        return copy;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FlowVelocityState.java	Wed May 16 10:52:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FlowVelocityState.java	Wed May 16 12:39:13 2012 +0000
@@ -16,6 +16,8 @@
 import de.intevation.flys.artifacts.model.FacetTypes;
 import de.intevation.flys.artifacts.model.FlowVelocityCalculation;
 import de.intevation.flys.artifacts.model.FlowVelocityData;
+import de.intevation.flys.artifacts.model.FlowVelocityFacet;
+import de.intevation.flys.artifacts.resources.Resources;
 
 
 public class FlowVelocityState extends DefaultState implements FacetTypes {
@@ -23,6 +25,16 @@
     private static Logger logger = Logger.getLogger(FlowVelocityState.class);
 
 
+    public static final String I18N_MAINCHANNEL_FACET =
+        "facet.flow_velocity.mainchannel";
+
+    public static final String I18N_TOTALCHANNEL_FACET =
+        "facet.flow_velocity.totalchannel";
+
+    public static final String I18N_TAU_FACET =
+        "facet.flow_velocity.tauchannel";
+
+
     @Override
     public Object computeAdvance(
         FLYSArtifact artifact,
@@ -47,11 +59,40 @@
 
         logger.debug("Calculated " + data.length + " FlowVelocityData objects");
 
-        String id = getID();
+        String id  = getID();
+        int    idx = 0;
 
         for (FlowVelocityData d: data) {
             logger.error("TODO: Implement Facet creation for chart!");
 
+            newFacets.add(new FlowVelocityFacet(
+                idx,
+                FLOW_VELOCITY_MAINCHANNEL,
+                buildMainChannelName(artifact, context, d),
+                ComputeType.ADVANCE,
+                id,
+                hash
+            ));
+
+            newFacets.add(new FlowVelocityFacet(
+                idx,
+                FLOW_VELOCITY_TOTALCHANNEL,
+                buildTotalChannelName(artifact, context, d),
+                ComputeType.ADVANCE,
+                id,
+                hash
+            ));
+
+            newFacets.add(new FlowVelocityFacet(
+                idx,
+                FLOW_VELOCITY_TAU,
+                buildTauName(artifact, context, d),
+                ComputeType.ADVANCE,
+                id,
+                hash
+            ));
+
+            idx++;
         }
 
         Facet csv = new DataFacet(
@@ -67,5 +108,50 @@
 
         return res;
     }
+
+
+    protected String buildFacetName(
+        FLYSArtifact     flys,
+        CallContext      cc,
+        FlowVelocityData data,
+        String           resourceId
+    ) {
+        Object[] args = new Object[] {
+            data.getZone()
+        };
+
+        return Resources.getMsg(
+            cc.getMeta(),
+            resourceId,
+            resourceId,
+            args);
+    }
+
+
+    protected String buildMainChannelName(
+        FLYSArtifact     flys,
+        CallContext      cc,
+        FlowVelocityData data
+    ) {
+        return buildFacetName(flys, cc, data, I18N_MAINCHANNEL_FACET);
+    }
+
+
+    protected String buildTotalChannelName(
+        FLYSArtifact     flys,
+        CallContext      cc,
+        FlowVelocityData data
+    ) {
+        return buildFacetName(flys, cc, data, I18N_TOTALCHANNEL_FACET);
+    }
+
+
+    protected String buildTauName(
+        FLYSArtifact     flys,
+        CallContext      cc,
+        FlowVelocityData data
+    ) {
+        return buildFacetName(flys, cc, data, I18N_TAU_FACET);
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/FlowVelocityGenerator.java	Wed May 16 12:39:13 2012 +0000
@@ -0,0 +1,347 @@
+package de.intevation.flys.exports;
+
+import org.apache.log4j.Logger;
+
+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.model.FacetTypes;
+import de.intevation.flys.artifacts.model.FlowVelocityData;
+
+import de.intevation.flys.jfree.FLYSAnnotation;
+import de.intevation.flys.jfree.StyledXYSeries;
+
+import de.intevation.flys.utils.FLYSUtils;
+
+
+
+/**
+ * An OutGenerator that generates flow velocity curves.
+ *
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public class FlowVelocityGenerator
+extends      XYChartGenerator
+implements   FacetTypes
+{
+    public enum YAXIS {
+        V(0),
+        T(1);
+        protected int idx;
+        private YAXIS(int c) {
+           idx = c;
+        }
+    }
+
+    /** The logger that is used in this generator. */
+    private static Logger logger = Logger.getLogger(FlowVelocityGenerator.class);
+
+    /** Key to look up internationalized String for annotations label. */
+    public static final String I18N_ANNOTATIONS_LABEL =
+        "chart.flow_velocity.annotations.label";
+
+    /**
+     * Key to look up internationalized String for LongitudinalSection diagrams
+     * titles.
+     */
+    public static final String I18N_CHART_TITLE =
+        "chart.flow_velocity.section.title";
+
+    /**
+     * Key to look up internationalized String for LongitudinalSection diagrams
+     * subtitles.
+     */
+    public static final String I18N_CHART_SUBTITLE =
+        "chart.flow_velocity.section.subtitle";
+
+    /**
+     * Key to look up internationalized String for LongitudinalSection diagrams
+     * short subtitles.
+     */
+    public static final String I18N_CHART_SHORT_SUBTITLE =
+        "chart.flow_velocity.section.shortsubtitle";
+
+    public static final String I18N_XAXIS_LABEL =
+        "chart.flow_velocity.section.xaxis.label";
+
+    public static final String I18N_YAXIS_LABEL =
+        "chart.flow_velocity.section.yaxis.label";
+
+    public static final String I18N_2YAXIS_LABEL =
+        "chart.flow_velocity.section.yaxis.second.label";
+
+    public static final String I18N_CHART_TITLE_DEFAULT  = "Geschwindigkeit- und Schubspannung";
+    public static final String I18N_XAXIS_LABEL_DEFAULT  = "km";
+    public static final String I18N_YAXIS_LABEL_DEFAULT  = "Geschwindigkeit v [m/s]";
+    public static final String I18N_2YAXIS_LABEL_DEFAULT = "Schubspannung Tau [N]";
+
+
+
+    @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();
+            }
+        };
+    }
+
+
+    /**
+     * Returns the default title for this chart.
+     *
+     * @return the default title for this chart.
+     */
+    @Override
+    public String getDefaultChartTitle() {
+        Object[] args = new Object[] {
+            getRiverName()
+        };
+
+        return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT, args);
+    }
+
+
+    /**
+     * Get internationalized label for the x axis.
+     */
+    @Override
+    protected String getDefaultXAxisLabel() {
+        FLYSArtifact flys = (FLYSArtifact) master;
+
+        return msg(
+            I18N_XAXIS_LABEL,
+            I18N_XAXIS_LABEL_DEFAULT,
+            new Object[] { FLYSUtils.getRiver(flys).getName() });
+    }
+
+
+    @Override
+    protected String getDefaultYAxisLabel(int index) {
+        String label = "default";
+
+        if (index == YAXIS.V.idx) {
+            label = getVAxisLabel();
+        }
+        else if (index == YAXIS.T.idx) {
+            label = getTAxisLabel();
+        }
+
+        return label;
+    }
+
+
+    /**
+     * Get internationalized label for the y axis.
+     */
+    protected String getVAxisLabel() {
+        FLYSArtifact flys = (FLYSArtifact) master;
+
+        return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT);
+    }
+
+
+    /**
+     * Get internationalized label for the y axis.
+     */
+    protected String getTAxisLabel() {
+        FLYSArtifact flys = (FLYSArtifact) master;
+
+        return msg(I18N_2YAXIS_LABEL, I18N_2YAXIS_LABEL_DEFAULT);
+    }
+
+
+    /**
+     * Produce output.
+     * @param facet current facet.
+     * @param attr  theme for facet
+     */
+    public void doOut(
+        ArtifactAndFacet artifactAndFacet,
+        Document         attr,
+        boolean          visible
+    ) {
+        String name = artifactAndFacet.getFacetName();
+
+        logger.debug("FlowVelocityGenerator.doOut: " + name);
+
+        if (name == null) {
+            logger.error("No facet name for doOut(). No output generated!");
+            return;
+        }
+
+        Facet facet = artifactAndFacet.getFacet();
+
+        if (facet == null) {
+            return;
+        }
+
+        if (name.equals(FLOW_VELOCITY_MAINCHANNEL)) {
+            doMainChannelOut(
+                (FlowVelocityData) artifactAndFacet.getData(context),
+                artifactAndFacet,
+                attr,
+                visible);
+        }
+        else if (name.equals(FLOW_VELOCITY_TOTALCHANNEL)) {
+            doTotalChannelOut(
+                (FlowVelocityData) artifactAndFacet.getData(context),
+                artifactAndFacet,
+                attr,
+                visible);
+        }
+        else if (name.equals(FLOW_VELOCITY_TAU)) {
+            doTauOut(
+                (FlowVelocityData) artifactAndFacet.getData(context),
+                artifactAndFacet,
+                attr,
+                visible);
+        }
+        else if (name.equals(FLOW_VELOCITY_ANNOTATION)) {
+            doAnnotations(
+                (FLYSAnnotation) artifactAndFacet.getData(context),
+                 artifactAndFacet,
+                 attr,
+                 visible);
+        }
+        else if (FacetTypes.IS.AREA(name)) {
+            doArea(
+                artifactAndFacet.getData(context),
+                artifactAndFacet,
+                attr,
+                visible);
+        }
+        else if (FacetTypes.IS.MANUALPOINTS(name)) {
+            doPoints(
+                artifactAndFacet.getData(context),
+                artifactAndFacet,
+                attr,
+                visible,
+                YAXIS.V.idx);
+        }
+        else {
+            logger.warn("Unknown facet name: " + name);
+            return;
+        }
+    }
+
+
+    /**
+     * Process the output for W facets in a longitudinal section curve.
+     *
+     * @param data A FlowVelocityData object
+     * @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 doMainChannelOut(
+        FlowVelocityData data,
+        ArtifactAndFacet aandf,
+        Document         theme,
+        boolean          visible
+    ) {
+        logger.debug("FlowVelocityGenerator.doMainChannelOut");
+
+        XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
+
+        StyledSeriesBuilder.addPoints(series, data.getMainChannelPoints(), true);
+
+        addAxisSeries(series, YAXIS.V.idx, visible);
+    }
+
+
+    /**
+     * Add items to dataseries which describes the differences.
+     */
+    protected void doTotalChannelOut(
+        FlowVelocityData data,
+        ArtifactAndFacet aandf,
+        Document         theme,
+        boolean          visible
+    ) {
+        logger.debug("FlowVelocityGenerator.doTotalChannelOut");
+
+        if (data == null) {
+            logger.warn("No data to add to FlowVelocity chart.");
+            return;
+         }
+
+        XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
+
+        StyledSeriesBuilder.addPoints(series, data.getTotalChannelPoints(), true);
+
+        addAxisSeries(series, YAXIS.V.idx, visible);
+    }
+
+
+
+    /**
+     * @param data A FlowVelocityData object
+     * @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 doTauOut(
+        FlowVelocityData data,
+        ArtifactAndFacet aandf,
+        Document         theme,
+        boolean          visible
+    ) {
+        logger.debug("FlowVelocityGenerator.doTauOut");
+
+        XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
+
+        StyledSeriesBuilder.addPoints(series, data.getTauPoints(), true);
+
+        addAxisSeries(series, YAXIS.T.idx, visible);
+    }
+
+
+    /** Look up the axis identifier for a given facet type. */
+    public int axisIdxForFacet(String facetName) {
+        if (FacetTypes.IS.V(facetName)) {
+            return YAXIS.V.idx;
+        }
+        else if (FacetTypes.IS.T(facetName)) {
+            return YAXIS.T.idx;
+        }
+        else {
+            logger.warn("Could not find axis for facet " + facetName);
+            return YAXIS.V.idx;
+        }
+    }
+
+
+    /**
+     * Do Area out.
+     * @param theme styling information.
+     * @param visible whether or not visible.
+     */
+    protected void doArea(
+        Object     o,
+        ArtifactAndFacet aandf,
+        Document   theme,
+        boolean    visible
+    ) {
+        logger.debug("FlowVelocityGenerator.doArea");
+        logger.warn("TODO: Implement FlowVelocityGenerator.doArea");
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/FlowVelocityInfoGenerator.java	Wed May 16 12:39:13 2012 +0000
@@ -0,0 +1,17 @@
+package de.intevation.flys.exports;
+
+
+/**
+ * A ChartInfoGenerator that generates meta information for specific
+ * flow velocity curves.
+ *
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public class FlowVelocityInfoGenerator
+extends      ChartInfoGenerator
+{
+    public FlowVelocityInfoGenerator() {
+        super(new FlowVelocityGenerator());
+    }
+}
+// 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 May 16 10:52:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java	Wed May 16 12:39:13 2012 +0000
@@ -237,7 +237,7 @@
         // These have to go after the autozoom.
         addAnnotationsToRenderer(plot);
 
-        aggregateLegendEntries(plot);
+        //aggregateLegendEntries(plot);
 
         return chart;
     }
--- a/flys-artifacts/src/main/resources/messages.properties	Wed May 16 10:52:12 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages.properties	Wed May 16 12:39:13 2012 +0000
@@ -126,6 +126,9 @@
 facet.longitudinal_section.annotations = POIs
 facet.discharge_curves.mainvalues.q = Q (main values)
 facet.discharge_curves.mainvalues.w = W (main values)
+facet.flow_velocity.mainchannel = v Mainchannel at {0}
+facet.flow_velocity.totalchannel = v Totalchannel at {0}
+facet.flow_velocity.tauchannel = TAU Mainchannel at {0}
 
 export.waterlevel.csv.header.km = River-Km
 export.waterlevel.csv.header.w = W [NN + m]
--- a/flys-artifacts/src/main/resources/messages_de.properties	Wed May 16 10:52:12 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_de.properties	Wed May 16 12:39:13 2012 +0000
@@ -125,6 +125,9 @@
 facet.longitudinal_section.annotations = Streckenfavoriten
 facet.discharge_curves.mainvalues.q = Q (Haupt- und Extremwerte)
 facet.discharge_curves.mainvalues.w = W (Haupt- und Extremwerte)
+facet.flow_velocity.mainchannel = v Hauptgerinne bei {0}
+facet.flow_velocity.totalchannel = v Gesamtgerinne bei {0}
+facet.flow_velocity.tauchannel = TAU Hauptgerinne bei {0}
 
 export.waterlevel.csv.header.km = Fluss-Km
 export.waterlevel.csv.header.w = W [NN + m]
--- a/flys-artifacts/src/main/resources/messages_de_DE.properties	Wed May 16 10:52:12 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_de_DE.properties	Wed May 16 12:39:13 2012 +0000
@@ -123,6 +123,9 @@
 facet.longitudinal_section.annotations = Streckenfavoriten
 facet.discharge_curves.mainvalues.q = Q (Haupt- und Extremwerte)
 facet.discharge_curves.mainvalues.w = W (Haupt- und Extremwerte)
+facet.flow_velocity.mainchannel = v Hauptgerinne bei {0}
+facet.flow_velocity.totalchannel = v Gesamtgerinne bei {0}
+facet.flow_velocity.tauchannel = TAU Hauptgerinne bei {0}
 
 export.waterlevel.csv.header.km = Fluss-Km
 export.waterlevel.csv.header.w = W [NN + m]
--- a/flys-artifacts/src/main/resources/messages_en.properties	Wed May 16 10:52:12 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_en.properties	Wed May 16 12:39:13 2012 +0000
@@ -125,6 +125,9 @@
 facet.longitudinal_section.annotations = POIs
 facet.discharge_curves.mainvalues.q = Q (main values)
 facet.discharge_curves.mainvalues.w = W (main values)
+facet.flow_velocity.mainchannel = v Mainchannel at {0}
+facet.flow_velocity.totalchannel = v Totalchannel at {0}
+facet.flow_velocity.tauchannel = TAU Mainchannel at {0}
 
 export.waterlevel.csv.header.km = River-Km
 export.waterlevel.csv.header.w = W [NN + m]

http://dive4elements.wald.intevation.org