Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceYearGenerator.java @ 6570:6435b3d7fb52
Refactored BedDifferenceYearGenerator to use new BedDiffYearProcessor.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 15 Jul 2013 14:42:09 +0200 |
parents | 28ab77bf7ece |
children | 4923bcf94581 |
comparison
equal
deleted
inserted
replaced
6569:28ab77bf7ece | 6570:6435b3d7fb52 |
---|---|
20 import org.dive4elements.river.artifacts.model.minfo.BedDiffYearResult; | 20 import org.dive4elements.river.artifacts.model.minfo.BedDiffYearResult; |
21 import org.dive4elements.river.artifacts.model.minfo.BedDifferencesResult; | 21 import org.dive4elements.river.artifacts.model.minfo.BedDifferencesResult; |
22 import org.dive4elements.river.artifacts.model.minfo.MorphologicWidth; | 22 import org.dive4elements.river.artifacts.model.minfo.MorphologicWidth; |
23 import org.dive4elements.river.exports.StyledSeriesBuilder; | 23 import org.dive4elements.river.exports.StyledSeriesBuilder; |
24 import org.dive4elements.river.exports.fixings.FixChartGenerator; | 24 import org.dive4elements.river.exports.fixings.FixChartGenerator; |
25 import org.dive4elements.river.exports.process.BedDiffYearProcessor; | |
26 import org.dive4elements.river.exports.process.BedDiffHeightYearProcessor; | |
25 import org.dive4elements.river.exports.process.KMIndexProcessor; | 27 import org.dive4elements.river.exports.process.KMIndexProcessor; |
26 import org.dive4elements.river.exports.process.Processor; | 28 import org.dive4elements.river.exports.process.Processor; |
27 import org.dive4elements.river.exports.process.WOutProcessor; | 29 import org.dive4elements.river.exports.process.WOutProcessor; |
28 import org.dive4elements.river.jfree.Bounds; | 30 import org.dive4elements.river.jfree.Bounds; |
29 import org.dive4elements.river.jfree.DoubleBounds; | 31 import org.dive4elements.river.jfree.DoubleBounds; |
108 setContextBounds(bundle); | 110 setContextBounds(bundle); |
109 } | 111 } |
110 | 112 |
111 Processor processor = new KMIndexProcessor(); | 113 Processor processor = new KMIndexProcessor(); |
112 Processor woutp = new WOutProcessor(); | 114 Processor woutp = new WOutProcessor(); |
113 if (name.equals(BED_DIFFERENCE_YEAR)) { | 115 Processor bdhyProcessor = new BedDiffHeightYearProcessor(); |
114 doBedDifferenceYearOut( | 116 Processor bdyProcessor = new BedDiffYearProcessor(); |
115 (BedDiffYearResult) bundle.getData(context), | 117 if (name.equals(BED_DIFFERENCE_MORPH_WIDTH)) { |
116 bundle, attr, visible); | |
117 } | |
118 else if (name.equals(BED_DIFFERENCE_MORPH_WIDTH)) { | |
119 doBedDifferenceMorphWidthOut( | 118 doBedDifferenceMorphWidthOut( |
120 (BedDiffYearResult) bundle.getData(context), | 119 (BedDiffYearResult) bundle.getData(context), |
121 bundle, attr, visible); | 120 bundle, attr, visible); |
122 } | |
123 else if (name.equals(BED_DIFFERENCE_YEAR_HEIGHT1)) { | |
124 doBedDifferenceHeightsOut( | |
125 (BedDiffYearResult)bundle.getData(context), | |
126 bundle, attr, visible, 0); | |
127 } | |
128 else if (name.equals(BED_DIFFERENCE_YEAR_HEIGHT2)) { | |
129 doBedDifferenceHeightsOut( | |
130 (BedDiffYearResult)bundle.getData(context), | |
131 bundle, attr, visible, 1); | |
132 } | |
133 else if (name.equals(BED_DIFFERENCE_YEAR_FILTERED)) { | |
134 doBedDifferenceYearOut( | |
135 (BedDiffYearResult) bundle.getData(context), | |
136 bundle, attr, visible); | |
137 } | |
138 else if (name.equals(BED_DIFFERENCE_YEAR_HEIGHT1_FILTERED)) { | |
139 doBedDifferenceHeightsOut( | |
140 (BedDiffYearResult)bundle.getData(context), | |
141 bundle, attr, visible, 0); | |
142 } | |
143 else if (name.equals(BED_DIFFERENCE_YEAR_HEIGHT2_FILTERED)) { | |
144 doBedDifferenceHeightsOut( | |
145 (BedDiffYearResult)bundle.getData(context), | |
146 bundle, attr, visible, 1); | |
147 } | 121 } |
148 else if (name.equals(MORPHOLOGIC_WIDTH)) { | 122 else if (name.equals(MORPHOLOGIC_WIDTH)) { |
149 doMorphologicWidthOut( | 123 doMorphologicWidthOut( |
150 (MorphologicWidth)bundle.getData(context), | 124 (MorphologicWidth)bundle.getData(context), |
151 bundle, | 125 bundle, |
160 doAnnotations( | 134 doAnnotations( |
161 (RiverAnnotation) bundle.getData(context), | 135 (RiverAnnotation) bundle.getData(context), |
162 bundle, | 136 bundle, |
163 attr, | 137 attr, |
164 visible); | 138 visible); |
139 } | |
140 else if (bdyProcessor.canHandle(name)) { | |
141 bdyProcessor.doOut(this, bundle, attr, visible, YAXIS.D.idx); | |
142 } | |
143 else if (bdhyProcessor.canHandle(name)) { | |
144 bdhyProcessor.doOut(this, bundle, attr, visible, YAXIS.D.idx); | |
165 } | 145 } |
166 else if (woutp.canHandle(name)) { | 146 else if (woutp.canHandle(name)) { |
167 woutp.doOut(this, bundle, attr, visible, YAXIS.W.idx); | 147 woutp.doOut(this, bundle, attr, visible, YAXIS.W.idx); |
168 } | 148 } |
169 else if (name.equals(W_DIFFERENCES)) { | 149 else if (name.equals(W_DIFFERENCES)) { |
247 } | 227 } |
248 | 228 |
249 return label; | 229 return label; |
250 } | 230 } |
251 | 231 |
252 protected void doBedDifferenceYearOut(BedDiffYearResult data, | |
253 ArtifactAndFacet aandf, Document theme, boolean visible) { | |
254 logger.debug("doBedDifferenceYearOut()"); | |
255 | |
256 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); | |
257 StyledSeriesBuilder.addPoints(series, data.getDifferencesData(), true); | |
258 | |
259 addAxisSeries(series, YAXIS.D.idx, visible); | |
260 } | |
261 | 232 |
262 protected void doBedDifferenceMorphWidthOut(BedDiffYearResult data, | 233 protected void doBedDifferenceMorphWidthOut(BedDiffYearResult data, |
263 ArtifactAndFacet aandf, Document theme, boolean visible) { | 234 ArtifactAndFacet aandf, Document theme, boolean visible) { |
264 logger.debug("doBedDifferencesMorphWidthOut()"); | 235 logger.debug("doBedDifferencesMorphWidthOut()"); |
265 | 236 |