Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java @ 6905:1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 22 Aug 2013 23:31:38 +0200 |
parents | 252806ee7dd1 |
children | e0311aa32efb |
comparison
equal
deleted
inserted
replaced
6904:d710bd3df387 | 6905:1b35b2ddfc28 |
---|---|
11 import java.util.Arrays; | 11 import java.util.Arrays; |
12 import java.util.Set; | 12 import java.util.Set; |
13 | 13 |
14 import org.apache.log4j.Logger; | 14 import org.apache.log4j.Logger; |
15 import org.jfree.data.xy.XYSeries; | 15 import org.jfree.data.xy.XYSeries; |
16 import org.w3c.dom.Document; | |
17 | 16 |
18 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; | 17 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; |
19 import org.dive4elements.artifactdatabase.state.Facet; | 18 import org.dive4elements.artifactdatabase.state.Facet; |
20 import org.dive4elements.river.artifacts.D4EArtifact; | 19 import org.dive4elements.river.artifacts.D4EArtifact; |
21 import org.dive4elements.river.artifacts.access.RangeAccess; | 20 import org.dive4elements.river.artifacts.access.RangeAccess; |
31 import org.dive4elements.river.exports.XYChartGenerator; | 30 import org.dive4elements.river.exports.XYChartGenerator; |
32 import org.dive4elements.river.jfree.Bounds; | 31 import org.dive4elements.river.jfree.Bounds; |
33 import org.dive4elements.river.jfree.DoubleBounds; | 32 import org.dive4elements.river.jfree.DoubleBounds; |
34 import org.dive4elements.river.jfree.RiverAnnotation; | 33 import org.dive4elements.river.jfree.RiverAnnotation; |
35 import org.dive4elements.river.jfree.StyledXYSeries; | 34 import org.dive4elements.river.jfree.StyledXYSeries; |
35 import org.dive4elements.river.themes.ThemeDocument; | |
36 import org.dive4elements.river.utils.DataUtil; | 36 import org.dive4elements.river.utils.DataUtil; |
37 | 37 |
38 | 38 |
39 /** Generator for Longitudinal Sections of SedimentLoad-Calculations. */ | 39 /** Generator for Longitudinal Sections of SedimentLoad-Calculations. */ |
40 public class SedimentLoadLSGenerator | 40 public class SedimentLoadLSGenerator |
92 } | 92 } |
93 }; | 93 }; |
94 } | 94 } |
95 | 95 |
96 @Override | 96 @Override |
97 public void doOut(ArtifactAndFacet bundle, Document attr, boolean visible) { | 97 public void doOut(ArtifactAndFacet bundle, ThemeDocument attr, boolean visible) { |
98 String name = bundle.getFacetName(); | 98 String name = bundle.getFacetName(); |
99 | 99 |
100 logger.debug("doOut: " + name); | 100 logger.debug("doOut: " + name); |
101 | 101 |
102 if (name == null) { | 102 if (name == null) { |
257 | 257 |
258 return label; | 258 return label; |
259 } | 259 } |
260 | 260 |
261 protected void doSedimentLoadOut(double[][] data, | 261 protected void doSedimentLoadOut(double[][] data, |
262 ArtifactAndFacet aandf, Document theme, boolean visible) { | 262 ArtifactAndFacet aandf, ThemeDocument theme, boolean visible) { |
263 | 263 |
264 // Allow for gaps (NaNs). | 264 // Allow for gaps (NaNs). |
265 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), false, theme); | 265 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), false, theme); |
266 StyledSeriesBuilder.addPoints(series, data, false); | 266 StyledSeriesBuilder.addPoints(series, data, false); |
267 | 267 |
268 addAxisSeries(series, YAXIS.L.idx, visible); | 268 addAxisSeries(series, YAXIS.L.idx, visible); |
269 } | 269 } |
270 | 270 |
271 protected void doSedimentLoadUnknownOut(SedimentLoad load, | 271 protected void doSedimentLoadUnknownOut(SedimentLoad load, |
272 ArtifactAndFacet aandf, Document theme, boolean visible) { | 272 ArtifactAndFacet aandf, ThemeDocument theme, boolean visible) { |
273 | 273 |
274 Set<Double> kms = load.getKms(); | 274 Set<Double> kms = load.getKms(); |
275 double[][] data = new double[2][kms.size()]; | 275 double[][] data = new double[2][kms.size()]; |
276 int counter = 0; | 276 int counter = 0; |
277 for (Double km: kms) { | 277 for (Double km: kms) { |
287 } | 287 } |
288 | 288 |
289 protected void doFlowVelocityMainOut( | 289 protected void doFlowVelocityMainOut( |
290 FlowVelocityData data, | 290 FlowVelocityData data, |
291 ArtifactAndFacet aandf, | 291 ArtifactAndFacet aandf, |
292 Document theme, | 292 ThemeDocument theme, |
293 boolean visible | 293 boolean visible |
294 ) { | 294 ) { |
295 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); | 295 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); |
296 StyledSeriesBuilder.addPoints(series, data.getMainChannelPoints(), true); | 296 StyledSeriesBuilder.addPoints(series, data.getMainChannelPoints(), true); |
297 | 297 |
299 } | 299 } |
300 | 300 |
301 protected void doFlowVelocityTotalOut( | 301 protected void doFlowVelocityTotalOut( |
302 FlowVelocityData data, | 302 FlowVelocityData data, |
303 ArtifactAndFacet aandf, | 303 ArtifactAndFacet aandf, |
304 Document theme, | 304 ThemeDocument theme, |
305 boolean visible | 305 boolean visible |
306 ) { | 306 ) { |
307 if (data == null) { | 307 if (data == null) { |
308 logger.warn("No data to add to FlowVelocity chart."); | 308 logger.warn("No data to add to FlowVelocity chart."); |
309 return; | 309 return; |
316 } | 316 } |
317 | 317 |
318 protected void doBedDifferenceYearOut( | 318 protected void doBedDifferenceYearOut( |
319 BedDiffYearResult data, | 319 BedDiffYearResult data, |
320 ArtifactAndFacet aandf, | 320 ArtifactAndFacet aandf, |
321 Document theme, | 321 ThemeDocument theme, |
322 boolean visible | 322 boolean visible |
323 ) { | 323 ) { |
324 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); | 324 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); |
325 StyledSeriesBuilder.addPoints(series, data.getDifferencesData(), true); | 325 StyledSeriesBuilder.addPoints(series, data.getDifferencesData(), true); |
326 | 326 |
328 } | 328 } |
329 | 329 |
330 protected void doBedDifferenceEpochOut( | 330 protected void doBedDifferenceEpochOut( |
331 BedDiffEpochResult data, | 331 BedDiffEpochResult data, |
332 ArtifactAndFacet aandf, | 332 ArtifactAndFacet aandf, |
333 Document theme, | 333 ThemeDocument theme, |
334 boolean visible | 334 boolean visible |
335 ) { | 335 ) { |
336 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); | 336 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); |
337 StyledSeriesBuilder.addPoints(series, data.getDifferencesData(), true); | 337 StyledSeriesBuilder.addPoints(series, data.getDifferencesData(), true); |
338 | 338 |
340 } | 340 } |
341 | 341 |
342 protected void doWDifferencesOut( | 342 protected void doWDifferencesOut( |
343 WKms wkms, | 343 WKms wkms, |
344 ArtifactAndFacet aandf, | 344 ArtifactAndFacet aandf, |
345 Document theme, | 345 ThemeDocument theme, |
346 boolean visible | 346 boolean visible |
347 ) { | 347 ) { |
348 if (wkms == null) { | 348 if (wkms == null) { |
349 logger.warn("No data to add to WDifferencesChart."); | 349 logger.warn("No data to add to WDifferencesChart."); |
350 return; | 350 return; |