annotate artifacts/src/main/java/org/dive4elements/river/exports/process/SedimentLoadM3AProcessor.java @ 7685:270946b97539

(issue1614) Handle NaN in Styled Series created by SedimentLoadProcessors This also removes duplicated code by basing the TA and MA processors on the same class
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 11 Dec 2013 17:13:26 +0100
parents e97867879a45
children eb48b244921d
rev   line source
7503
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesanstalt für Gewässerkunde
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
3 *
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
6 * documentation coming with Dive4Elements River for details.
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
7 */
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
8 package org.dive4elements.river.exports.process;
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
9
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
10 import org.apache.log4j.Logger;
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
11
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
12 import org.dive4elements.river.artifacts.model.FacetTypes;
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
13 import org.dive4elements.river.exports.DiagramGenerator;
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
14
7685
270946b97539 (issue1614) Handle NaN in Styled Series created by SedimentLoadProcessors
Andre Heinecke <aheinecke@intevation.de>
parents: 7511
diff changeset
15 public class SedimentLoadM3AProcessor extends SedimentLoadProcessor {
7503
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
16
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
17 private final static Logger logger =
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
18 Logger.getLogger(SedimentLoadM3AProcessor.class);
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
19
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
20 public static final String I18N_YAXIS_LABEL =
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
21 "chart.sedimentload.ls.yaxis.label.m3pera";
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
22 public static final String I18N_YAXIS_LABEL_DEFAULT = "[m\u00b3/a]";
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
23
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
24 @Override
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
25 public boolean canHandle(String facettype) {
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
26 return FacetTypes.IS.SEDIMENT_LOAD_M3A(facettype) ||
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
27 FacetTypes.SEDIMENT_LOAD_M3A_UNKNOWN.equals(facettype);
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
28 }
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
29
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
30 @Override
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
31 public String getAxisLabel(DiagramGenerator generator) {
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
32 return generator.msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT);
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
33 }
e11bf92bca4a issue1658: New Processors for t/a and m^3/a -axis (stripped down from SedimentLoadProcessor).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
34 }

http://dive4elements.wald.intevation.org