Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/process/ShearStressProcessor.java @ 7165:6e42f0ff0329
Add ShearStress Processor
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 26 Sep 2013 12:21:11 +0200 |
parents | |
children | 46ba37c22d9f |
comparison
equal
deleted
inserted
replaced
7164:440c55b9634e | 7165:6e42f0ff0329 |
---|---|
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 java.util.List; | |
12 import java.util.Set; | |
13 | |
14 import org.apache.log4j.Logger; | |
15 import org.jfree.data.xy.XYSeries; | |
16 import org.dive4elements.river.artifacts.D4EArtifact; | |
17 | |
18 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; | |
19 import org.dive4elements.artifacts.CallContext; | |
20 import org.dive4elements.river.artifacts.access.SedimentLoadAccess; | |
21 import org.dive4elements.river.artifacts.model.FacetTypes; | |
22 import org.dive4elements.river.exports.DiagramGenerator; | |
23 import org.dive4elements.river.exports.StyledSeriesBuilder; | |
24 import org.dive4elements.river.jfree.StyledXYSeries; | |
25 import org.dive4elements.river.themes.ThemeDocument; | |
26 | |
27 import org.dive4elements.river.artifacts.model.FlowVelocityData; | |
28 | |
29 public class ShearStressProcessor extends DefaultProcessor { | |
30 | |
31 private final static Logger logger = | |
32 Logger.getLogger(ShearStressProcessor.class); | |
33 | |
34 public static final String I18N_AXIS_LABEL = | |
35 "chart.flow_velocity.section.yaxis.third.label"; | |
36 public static final String I18N_AXIS_LABEL_DEFAULT = | |
37 "Schubspannung Tau [N]"; | |
38 | |
39 @Override | |
40 public void doOut( | |
41 DiagramGenerator generator, | |
42 ArtifactAndFacet bundle, | |
43 ThemeDocument theme, | |
44 boolean visible) { | |
45 CallContext context = generator.getCallContext(); | |
46 XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), | |
47 theme); | |
48 String facetName = bundle.getFacetName(); | |
49 FlowVelocityData data = (FlowVelocityData) bundle.getData(context); | |
50 | |
51 StyledSeriesBuilder.addPoints(series, data.getTauPoints(), true); | |
52 | |
53 generator.addAxisSeries(series, axisName, visible); | |
54 } | |
55 | |
56 @Override | |
57 public boolean canHandle(String facettype) { | |
58 return facettype.equals(FacetTypes.FLOW_VELOCITY_TAU) || | |
59 facettype.equals(FacetTypes.FLOW_VELOCITY_TAU_FILTERED); | |
60 } | |
61 | |
62 @Override | |
63 public String getAxisLabel(DiagramGenerator generator) { | |
64 return generator.msg( | |
65 I18N_AXIS_LABEL, | |
66 I18N_AXIS_LABEL_DEFAULT); | |
67 } | |
68 } | |
69 |