# HG changeset patch # User Andre Heinecke # Date 1379924687 -7200 # Node ID cdae0ff8960bd8b2d26da4585b312d42b7e09165 # Parent 6563262052abf0ebaa910aad24d8fedf8b7cb3f3 Add DiagramGenerator doOut function diff -r 6563262052ab -r cdae0ff8960b artifacts/src/main/java/org/dive4elements/river/exports/process/BedheightProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/BedheightProcessor.java Mon Sep 23 10:23:21 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/BedheightProcessor.java Mon Sep 23 10:24:47 2013 +0200 @@ -17,6 +17,7 @@ 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; @@ -30,6 +31,38 @@ @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,