Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/WDifferencesCurveGenerator.java @ 6597:27f5182996ea
issue1395: Let WDifferencesCurveGenerator use Beddiff-processors to display beddiff data.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 18 Jul 2013 12:47:21 +0200 |
parents | 8d1d90adc652 |
children | aee8cb5c801a |
comparison
equal
deleted
inserted
replaced
6596:8d1d90adc652 | 6597:27f5182996ea |
---|---|
14 import org.dive4elements.artifactdatabase.state.Facet; | 14 import org.dive4elements.artifactdatabase.state.Facet; |
15 | 15 |
16 import org.dive4elements.river.artifacts.model.FacetTypes; | 16 import org.dive4elements.river.artifacts.model.FacetTypes; |
17 import org.dive4elements.river.artifacts.model.WKms; | 17 import org.dive4elements.river.artifacts.model.WKms; |
18 | 18 |
19 import org.dive4elements.river.exports.StyledSeriesBuilder; | |
20 import org.dive4elements.river.jfree.StyledXYSeries; | |
21 import org.dive4elements.river.artifacts.model.minfo.MorphologicWidth; | |
22 | |
23 | |
24 import org.dive4elements.river.exports.process.BedDiffYearProcessor; | |
25 import org.dive4elements.river.exports.process.BedDiffHeightYearProcessor; | |
26 import org.dive4elements.river.exports.process.BedheightProcessor; | |
27 import org.dive4elements.river.exports.process.Processor; | |
28 | |
19 import org.jfree.chart.JFreeChart; | 29 import org.jfree.chart.JFreeChart; |
20 import org.jfree.chart.plot.XYPlot; | 30 import org.jfree.chart.plot.XYPlot; |
31 import org.jfree.data.xy.XYSeries; | |
32 import org.w3c.dom.Document; | |
21 | 33 |
22 | 34 |
23 /** | 35 /** |
24 * An OutGenerator that generates w differences curves. | 36 * An OutGenerator that generates w differences curves. |
25 */ | 37 */ |
91 protected String getChartSubtitleKey() { | 103 protected String getChartSubtitleKey() { |
92 return I18N_WDIFF_SUBTITLE; | 104 return I18N_WDIFF_SUBTITLE; |
93 } | 105 } |
94 | 106 |
95 | 107 |
108 /** Handle additional facets (beddifferences). */ | |
109 @Override | |
110 public void doOut(ArtifactAndFacet bundle, Document attr, boolean visible) { | |
111 super.doOut(bundle, attr, visible); | |
112 | |
113 String name = bundle.getFacetName(); | |
114 logger.debug("doOut: " + name); | |
115 | |
116 if (name == null) { | |
117 logger.error("No facet name for doOut(). No output generated!"); | |
118 return; | |
119 } | |
120 | |
121 Facet facet = bundle.getFacet(); | |
122 | |
123 if (facet == null) { | |
124 return; | |
125 } | |
126 | |
127 Processor bedp = new BedheightProcessor(); | |
128 Processor bdyProcessor = new BedDiffYearProcessor(); | |
129 Processor bdhyProcessor = new BedDiffHeightYearProcessor(); | |
130 | |
131 if (bedp.canHandle(name)) { | |
132 bedp.doOut(this, bundle, attr, visible, YAXIS.W.idx); | |
133 } | |
134 else if (bdyProcessor.canHandle(name)) { | |
135 bdyProcessor.doOut(this, bundle, attr, visible, YAXIS.W.idx); | |
136 } | |
137 else if (bdhyProcessor.canHandle(name)) { | |
138 bdhyProcessor.doOut(this, bundle, attr, visible, YAXIS.W.idx); | |
139 } | |
140 else { | |
141 logger.warn("WDifferencesCurveGenerator.doOut: unknown facet type " + name); | |
142 } | |
143 } | |
144 | |
145 | |
96 /** | 146 /** |
97 * | 147 * Sets the zero base line visible. |
98 */ | 148 */ |
99 @Override | 149 @Override |
100 public JFreeChart generateChart() { | 150 public JFreeChart generateChart() { |
101 JFreeChart chart = super.generateChart(); | 151 JFreeChart chart = super.generateChart(); |
102 if (chart != null && chart.getPlot() != null) { | 152 if (chart != null && chart.getPlot() != null) { |