Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/process/DischargeProcessor.java @ 6878:9b35bf3227e9
Initial DischargeProcessor-commit (skeleton).
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 20 Aug 2013 13:03:03 +0200 |
parents | |
children | 8a4e344b309a |
comparison
equal
deleted
inserted
replaced
6877:2d96d8240e3e | 6878:9b35bf3227e9 |
---|---|
1 /* Copyright (C) 2011, 2012, 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 import org.w3c.dom.Document; | |
14 | |
15 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; | |
16 import org.dive4elements.artifacts.CallContext; | |
17 import org.dive4elements.river.artifacts.model.FacetTypes; | |
18 import org.dive4elements.river.artifacts.model.WQKms; | |
19 import org.dive4elements.river.exports.StyledSeriesBuilder; | |
20 import org.dive4elements.river.exports.XYChartGenerator; | |
21 import org.dive4elements.river.jfree.StyledXYSeries; | |
22 | |
23 | |
24 /** Helper for data handling in discharge diagrams. */ | |
25 public class DischargeProcessor | |
26 implements Processor, FacetTypes { | |
27 | |
28 private final static Logger logger = | |
29 Logger.getLogger(DischargeProcessor.class); | |
30 | |
31 | |
32 /** Process data, add it to plot. */ | |
33 @Override | |
34 public void doOut( | |
35 XYChartGenerator generator, | |
36 ArtifactAndFacet aandf, | |
37 Document theme, | |
38 boolean visible, | |
39 int index | |
40 ) { | |
41 CallContext context = generator.getCallContext(); | |
42 Object data = aandf.getData(context); | |
43 if (data instanceof WQKms) { | |
44 // TODO: Fetch point | |
45 return; | |
46 } | |
47 logger.error("Can't process " + data.getClass().getName() + " objects"); | |
48 } | |
49 | |
50 | |
51 /** True if this processor knows how to deal with facetType. */ | |
52 @Override | |
53 public boolean canHandle(String facetType) { | |
54 return BED_DIFFERENCE_HEIGHT_YEAR.equals(facetType); | |
55 } | |
56 | |
57 | |
58 /** TODO Handle WQKms point data. */ | |
59 protected void doWQKmsPointOut(XYChartGenerator generator, | |
60 WQKms data, | |
61 ArtifactAndFacet aandf, | |
62 Document theme, | |
63 boolean visible, | |
64 int axidx) { | |
65 | |
66 /* | |
67 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); | |
68 StyledSeriesBuilder.addPoints(series, data.getHeightPerYearData(), false, GAP_TOLERANCE); | |
69 | |
70 generator.addAxisSeries(series, axidx, visible); | |
71 */ | |
72 } | |
73 } | |
74 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |