[PATCH 2 of 7] Rename BedheightProcessor to BedWidthProcessor
Wald Commits
scm-commit at wald.intevation.org
Wed Sep 25 11:57:43 CEST 2013
# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1380102682 -7200
# Node ID 917b2617285359b53f174c007329d5683e8631eb
# Parent 1106f580420cdb5e2b6c22a2c749d1392661fbb0
Rename BedheightProcessor to BedWidthProcessor
Confusing names become more important when the classes are configurable
diff -r 1106f580420c -r 917b26172853 artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator.java Wed Sep 25 11:47:45 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator.java Wed Sep 25 11:51:22 2013 +0200
@@ -20,7 +20,7 @@
import org.dive4elements.river.exports.process.Processor;
import org.dive4elements.river.exports.process.BedDiffHeightYearProcessor;
import org.dive4elements.river.exports.process.BedDiffYearProcessor;
-import org.dive4elements.river.exports.process.BedheightProcessor;
+import org.dive4elements.river.exports.process.BedWidthProcessor;
import org.dive4elements.river.exports.process.QOutProcessor;
import org.dive4elements.river.exports.process.WOutProcessor;
import org.dive4elements.river.exports.process.AnnotationProcessor;
@@ -341,7 +341,7 @@
Processor wProcessor = new WOutProcessor();
Processor qProcessor = new QOutProcessor();
- Processor bedp = new BedheightProcessor();
+ Processor bedp = new BedWidthProcessor();
Processor bdyProcessor = new BedDiffYearProcessor();
Processor bdhyProcessor = new BedDiffHeightYearProcessor();
Processor annotationProcessor = new AnnotationProcessor();
diff -r 1106f580420c -r 917b26172853 artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightGenerator.java Wed Sep 25 11:47:45 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightGenerator.java Wed Sep 25 11:51:22 2013 +0200
@@ -16,7 +16,7 @@
import org.dive4elements.river.artifacts.model.MiddleBedHeightData;
import org.dive4elements.river.artifacts.model.WQKms;
-import org.dive4elements.river.exports.process.BedheightProcessor;
+import org.dive4elements.river.exports.process.BedWidthProcessor;
import org.dive4elements.river.exports.process.Processor;
import org.dive4elements.river.exports.process.QOutProcessor;
import org.dive4elements.river.exports.process.WOutProcessor;
@@ -195,7 +195,7 @@
}
Processor woutp = new WOutProcessor();
- Processor bedp = new BedheightProcessor();
+ Processor bedp = new BedWidthProcessor();
Processor qoutp = new QOutProcessor();
if (woutp.canHandle(name)) {
woutp.doOut(this, artifactAndFacet, attr, visible, YAXIS.W.idx);
diff -r 1106f580420c -r 917b26172853 artifacts/src/main/java/org/dive4elements/river/exports/process/BedWidthProcessor.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/BedWidthProcessor.java Wed Sep 25 11:51:22 2013 +0200
@@ -0,0 +1,114 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.exports.process;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jfree.data.xy.XYSeries;
+
+import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
+import org.dive4elements.artifacts.CallContext;
+import org.dive4elements.river.artifacts.model.minfo.BedHeightSingle;
+import org.dive4elements.river.exports.XYChartGenerator;
+import org.dive4elements.river.exports.DiagramGenerator;
+import org.dive4elements.river.jfree.StyledXYSeries;
+import org.dive4elements.river.model.BedHeightSingleValue;
+import org.dive4elements.river.themes.ThemeDocument;
+
+public class BedWidthProcessor extends DefaultProcessor {
+
+ private final static Logger logger =
+ Logger.getLogger(BedWidthProcessor.class);
+
+ private final static String BEDHEIGHT = "bedheight";
+
+ public static final String I18N_AXIS_LABEL_DEFAULT
+ = "Gepeilte Breite [m]";
+ public static final String I18N_AXIS_LABEL =
+ "chart.bedheight_middle.sounding.yaxis.label";
+
+ @Override
+ public void doOut(
+ DiagramGenerator generator,
+ ArtifactAndFacet bundle,
+ ThemeDocument theme,
+ boolean visible) {
+ CallContext context = generator.getCallContext();
+ Object data = bundle.getData(context);
+ XYSeries series = new StyledXYSeries(bundle.getFacetDescription(),
+ theme);
+ if (data instanceof BedHeightSingle) {
+ BedHeightSingle bData = (BedHeightSingle)data;
+ double[] width = bData.getMorphWidths();
+ double[] stations = bData.getStations().toNativeArray();
+
+ logger.debug("doBedheightSingleOut");
+
+ for (int i = 0; i < width.length; i++) {
+ series.add(stations[i], width[i], false);
+ }
+ } else if (data instanceof List<?>) {
+ List<BedHeightSingleValue> bData = (List<BedHeightSingleValue>)data;
+
+ logger.debug("doBedheightSingleValueOut");
+
+ for(BedHeightSingleValue bvalue: bData) {
+ series.add(bvalue.getStation(), bvalue.getSoundingWidth());
+ }
+ }
+ generator.addAxisSeries(series, axisName, visible);
+ }
+
+ @Override
+ public void doOut(
+ XYChartGenerator generator,
+ ArtifactAndFacet bundle,
+ ThemeDocument theme,
+ boolean visible,
+ int index
+ ) {
+ CallContext context = generator.getCallContext();
+ Object data = bundle.getData(context);
+ XYSeries series = new StyledXYSeries(bundle.getFacetDescription(),
+ theme);
+ if (data instanceof BedHeightSingle) {
+ BedHeightSingle bData = (BedHeightSingle)data;
+ double[] width = bData.getMorphWidths();
+ double[] stations = bData.getStations().toNativeArray();
+
+ logger.debug("doBedheightSingleOut");
+
+ for (int i = 0; i < width.length; i++) {
+ series.add(stations[i], width[i], false);
+ }
+ } else if (data instanceof List<?>) {
+ List<BedHeightSingleValue> bData = (List<BedHeightSingleValue>)data;
+
+ logger.debug("doBedheightSingleValueOut");
+
+ for(BedHeightSingleValue bvalue: bData) {
+ series.add(bvalue.getStation(), bvalue.getSoundingWidth());
+ }
+ }
+ generator.addAxisSeries(series, index, visible);
+ }
+
+ @Override
+ public boolean canHandle(String facettype) {
+ return BEDHEIGHT.equals(facettype);
+ }
+
+ @Override
+ public String getAxisLabel(DiagramGenerator generator) {
+ return generator.msg(
+ I18N_AXIS_LABEL,
+ I18N_AXIS_LABEL_DEFAULT);
+ }
+}
diff -r 1106f580420c -r 917b26172853 artifacts/src/main/java/org/dive4elements/river/exports/process/BedheightProcessor.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/BedheightProcessor.java Wed Sep 25 11:47:45 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
- * Software engineering by Intevation GmbH
- *
- * This file is Free Software under the GNU AGPL (>=v3)
- * and comes with ABSOLUTELY NO WARRANTY! Check out the
- * documentation coming with Dive4Elements River for details.
- */
-
-package org.dive4elements.river.exports.process;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.jfree.data.xy.XYSeries;
-
-import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
-import org.dive4elements.artifacts.CallContext;
-import org.dive4elements.river.artifacts.model.minfo.BedHeightSingle;
-import org.dive4elements.river.exports.XYChartGenerator;
-import org.dive4elements.river.exports.DiagramGenerator;
-import org.dive4elements.river.jfree.StyledXYSeries;
-import org.dive4elements.river.model.BedHeightSingleValue;
-import org.dive4elements.river.themes.ThemeDocument;
-
-public class BedheightProcessor extends DefaultProcessor {
-
- private final static Logger logger =
- Logger.getLogger(BedheightProcessor.class);
-
- private final static String BEDHEIGHT = "bedheight";
-
- public static final String I18N_AXIS_LABEL_DEFAULT
- = "Gepeilte Breite [m]";
- public static final String I18N_AXIS_LABEL =
- "chart.bedheight_middle.sounding.yaxis.label";
-
- @Override
- public void doOut(
- DiagramGenerator generator,
- ArtifactAndFacet bundle,
- ThemeDocument theme,
- boolean visible) {
- CallContext context = generator.getCallContext();
- Object data = bundle.getData(context);
- XYSeries series = new StyledXYSeries(bundle.getFacetDescription(),
- theme);
- if (data instanceof BedHeightSingle) {
- BedHeightSingle bData = (BedHeightSingle)data;
- double[] width = bData.getMorphWidths();
- double[] stations = bData.getStations().toNativeArray();
-
- logger.debug("doBedheightSingleOut");
-
- for (int i = 0; i < width.length; i++) {
- series.add(stations[i], width[i], false);
- }
- } else if (data instanceof List<?>) {
- List<BedHeightSingleValue> bData = (List<BedHeightSingleValue>)data;
-
- logger.debug("doBedheightSingleValueOut");
-
- for(BedHeightSingleValue bvalue: bData) {
- series.add(bvalue.getStation(), bvalue.getSoundingWidth());
- }
- }
- generator.addAxisSeries(series, axisName, visible);
- }
-
- @Override
- public void doOut(
- XYChartGenerator generator,
- ArtifactAndFacet bundle,
- ThemeDocument theme,
- boolean visible,
- int index
- ) {
- CallContext context = generator.getCallContext();
- Object data = bundle.getData(context);
- XYSeries series = new StyledXYSeries(bundle.getFacetDescription(),
- theme);
- if (data instanceof BedHeightSingle) {
- BedHeightSingle bData = (BedHeightSingle)data;
- double[] width = bData.getMorphWidths();
- double[] stations = bData.getStations().toNativeArray();
-
- logger.debug("doBedheightSingleOut");
-
- for (int i = 0; i < width.length; i++) {
- series.add(stations[i], width[i], false);
- }
- } else if (data instanceof List<?>) {
- List<BedHeightSingleValue> bData = (List<BedHeightSingleValue>)data;
-
- logger.debug("doBedheightSingleValueOut");
-
- for(BedHeightSingleValue bvalue: bData) {
- series.add(bvalue.getStation(), bvalue.getSoundingWidth());
- }
- }
- generator.addAxisSeries(series, index, visible);
- }
-
- @Override
- public boolean canHandle(String facettype) {
- return BEDHEIGHT.equals(facettype);
- }
-
- @Override
- public String getAxisLabel(DiagramGenerator generator) {
- return generator.msg(
- I18N_AXIS_LABEL,
- I18N_AXIS_LABEL_DEFAULT);
- }
-}
More information about the Dive4elements-commits
mailing list