[Dive4elements-commits] [PATCH 5 of 8] Handle also sounding width generated via the datacage in MiddleBedHeightGenerator

Wald Commits scm-commit at wald.intevation.org
Thu Nov 15 16:31:34 CET 2012


# HG changeset patch
# User Björn Ricks <bjoern.ricks at intevation.de>
# Date 1352993276 -3600
# Node ID d337c67b6845135495e15b23748e683d111999b5
# Parent  ce4ff444f215a396389cae8c75eff28744751875
Handle also sounding width generated via the datacage in MiddleBedHeightGenerator

Add processor for BedHeight data and add new axis for sounding widths.

diff -r ce4ff444f215 -r d337c67b6845 flys-artifacts/src/main/java/de/intevation/flys/exports/MiddleBedHeightGenerator.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/MiddleBedHeightGenerator.java	Thu Nov 15 16:21:21 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/MiddleBedHeightGenerator.java	Thu Nov 15 16:27:56 2012 +0100
@@ -5,6 +5,7 @@
 import de.intevation.flys.artifacts.FLYSArtifact;
 import de.intevation.flys.artifacts.model.FacetTypes;
 import de.intevation.flys.artifacts.model.MiddleBedHeightData;
+import de.intevation.flys.exports.process.BedheightProcessor;
 import de.intevation.flys.exports.process.Processor;
 import de.intevation.flys.exports.process.WOutProcessor;
 import de.intevation.flys.jfree.FLYSAnnotation;
@@ -26,7 +27,7 @@
 implements   FacetTypes
 {
     public enum YAXIS {
-        H(0), W(1);
+        H(0), W(1), P(2);
         protected int idx;
         private YAXIS(int c) {
            idx = c;
@@ -61,6 +62,9 @@
     public static final String I18N_W_YAXIS_LABEL =
         "chart.longitudinal.section.yaxis.label";
     public static final String I18N_W_YAXIS_LABEL_DEFAULT  = "W [NN + m]";
+    public static final String I18N_P_YAXIS_LABEL_DEFAULT  = "Gepeilte Breite [m]";
+    public static final String I18N_P_YAXIS_LABEL =
+        "chart.bedheight_middle.sounding.yaxis.label";
 
     @Override
     protected YAxisWalker getYAxisWalker() {
@@ -118,6 +122,9 @@
         else if (index == YAXIS.W.idx) {
             label = msg(I18N_W_YAXIS_LABEL, I18N_W_YAXIS_LABEL_DEFAULT);
         }
+        else if (index == YAXIS.P.idx) {
+            label = msg(I18N_P_YAXIS_LABEL, I18N_P_YAXIS_LABEL_DEFAULT);
+        }
 
         return label;
     }
@@ -157,6 +164,9 @@
             return;
         }
 
+        Processor woutp = new WOutProcessor();
+        Processor bedp = new BedheightProcessor();
+
         if (name.equals(MIDDLE_BED_HEIGHT_SINGLE) || name.equals(MIDDLE_BED_HEIGHT_EPOCH)) {
             doHeightOut(
                 (MiddleBedHeightData) artifactAndFacet.getData(context),
@@ -186,14 +196,14 @@
                 visible,
                 YAXIS.H.idx);
         }
+        else if (bedp.canHandle(name)) {
+            bedp.doOut(this, artifactAndFacet, attr, visible, YAXIS.P.idx);
+        }
+        else if (woutp.canHandle(name)) {
+            woutp.doOut(this, artifactAndFacet, attr, visible, YAXIS.W.idx);
+        }
         else {
-           Processor processor = new WOutProcessor();
-            if (processor.canHandle(name)) {
-                processor.doOut(this, artifactAndFacet, attr, visible, YAXIS.W.idx);
-            }
-            else {
-                logger.warn("Unknown facet name: " + name);
-            }
+            logger.warn("Unknown facet name: " + name);
         }
     }
 


More information about the Dive4elements-commits mailing list