[Dive4elements-commits] [PATCH 3 of 6] Add chart generation for fixings in bed differences generators

Wald Commits scm-commit at wald.intevation.org
Fri Nov 2 15:57:12 CET 2012


# HG changeset patch
# User Björn Ricks <bjoern.ricks at intevation.de>
# Date 1351867835 -3600
# Node ID 8eb1d6dc96a99f8c5c1eabcead64547011249d6d
# Parent  512a3af69e180d72c34f63b4e086f1b72d541f95
Add chart generation for fixings in bed differences generators

If matching fixanalysis data is loaded via the datacage the bed difference
generators are now able to display graphs for the additonal data.

diff -r 512a3af69e18 -r 8eb1d6dc96a9 flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDiffHeightYearGenerator.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDiffHeightYearGenerator.java	Fri Nov 02 15:47:15 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDiffHeightYearGenerator.java	Fri Nov 02 15:50:35 2012 +0100
@@ -9,17 +9,17 @@
 import de.intevation.flys.artifacts.model.FacetTypes;
 import de.intevation.flys.artifacts.model.minfo.BedDiffYearResult;
 import de.intevation.flys.exports.StyledSeriesBuilder;
-import de.intevation.flys.exports.XYChartGenerator;
+import de.intevation.flys.exports.fixings.AbstractFixGenerator;
 import de.intevation.flys.jfree.FLYSAnnotation;
 import de.intevation.flys.jfree.StyledXYSeries;
 
 
 public class BedDiffHeightYearGenerator
-extends XYChartGenerator
+extends AbstractFixGenerator
 implements FacetTypes
 {
     public enum YAXIS {
-        D(0);
+        D(0), dW(1);
 
         protected int idx;
 
@@ -78,6 +78,15 @@
                 (BedDiffYearResult) bundle.getData(context),
                 bundle, attr, visible);
         }
