comparison artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveGenerator.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 a3bf140ce739
children b64c263df4d1
comparison
equal deleted inserted replaced
6904:d710bd3df387 6905:1b35b2ddfc28
19 import org.dive4elements.river.exports.process.DischargeProcessor; 19 import org.dive4elements.river.exports.process.DischargeProcessor;
20 import org.dive4elements.river.jfree.RiverAnnotation; 20 import org.dive4elements.river.jfree.RiverAnnotation;
21 import org.dive4elements.river.jfree.StickyAxisAnnotation; 21 import org.dive4elements.river.jfree.StickyAxisAnnotation;
22 import org.dive4elements.river.jfree.StyledXYSeries; 22 import org.dive4elements.river.jfree.StyledXYSeries;
23 23
24 import org.dive4elements.river.themes.ThemeDocument;
24 import org.dive4elements.river.utils.RiverUtils; 25 import org.dive4elements.river.utils.RiverUtils;
25 26
26 import java.awt.Font; 27 import java.awt.Font;
27 28
28 import java.util.ArrayList; 29 import java.util.ArrayList;
30 31
31 import org.jfree.chart.axis.NumberAxis; 32 import org.jfree.chart.axis.NumberAxis;
32 import org.jfree.data.xy.XYSeries; 33 import org.jfree.data.xy.XYSeries;
33 34
34 import org.apache.log4j.Logger; 35 import org.apache.log4j.Logger;
35
36 import org.w3c.dom.Document;
37 36
38 37
39 /** 38 /**
40 * An OutGenerator that generates discharge curves, also at locations 39 * An OutGenerator that generates discharge curves, also at locations
41 * not at a gauge. 40 * not at a gauge.
139 * Process data, build up plot. 138 * Process data, build up plot.
140 */ 139 */
141 @Override 140 @Override
142 public void doOut( 141 public void doOut(
143 ArtifactAndFacet artifactFacet, 142 ArtifactAndFacet artifactFacet,
144 Document attr, 143 ThemeDocument attr,
145 boolean visible 144 boolean visible
146 ) { 145 ) {
147 String name = artifactFacet.getFacetName(); 146 String name = artifactFacet.getFacetName();
148 147
149 logger.debug("ComputedDischargeCurveGenerator.doOut: " + name); 148 logger.debug("ComputedDischargeCurveGenerator.doOut: " + name);
211 * @param wq data as double[][] 210 * @param wq data as double[][]
212 */ 211 */
213 protected void doWQOut( 212 protected void doWQOut(
214 Object wq, 213 Object wq,
215 ArtifactAndFacet aaf, 214 ArtifactAndFacet aaf,
216 Document theme, 215 ThemeDocument theme,
217 boolean visible 216 boolean visible
218 ) { 217 ) {
219 logger.debug("ComputedDischargeCurveGenerator: doWQOut"); 218 logger.debug("ComputedDischargeCurveGenerator: doWQOut");
220 double [][] data = (double [][]) wq; 219 double [][] data = (double [][]) wq;
221 220
232 * @param theme theme to use. 231 * @param theme theme to use.
233 */ 232 */
234 protected void doDischargeQOut( 233 protected void doDischargeQOut(
235 WQKms wqkms, 234 WQKms wqkms,
236 ArtifactAndFacet aaf, 235 ArtifactAndFacet aaf,
237 Document theme, 236 ThemeDocument theme,
238 boolean visible 237 boolean visible
239 ) { 238 ) {
240 logger.debug("ComputedDischargeCurveGenerator: doDischargeQOut"); 239 logger.debug("ComputedDischargeCurveGenerator: doDischargeQOut");
241 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); 240 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme);
242 241
264 * @param theme theme to use. 263 * @param theme theme to use.
265 */ 264 */
266 protected void doQOut( 265 protected void doQOut(
267 WQKms wqkms, 266 WQKms wqkms,
268 ArtifactAndFacet aaf, 267 ArtifactAndFacet aaf,
269 Document theme, 268 ThemeDocument theme,
270 boolean visible 269 boolean visible
271 ) { 270 ) {
272 logger.debug("ComputedDischargeCurveGenerator: doQOut (add W/Q data)."); 271 logger.debug("ComputedDischargeCurveGenerator: doQOut (add W/Q data).");
273 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); 272 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme);
274 StyledSeriesBuilder.addPointsQW(series, wqkms); 273 StyledSeriesBuilder.addPointsQW(series, wqkms);
283 * @param theme theme to use. 282 * @param theme theme to use.
284 */ 283 */
285 protected void doWQAnnotations( 284 protected void doWQAnnotations(
286 Object wqkms, 285 Object wqkms,
287 ArtifactAndFacet aandf, 286 ArtifactAndFacet aandf,
288 Document theme, 287 ThemeDocument theme,
289 boolean visible 288 boolean visible
290 ) { 289 ) {
291 List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>(); 290 List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>();
292 double [][] data = (double [][]) wqkms; 291 double [][] data = (double [][]) wqkms;
293 for (int i = 0; i< data[0].length; i++) { 292 for (int i = 0; i< data[0].length; i++) {
309 * @param theme theme to use. 308 * @param theme theme to use.
310 */ 309 */
311 protected void doWAnnotations( 310 protected void doWAnnotations(
312 Object wqkms, 311 Object wqkms,
313 ArtifactAndFacet aandf, 312 ArtifactAndFacet aandf,
314 Document theme, 313 ThemeDocument theme,
315 boolean visible 314 boolean visible
316 ) { 315 ) {
317 Facet facet = aandf.getFacet(); 316 Facet facet = aandf.getFacet();
318 317
319 List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>(); 318 List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>();

http://dive4elements.wald.intevation.org