# HG changeset patch # User Andre Heinecke # Date 1380107385 -7200 # Node ID b6595716f5f0083a75d321bdf08aa1638737346f # Parent 053e39436ba3ff069ef8545f19e8d74d224bd0bb Rename BedWidthProcessor to BedHeightSounding processor. This processor takes bedheight data and extracts the sounding information for the diagram. diff -r 053e39436ba3 -r b6595716f5f0 artifacts/doc/conf/generators.xml --- a/artifacts/doc/conf/generators.xml Wed Sep 25 12:36:19 2013 +0200 +++ b/artifacts/doc/conf/generators.xml Wed Sep 25 13:09:45 2013 +0200 @@ -29,7 +29,7 @@ - + @@ -58,7 +58,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -112,7 +112,7 @@ - + @@ -140,7 +140,7 @@ - + diff -r 053e39436ba3 -r b6595716f5f0 artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator.java Wed Sep 25 12:36:19 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator.java Wed Sep 25 13:09:45 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.BedWidthProcessor; +import org.dive4elements.river.exports.process.BedHeightSoundingProcessor; 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 BedWidthProcessor(); + Processor bedp = new BedHeightSoundingProcessor(); Processor bdyProcessor = new BedDiffYearProcessor(); Processor bdhyProcessor = new BedDiffHeightYearProcessor(); Processor annotationProcessor = new AnnotationProcessor(); diff -r 053e39436ba3 -r b6595716f5f0 artifacts/src/main/java/org/dive4elements/river/exports/process/BedHeightSoundingProcessor.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/BedHeightSoundingProcessor.java Wed Sep 25 13:09:45 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 BedHeightSoundingProcessor extends DefaultProcessor { + + private final static Logger logger = + Logger.getLogger(BedHeightSoundingProcessor.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 bData = (List)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 bData = (List)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 053e39436ba3 -r b6595716f5f0 artifacts/src/main/java/org/dive4elements/river/exports/process/BedWidthProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/BedWidthProcessor.java Wed Sep 25 12:36:19 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 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 bData = (List)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 bData = (List)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); - } -}