Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/process/SedimentLoadLSProcessor.java @ 8204:c657ddcf1fa6
Sediment loads at measurement stations and longitudinal sections need different processing and styling for diagrams.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 14:53:58 +0200 |
parents | artifacts/src/main/java/org/dive4elements/river/exports/process/SedimentLoadProcessor.java@e4606eae8ea5 |
children | 1cc7653ca84f 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8203:238fc722f87a | 8204:c657ddcf1fa6 |
---|---|
1 /* Copyright (C) 2013 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU AGPL (>=v3) | |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
6 * documentation coming with Dive4Elements River for details. | |
7 */ | |
8 | |
9 package org.dive4elements.river.exports.process; | |
10 | |
11 import org.apache.log4j.Logger; | |
12 import org.jfree.data.xy.XYSeries; | |
13 | |
14 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; | |
15 import org.dive4elements.artifacts.CallContext; | |
16 import org.dive4elements.river.exports.DiagramGenerator; | |
17 import org.dive4elements.river.exports.StyledSeriesBuilder; | |
18 import org.dive4elements.river.jfree.StyledXYSeries; | |
19 import org.dive4elements.river.themes.ThemeDocument; | |
20 | |
21 // Base class for SedimantLoad$UNITProcessors | |
22 public class SedimentLoadLSProcessor extends DefaultProcessor | |
23 { | |
24 private final static Logger log = | |
25 Logger.getLogger(SedimentLoadProcessor.class); | |
26 | |
27 @Override | |
28 public void doOut( | |
29 DiagramGenerator generator, | |
30 ArtifactAndFacet bundle, | |
31 ThemeDocument theme, | |
32 boolean visible) { | |
33 log.debug("doOut " + bundle.getFacetName()); | |
34 CallContext context = generator.getCallContext(); | |
35 XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), | |
36 false, // Handle NaN | |
37 theme); | |
38 Object data = bundle.getData(context); | |
39 String facetName = bundle.getFacetName(); | |
40 double [][] points; | |
41 | |
42 log.debug("Do out for: " + facetName); | |
43 if (facetName.startsWith("sedimentload.")) { | |
44 points = (double[][]) data; | |
45 } else { | |
46 log.error("Unknown facet name: " + facetName); | |
47 return; | |
48 } | |
49 | |
50 StyledSeriesBuilder.addPoints(series, points, false); // Keep NaN | |
51 | |
52 generator.addAxisSeries(series, axisName, visible); | |
53 } | |
54 } | |
55 |