+        else if (name.contains(FIX_SECTOR_AVERAGE_LS)) {
+            doSectorAverageOut( bundle, attr, visible, YAXIS.dW.idx);
+        }
+        else if (name.equals(FIX_REFERENCE_EVENTS_LS)) {
+            doReferenceEventsOut( bundle, attr, visible, YAXIS.dW.idx);
+        }
+        else if (name.equals(FIX_ANALYSIS_EVENTS_LS)) {
+            doAnalysisEventsOut( bundle, attr, visible, YAXIS.dW.idx);
+        }
         else if (name.equals(LONGITUDINAL_ANNOTATION)) {
             doAnnotations(
                 (FLYSAnnotation) bundle.getData(context),
@@ -99,7 +108,13 @@
 
     @Override
     protected String getDefaultYAxisLabel(int pos) {
-        return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT);
+        if (pos == YAXIS.D.idx) {
+            return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT);
+        }
+        else if (pos == YAXIS.dW.idx) {
+            return msg(I18N_DW_YAXIS_LABEL, I18N_DW_YAXIS_LABEL_DEFAULT);
+        }
+        return "default";
     }
 
     protected void doBedDifferenceYearOut(BedDiffYearResult data,
diff -r 512a3af69e18 -r 8eb1d6dc96a9 flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDifferenceEpochGenerator.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDifferenceEpochGenerator.java	Fri Nov 02 15:47:15 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDifferenceEpochGenerator.java	Fri Nov 02 15:50:35 2012 +0100
@@ -9,17 +9,17 @@
 import de.intevation.flys.artifacts.model.FacetTypes;
 import de.intevation.flys.artifacts.model.minfo.BedDiffEpochResult;
 import de.intevation.flys.exports.StyledSeriesBuilder;
-import de.intevation.flys.exports.XYChartGenerator;
+import de.intevation.flys.exports.fixings.AbstractFixGenerator;
 import de.intevation.flys.jfree.FLYSAnnotation;
 import de.intevation.flys.jfree.StyledXYSeries;
 
 
 public class BedDifferenceEpochGenerator
-extends XYChartGenerator
+extends AbstractFixGenerator
 implements FacetTypes
 {
     public enum YAXIS {
-        D(0), H(1);
+        D(0), H(1), dW(2);
 
         protected int idx;
 
@@ -88,6 +88,15 @@
             doBedDifferenceHeightsOut((BedDiffEpochResult)bundle.getData(context),
                 bundle, attr, visible, 1);
         }
+        else if (name.contains(FIX_SECTOR_AVERAGE_LS)) {
+            doSectorAverageOut( bundle, attr, visible, YAXIS.dW.idx);
+        }
+        else if (name.equals(FIX_REFERENCE_EVENTS_LS)) {
+            doReferenceEventsOut( bundle, attr, visible, YAXIS.dW.idx);
+        }
+        else if (name.equals(FIX_ANALYSIS_EVENTS_LS)) {
+            doAnalysisEventsOut( bundle, attr, visible, YAXIS.dW.idx);
+        }
         else if (name.equals(LONGITUDINAL_ANNOTATION)) {
             doAnnotations(
                 (FLYSAnnotation) bundle.getData(context),
@@ -116,6 +125,9 @@
         else if (pos == YAXIS.H.idx) {
             label = msg(I18N_SECOND_YAXIS_LABEL, I18N_SECOND_YAXIS_LABEL_DEFAULT);
         }
+        else if (pos == YAXIS.dW.idx) {
+            return msg(I18N_DW_YAXIS_LABEL, I18N_DW_YAXIS_LABEL_DEFAULT);
+        }
 
         return label;
     }
diff -r 512a3af69e18 -r 8eb1d6dc96a9 flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDifferenceYearGenerator.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDifferenceYearGenerator.java	Fri Nov 02 15:47:15 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDifferenceYearGenerator.java	Fri Nov 02 15:50:35 2012 +0100
@@ -9,17 +9,17 @@
 import de.intevation.flys.artifacts.model.FacetTypes;
 import de.intevation.flys.artifacts.model.minfo.BedDiffYearResult;
 import de.intevation.flys.exports.StyledSeriesBuilder;
-import de.intevation.flys.exports.XYChartGenerator;
+import de.intevation.flys.exports.fixings.AbstractFixGenerator;
 import de.intevation.flys.jfree.FLYSAnnotation;
 import de.intevation.flys.jfree.StyledXYSeries;
 
 
 public class BedDifferenceYearGenerator
-extends XYChartGenerator
+extends AbstractFixGenerator
 implements FacetTypes
 {
     public enum YAXIS {
-        D(0), M(1), H(2);
+        D(0), M(1), H(2),  dW(3);
 
         protected int idx;
 
@@ -96,6 +96,15 @@
             doBedDifferenceHeightsOut(
                 (BedDiffYearResult)bundle.getData(context),
                 bundle, attr, visible, 1);
+        } 
+        else if (name.contains(FIX_SECTOR_AVERAGE_LS)) {
+            doSectorAverageOut( bundle, attr, visible, YAXIS.dW.idx);
+        }
+        else if (name.equals(FIX_REFERENCE_EVENTS_LS)) {
+            doReferenceEventsOut( bundle, attr, visible, YAXIS.dW.idx);
+        }
+        else if (name.equals(FIX_ANALYSIS_EVENTS_LS)) {
+            doAnalysisEventsOut( bundle, attr, visible, YAXIS.dW.idx);
         }
         else if (name.equals(LONGITUDINAL_ANNOTATION)) {
             doAnnotations(
@@ -147,7 +156,9 @@
         else if (pos == YAXIS.H.idx) {
             label = msg(I18N_THIRD_YAXIS_LABEL, I18N_THIRD_YAXIS_LABEL_DEFAULT);
         }
-
+        else if (pos == YAXIS.dW.idx) {
+            label = msg(I18N_DW_YAXIS_LABEL, I18N_DW_YAXIS_LABEL_DEFAULT);
+        }
         return label;
     }
 


More information about the Dive4elements-commits mailing list