[PATCH 01 of 17] Move Funcionality related to bed quality from FlowVelocityGenerator to LongitudinalSectionGenerator (previously left over)

Wald Commits scm-commit at wald.intevation.org
Sat Aug 10 12:30:06 CEST 2013


# HG changeset patch
# User Tom Gottfried <tom.gottfried at intevation.de>
# Date 1376047967 -7200
# Branch longitudinal-symmetry
# Node ID 7089f338138af478225d46a49e1615aedbaf9dfa
# Parent  23ab795f2f0e7bf1b9b34b143bf1ab111e2cf4d8
Move Funcionality related to bed quality from FlowVelocityGenerator to LongitudinalSectionGenerator (previously left over).

diff -r 23ab795f2f0e -r 7089f338138a artifacts/src/main/java/org/dive4elements/river/exports/FlowVelocityGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/FlowVelocityGenerator.java	Fri Aug 09 12:11:53 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/FlowVelocityGenerator.java	Fri Aug 09 13:32:47 2013 +0200
@@ -28,10 +28,10 @@
 import org.dive4elements.river.artifacts.model.minfo.BedloadDiameterResult;
 import org.dive4elements.river.model.FlowVelocityMeasurementValue;
 
-import org.dive4elements.river.jfree.Bounds;
-import org.dive4elements.river.jfree.DoubleBounds;
-import org.dive4elements.river.jfree.RiverAnnotation;
-import org.dive4elements.river.jfree.StyledXYSeries;
+// import org.dive4elements.river.jfree.Bounds;
+// import org.dive4elements.river.jfree.DoubleBounds;
+// import org.dive4elements.river.jfree.RiverAnnotation;
+// import org.dive4elements.river.jfree.StyledXYSeries;
 
 import org.dive4elements.river.utils.RiverUtils;
 
@@ -68,43 +68,5 @@
     public static final String I18N_CHART_TITLE =
         "chart.flow_velocity.section.title";
 
-    /** TODO:
-     * are the following defined somewhere else too?
-     * remove them here!
-     */
-    private void doBedQualityLoadDiameter(
-        BedloadDiameterResult data,
-        ArtifactAndFacet aandf,
-        Document attr,
-        boolean visible) {
-        XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), attr);
-        StyledSeriesBuilder.addPoints(series, data.getDiameterData(), true);
-
-        addAxisSeries(series, YAXIS.D.idx, visible);
-    }
-
-
-    private void doBedQualityTopLayerOut(
-        BedDiameterResult data,
-        ArtifactAndFacet aandf,
-        Document attr,
-        boolean visible) {
-        XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), attr);
-        StyledSeriesBuilder.addPoints(series, data.getDiameterSubData(), true);
-        addAxisSeries(series, YAXIS.D.idx, visible);
-    }
-
-
-    private void doBedQualitySubLayerOut(
-        BedDiameterResult data,
-        ArtifactAndFacet aandf,
-        Document attr,
-        boolean visible
-    ) {
-        logger.debug("Do beddiametersubout");
-        XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), attr);
-        StyledSeriesBuilder.addPoints(series, data.getDiameterSubData(), true);
-        addAxisSeries(series, YAXIS.D.idx, visible);
-    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r 23ab795f2f0e -r 7089f338138a artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator.java	Fri Aug 09 12:11:53 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator.java	Fri Aug 09 13:32:47 2013 +0200
@@ -28,6 +28,8 @@
 import org.dive4elements.river.artifacts.access.FlowVelocityAccess;
 import org.dive4elements.river.artifacts.model.FlowVelocityData;
 import org.dive4elements.river.model.FlowVelocityMeasurementValue;
+import org.dive4elements.river.artifacts.model.minfo.BedDiameterResult;
+import org.dive4elements.river.artifacts.model.minfo.BedloadDiameterResult;
 
 import org.dive4elements.river.jfree.Bounds;
 import org.dive4elements.river.jfree.DoubleBounds;
@@ -497,7 +499,27 @@
                  attr,
                  visible);
         }
-
+	else if (name.equals(BED_QUALITY_BED_DIAMETER_SUBLAYER)) {
+	    doBedQualitySubLayerOut(
+                (BedDiameterResult)artifactAndFacet.getData(context),
+		artifactAndFacet,
+		attr,
+		visible);
+	}
+	else if (name.equals(BED_QUALITY_BED_DIAMETER_TOPLAYER)) {
+	    doBedQualityTopLayerOut(
+	        (BedDiameterResult)artifactAndFacet.getData(context),
+		artifactAndFacet,
+		attr,
+		visible);
+	}
+	else if (name.equals(BED_QUALITY_BEDLOAD_DIAMETER)) {
+	    doBedQualityLoadDiameter(
+		(BedloadDiameterResult)artifactAndFacet.getData(context),
+		artifactAndFacet,
+		attr,
+		visible);
+	}
 
         else {
             logger.warn("Unknown facet name: " + name);
@@ -851,5 +873,40 @@
 
 	addAxisSeries(series, YAXIS.Q.idx, visible);
 	}
+
+    private void doBedQualityLoadDiameter(
+        BedloadDiameterResult data,
+        ArtifactAndFacet aandf,
+        Document attr,
+        boolean visible) {
+        XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), attr);
+        StyledSeriesBuilder.addPoints(series, data.getDiameterData(), true);
+
+        addAxisSeries(series, YAXIS.D.idx, visible);
+    }
+
+
+    private void doBedQualityTopLayerOut(
+        BedDiameterResult data,
+        ArtifactAndFacet aandf,
+        Document attr,
+        boolean visible) {
+        XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), attr);
+        StyledSeriesBuilder.addPoints(series, data.getDiameterSubData(), true);
+        addAxisSeries(series, YAXIS.D.idx, visible);
+    }
+
+
+    private void doBedQualitySubLayerOut(
+        BedDiameterResult data,
+        ArtifactAndFacet aandf,
+        Document attr,
+        boolean visible
+    ) {
+        logger.debug("Do beddiametersubout");
+        XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), attr);
+        StyledSeriesBuilder.addPoints(series, data.getDiameterSubData(), true);
+        addAxisSeries(series, YAXIS.D.idx, visible);
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :


More information about the Dive4elements-commits mailing list