annotate artifacts/src/main/java/org/dive4elements/river/exports/process/FixWQProcessor.java @ 8856:5e38e2924c07 3.2.x

Fix code style.
author Tom Gottfried <tom@intevation.de>
date Thu, 18 Jan 2018 20:12:01 +0100
parents 07df414d5d88
children a805211690f7
rev   line source
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
1 package org.dive4elements.river.exports.process;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
2
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
3 import java.awt.BasicStroke;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
4 import java.awt.Color;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
5 import java.text.DateFormat;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
6 import java.util.ArrayList;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
7 import java.util.List;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
8
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
9 import org.apache.log4j.Logger;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
10 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
8354
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
11 import org.dive4elements.artifacts.CallMeta;
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
12 import org.dive4elements.river.artifacts.D4EArtifact;
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
13 import org.dive4elements.river.artifacts.access.RiverAccess;
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
14 import org.dive4elements.river.artifacts.model.FacetTypes;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
15 import org.dive4elements.river.artifacts.model.NamedDouble;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
16 import org.dive4elements.river.artifacts.model.QWDDateRange;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
17 import org.dive4elements.river.artifacts.model.WQKms;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
18 import org.dive4elements.river.artifacts.model.fixings.FixFunction;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
19 import org.dive4elements.river.artifacts.model.fixings.FixWQCurveFacet;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
20 import org.dive4elements.river.artifacts.model.fixings.QWD;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
21 import org.dive4elements.river.artifacts.model.fixings.QWI;
8354
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
22 import org.dive4elements.river.artifacts.resources.Resources;
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
23 import org.dive4elements.river.exports.DiagramGenerator;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
24 import org.dive4elements.river.exports.StyledSeriesBuilder;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
25 import org.dive4elements.river.java2d.ShapeUtils;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
26 import org.dive4elements.river.jfree.CollisionFreeXYTextAnnotation;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
27 import org.dive4elements.river.jfree.JFreeUtil;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
28 import org.dive4elements.river.jfree.RiverAnnotation;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
29 import org.dive4elements.river.jfree.StickyAxisAnnotation;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
30 import org.dive4elements.river.jfree.StyledXYSeries;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
31 import org.dive4elements.river.themes.ThemeDocument;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
32 import org.jfree.chart.annotations.XYTextAnnotation;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
33 import org.jfree.chart.plot.Marker;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
34 import org.jfree.chart.plot.ValueMarker;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
35 import org.jfree.data.xy.XYSeries;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
36 import org.jfree.ui.RectangleAnchor;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
37 import org.jfree.ui.RectangleInsets;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
38 import org.jfree.ui.TextAnchor;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
39
8364
abef2584c9a7 Fetch current km from context (and remove obsolete or superfluous comments and logging).
Tom Gottfried <tom@intevation.de>
parents: 8354
diff changeset
40 import static org.dive4elements.river.exports.injector.InjectorConstants.CURRENT_KM;
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
41
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
42 public class FixWQProcessor
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
43 extends DefaultProcessor
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
44 implements FacetTypes
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
45 {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
46
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
47 private static Logger log = Logger.getLogger(FixWQProcessor.class);
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
48
8354
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
49 private String I18N_AXIS_LABEL = "chart.discharge.curve.yaxis.label";
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
50
8370
e1ff1263d79a Fixed W/Q diagram subtitle in fix analysis.
Raimund Renkert <rrenkert@intevation.de>
parents: 8354
diff changeset
51
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
52 public FixWQProcessor() {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
53 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
54
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
55 @Override
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
56 public void doOut(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
57 DiagramGenerator generator,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
58 ArtifactAndFacet bundle,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
59 ThemeDocument theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
60 boolean visible
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
61 ) {
8364
abef2584c9a7 Fetch current km from context (and remove obsolete or superfluous comments and logging).
Tom Gottfried <tom@intevation.de>
parents: 8354
diff changeset
62 // TODO: Simplify this processor and move general facets/data to
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
63 // MiscDischargeProcessor or something...
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
64 String facetType = bundle.getFacetName();
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
65 log.debug("facet: " + facetType
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
66 + " name: " + bundle.getFacetDescription());
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
67 if(facetType.startsWith(FIX_SECTOR_AVERAGE_WQ)) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
68 doSectorAverageOut(generator, bundle, theme, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
69 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
70 else if(FIX_ANALYSIS_EVENTS_WQ.equals(facetType)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
71 || FIX_REFERENCE_EVENTS_WQ.equals(facetType)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
72 || FIX_EVENTS.equals(facetType)) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
73 doEventsOut(generator, bundle, theme, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
74 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
75 else if(FIX_WQ_CURVE.equals(facetType)) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
76 doWQCurveOut(generator, bundle, theme, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
77 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
78 else if(FIX_OUTLIER.equals(facetType)) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
79 doOutlierOut(generator, bundle, theme, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
80 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
81 else if(QSECTOR.equals(facetType)) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
82 doQSectorOut(generator, bundle, theme, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
83 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
84 else if(STATIC_WKMS_MARKS.equals(facetType) ||
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
85 STATIC_WKMS.equals(facetType) ||
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
86 HEIGHTMARKS_POINTS.equals(facetType) ) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
87 doWAnnotations(generator, bundle, theme, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
88 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
89 else if (LONGITUDINAL_W.equals(facetType)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
90 || STATIC_WKMS_INTERPOL.equals(facetType)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
91 || FIX_WQ_LS.equals(facetType)) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
92 doWQOut(generator, bundle, theme, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
93 }
8387
8c60595fd74c Unify discharge curve subtitles.
Tom Gottfried <tom@intevation.de>
parents: 8375
diff changeset
94
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
95 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
96
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
97 /** Add sector average points to chart. */
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
98 protected void doSectorAverageOut(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
99 DiagramGenerator generator,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
100 ArtifactAndFacet bundle,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
101 ThemeDocument theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
102 boolean visible
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
103 ) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
104 log.debug("doSectorAverageOut");
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
105 QWDDateRange qwdd = (QWDDateRange)bundle.getData(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
106 generator.getCallContext());
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
107 QWD qwd = qwdd != null ? qwdd.getQWD() : null;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
108
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
109 if(qwd != null) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
110 XYSeries series = new StyledXYSeries(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
111 bundle.getFacetDescription(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
112 false, true,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
113 theme);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
114 DateFormat dateFormat = DateFormat.getDateInstance(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
115 DateFormat.SHORT);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
116
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
117 series.add(qwd.getQ(), qwd.getW(), false);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
118
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
119 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
120 dateFormat.format(qwd.getDate()),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
121 qwd.getQ(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
122 qwd.getW());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
123 List<XYTextAnnotation> annos = new ArrayList<XYTextAnnotation>();
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
124 annos.add(anno);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
125 generator.addAxisSeries(series, axisName, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
126
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
127 if (visible && theme != null && theme.parseShowPointLabel()) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
128 RiverAnnotation flysAnno =
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
129 new RiverAnnotation(null, null, null, theme);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
130 flysAnno.setTextAnnotations(annos);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
131 generator.addAnnotations(flysAnno);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
132 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
133 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
134 else {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
135 log.debug("doSectorAverageOut: qwd == null");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
136 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
137 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
138
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
139
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
140 /** Add analysis event points to chart. */
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
141 protected void doEventsOut(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
142 DiagramGenerator generator,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
143 ArtifactAndFacet bundle,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
144 ThemeDocument theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
145 boolean visible
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
146 ) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
147 log.debug("doAnalysisEventsOut");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
148
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
149 QWD qwd = (QWD)bundle.getData(generator.getCallContext());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
150
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
151 if (qwd == null) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
152 log.debug("doAnalysisEventsOut: qwd == null");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
153 return;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
154 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
155
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
156 // Force empty symbol.
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
157 if (qwd.getInterpolated()) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
158 theme = new ThemeDocument(theme); // prevent potential side effects
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
159 theme.setValue(ThemeDocument.USE_FILL_PAINT, "true");
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
160 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
161
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
162 XYSeries series = new StyledXYSeries(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
163 bundle.getFacetDescription(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
164 theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
165 qwd.getInterpolated()
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
166 ? ShapeUtils.INTERPOLATED_SHAPE
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
167 : ShapeUtils.MEASURED_SHAPE);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
168
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
169 series.add(qwd.getQ(), qwd.getW());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
170
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
171 generator.addAxisSeries(series, axisName, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
172
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
173 if (visible && theme.parseShowPointLabel()) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
174
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
175 List<XYTextAnnotation> textAnnos =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
176 new ArrayList<XYTextAnnotation>();
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
177
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
178 DateFormat dateFormat = DateFormat.getDateInstance(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
179 DateFormat.SHORT);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
180 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
181 dateFormat.format(qwd.getDate()),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
182 qwd.getQ(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
183 qwd.getW());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
184 textAnnos.add(anno);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
185
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
186 RiverAnnotation flysAnno =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
187 new RiverAnnotation(null, null, null, theme);
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
188 flysAnno.setTextAnnotations(textAnnos);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
189 generator.addAnnotations(flysAnno);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
190 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
191 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
192
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
193 /** Add reference event points to chart. */
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
194 protected void doReferenceEventsOut(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
195 DiagramGenerator generator,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
196 ArtifactAndFacet bundle,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
197 ThemeDocument theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
198 boolean visible) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
199 log.debug("doReferenceEventsOut");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
200
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
201 QWI qwd = (QWI)bundle.getData(generator.getCallContext());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
202 if (qwd == null) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
203 log.debug("doReferenceEventsOut: qwds == null in "
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
204 + bundle.getFacetDescription());
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
205 return;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
206 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
207
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
208 // Force empty symbol.
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
209 if (qwd.getInterpolated()) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
210 theme = new ThemeDocument(theme); // prevent potential side effects
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
211 theme.setValue(ThemeDocument.USE_FILL_PAINT, "true");
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
212 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
213
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
214 XYSeries series = new StyledXYSeries(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
215 bundle.getFacetDescription(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
216 false, true, theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
217 qwd.getInterpolated()
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
218 ? ShapeUtils.INTERPOLATED_SHAPE
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
219 : ShapeUtils.MEASURED_SHAPE);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
220
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
221 series.add(qwd.getQ(), qwd.getW(), false);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
222
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
223 if (visible && theme.parseShowPointLabel()) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
224 DateFormat dateFormat = DateFormat.getDateInstance(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
225 DateFormat.SHORT);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
226
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
227 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
228 dateFormat.format(qwd.getDate()),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
229 qwd.getQ(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
230 qwd.getW());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
231
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
232 List<XYTextAnnotation> textAnnos =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
233 new ArrayList<XYTextAnnotation>();
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
234 textAnnos.add(anno);
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
235 RiverAnnotation flysAnno =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
236 new RiverAnnotation(null, null, null, theme);
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
237 flysAnno.setTextAnnotations(textAnnos);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
238 generator.addAnnotations(flysAnno);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
239 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
240
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
241 generator.addAxisSeries(series, axisName, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
242 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
243
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
244 protected void doWQCurveOut(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
245 DiagramGenerator generator,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
246 ArtifactAndFacet bundle,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
247 ThemeDocument theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
248 boolean visible
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
249 ) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
250 log.debug("doWQCurveOut");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
251
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
252 FixWQCurveFacet facet = (FixWQCurveFacet)bundle.getFacet();
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
253 FixFunction func = (FixFunction)facet.getData(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
254 bundle.getArtifact(), generator.getCallContext());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
255
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
256 if (func == null) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
257 log.warn("doWQCurveOut: Facet does not contain FixFunction");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
258 return;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
259 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
260
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
261 double maxQ = func.getMaxQ();
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
262
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
263 if (maxQ > 0) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
264 StyledXYSeries series = JFreeUtil.sampleFunction2D(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
265 func.getFunction(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
266 theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
267 bundle.getFacetDescription(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
268 500, // number of samples
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
269 0.0 , // start
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
270 maxQ); // end
8375
0faa82973f60 Re-add line previously removed accidentally between lots of comments.
Tom Gottfried <tom@intevation.de>
parents: 8372
diff changeset
271
0faa82973f60 Re-add line previously removed accidentally between lots of comments.
Tom Gottfried <tom@intevation.de>
parents: 8372
diff changeset
272 generator.addAxisSeries(series, axisName, visible);
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
273 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
274 else {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
275 log.warn("doWQCurveOut: maxQ <= 0");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
276 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
277 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
278
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
279 protected void doOutlierOut(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
280 DiagramGenerator generator,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
281 ArtifactAndFacet bundle,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
282 ThemeDocument theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
283 boolean visible
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
284 ) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
285 log.debug("doOutlierOut");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
286
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
287 QWI[] qws = (QWI[])bundle.getData(generator.getCallContext());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
288 if(qws != null) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
289 XYSeries series = new StyledXYSeries(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
290 bundle.getFacetDescription(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
291 false, true,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
292 theme);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
293 DateFormat dateFormat = DateFormat.getDateInstance(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
294 DateFormat.SHORT);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
295
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
296 List<XYTextAnnotation> annos = new ArrayList<XYTextAnnotation>();
8364
abef2584c9a7 Fetch current km from context (and remove obsolete or superfluous comments and logging).
Tom Gottfried <tom@intevation.de>
parents: 8354
diff changeset
297
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
298 for (QWI qw: qws) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
299 series.add(qw.getQ(), qw.getW(), false);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
300
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
301 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
302 dateFormat.format(qw.getDate()),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
303 qw.getQ(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
304 qw.getW());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
305 annos.add(anno);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
306 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
307 generator.addAxisSeries(series, axisName, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
308
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
309 if (visible && theme != null && theme.parseShowPointLabel()) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
310 RiverAnnotation flysAnno =
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
311 new RiverAnnotation(null, null, null, theme);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
312 flysAnno.setTextAnnotations(annos);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
313 generator.addAnnotations(flysAnno);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
314 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
315 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
316 else {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
317 log.debug("doOutlierOut: qwd == null");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
318 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
319 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
320
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
321 /** Add markers for q sectors. */
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
322 protected void doQSectorOut(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
323 DiagramGenerator generator,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
324 ArtifactAndFacet bundle,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
325 ThemeDocument theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
326 boolean visible
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
327 ) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
328 log.debug("doQSectorOut");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
329 if (!visible) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
330 return;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
331 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
332
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
333 Object qsectorsObj = bundle.getData(generator.getCallContext());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
334 if (qsectorsObj == null || !(qsectorsObj instanceof List)) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
335 log.warn("No QSectors coming from data.");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
336 return;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
337 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
338
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
339 List<?> qsectorsList = (List<?>) qsectorsObj;
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
340 if (qsectorsList.size() == 0
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
341 || !(qsectorsList.get(0) instanceof NamedDouble)
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
342 ) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
343 log.warn("No QSectors coming from data.");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
344 return;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
345 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
346
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
347 @SuppressWarnings("unchecked")
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
348 List<NamedDouble> qsectors = (List<NamedDouble>) qsectorsList;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
349
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
350 for (NamedDouble qsector : qsectors) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
351 if (Double.isNaN(qsector.getValue())) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
352 continue;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
353 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
354 Marker m = new ValueMarker(qsector.getValue());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
355 m.setPaint(Color.black);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
356
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
357 float[] dashes = theme.parseLineStyle();
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
358 int size = theme.parseLineWidth();
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
359 BasicStroke stroke;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
360 if (dashes.length <= 1) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
361 stroke = new BasicStroke(size);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
362 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
363 else {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
364 stroke = new BasicStroke(size,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
365 BasicStroke.CAP_BUTT,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
366 BasicStroke.JOIN_ROUND,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
367 1.0f,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
368 dashes,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
369 0.0f);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
370 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
371 m.setStroke(stroke);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
372
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
373 if (theme.parseShowLineLabel()) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
374 m.setLabel(qsector.getName());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
375 m.setPaint(theme.parseTextColor());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
376 m.setLabelFont(theme.parseTextFont());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
377 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
378 Color paint = theme.parseLineColorField();
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
379 if (paint != null) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
380 m.setPaint(paint);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
381 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
382 m.setLabelAnchor(RectangleAnchor.TOP_LEFT);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
383 m.setLabelTextAnchor(TextAnchor.TOP_LEFT);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
384 m.setLabelOffset(new RectangleInsets(5, 5, 10, 10));
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
385 generator.addDomainMarker(m);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
386 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
387 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
388
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
389 /**
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
390 * Add W-Annotations to plot.
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
391 * @param wqkms actual data (double[][]).
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
392 * @param theme theme to use.
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
393 */
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
394 protected void doWAnnotations(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
395 DiagramGenerator generator,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
396 ArtifactAndFacet bundle,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
397 ThemeDocument theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
398 boolean visible
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
399 ) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
400 Object data = bundle.getData(generator.getCallContext());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
401 List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>();
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
402 if (data instanceof double[][]) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
403 log.debug("Got double[][]");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
404 double [][] values = (double [][]) data;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
405 for (int i = 0; i< values[0].length; i++) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
406 xy.add(new StickyAxisAnnotation(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
407 bundle.getFacetDescription(),
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
408 (float) values[1][i],
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
409 StickyAxisAnnotation.SimpleAxis.Y_AXIS));
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
410 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
411
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
412 if (visible) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
413 generator.addAnnotations(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
414 new RiverAnnotation(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
415 bundle.getFacetDescription(), xy, null, theme));
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
416 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
417 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
418 else {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
419 // Assume its WKms.
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
420 log.debug("Got WKms");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
421 /* TODO
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
422 WKms wkms = (WKms) data;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
423
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
424 Double ckm =
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
425 (Double)generator.getCallContext().getContextValue(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
426 FixChartGenerator.CURRENT_KM);
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
427 double location = (ckm != null)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
428 ? ckm.doubleValue()
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
429 : getRange()[0];
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
430 double w = StaticWKmsArtifact.getWAtKmLin(data, location);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
431 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
432 (float) w, StickyAxisAnnotation.SimpleAxis.Y_AXIS));
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
433
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
434 doAnnotations(new RiverAnnotation(facet.getDescription(), xy),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
435 aandf, theme, visible);*/
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
436 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
437 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
438
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
439 /**
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
440 * Add WQ Data to plot.
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
441 * @param wqkms data as double[][]
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
442 */
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
443 protected void doWQOut(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
444 DiagramGenerator generator,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
445 ArtifactAndFacet bundle,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
446 ThemeDocument theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
447 boolean visible
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
448 ) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
449 Object data = bundle.getData(generator.getCallContext());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
450 if (data instanceof WQKms) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
451 WQKms wqkms = (WQKms)data;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
452 // TODO As in doEventsOut, the value-searching should
8364
abef2584c9a7 Fetch current km from context (and remove obsolete or superfluous comments and logging).
Tom Gottfried <tom@intevation.de>
parents: 8354
diff changeset
453 // be delivered by the facet already
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
454 XYSeries series = new StyledXYSeries(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
455 bundle.getFacetDescription(), theme);
8364
abef2584c9a7 Fetch current km from context (and remove obsolete or superfluous comments and logging).
Tom Gottfried <tom@intevation.de>
parents: 8354
diff changeset
456 Double ckm = (Double) generator.getCallContext()
abef2584c9a7 Fetch current km from context (and remove obsolete or superfluous comments and logging).
Tom Gottfried <tom@intevation.de>
parents: 8354
diff changeset
457 .getContextValue(CURRENT_KM);
abef2584c9a7 Fetch current km from context (and remove obsolete or superfluous comments and logging).
Tom Gottfried <tom@intevation.de>
parents: 8354
diff changeset
458
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
459 if (wqkms == null || wqkms.getKms().length == 0 || ckm == null) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
460 log.info("addPointFromWQKms: No event data to show.");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
461 return;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
462 }
8364
abef2584c9a7 Fetch current km from context (and remove obsolete or superfluous comments and logging).
Tom Gottfried <tom@intevation.de>
parents: 8354
diff changeset
463
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
464 double[] kms = wqkms.getKms();
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
465 for (int i = 0 ; i< kms.length; i++) {
8472
3f505fba522f (issue1772) Use 0.001km tolarance instead of 0.1 to find matching km.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8391
diff changeset
466 /* We use a tolerance of 1m here to find a hit.
3f505fba522f (issue1772) Use 0.001km tolarance instead of 0.1 to find matching km.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8391
diff changeset
467 * Probably to avoid some rounding errors. */
3f505fba522f (issue1772) Use 0.001km tolarance instead of 0.1 to find matching km.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8391
diff changeset
468 if (Math.abs(kms[i] - ckm) <= 0.001) {
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
469 series.add(wqkms.getQ(i), wqkms.getW(i), false);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
470 generator.addAxisSeries(series, axisName, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
471 if(visible && theme.parseShowPointLabel()) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
472 List<XYTextAnnotation> textAnnos =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
473 new ArrayList<XYTextAnnotation>();
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
474 XYTextAnnotation anno =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
475 new CollisionFreeXYTextAnnotation(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
476 bundle.getFacetDescription(),
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
477 wqkms.getQ(i),
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
478 wqkms.getW(i));
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
479 textAnnos.add(anno);
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
480 RiverAnnotation flysAnno =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
481 new RiverAnnotation(null, null, null, theme);
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
482 flysAnno.setTextAnnotations(textAnnos);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
483 generator.addAnnotations(flysAnno);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
484 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
485 return;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
486 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
487 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
488 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
489 else {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
490 log.debug("FixWQCurveGenerator: doWQOut: double[][]");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
491 double [][] values = (double [][]) data;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
492
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
493 XYSeries series = new StyledXYSeries(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
494 bundle.getFacetDescription(), false, true, theme);
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
495 StyledSeriesBuilder.addPoints(series, values, true);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
496
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
497 generator.addAxisSeries(series, axisName, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
498 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
499 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
500
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
501 @Override
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
502 public boolean canHandle(String facettype) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
503 return facettype.startsWith(FIX_SECTOR_AVERAGE_WQ)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
504 || FIX_ANALYSIS_EVENTS_WQ.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
505 || FIX_REFERENCE_EVENTS_WQ.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
506 || FIX_EVENTS.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
507 || FIX_WQ_CURVE.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
508 || FIX_OUTLIER.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
509 || QSECTOR.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
510 || STATIC_WKMS_MARKS.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
511 || STATIC_WKMS.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
512 || HEIGHTMARKS_POINTS.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
513 || LONGITUDINAL_W.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
514 || STATIC_WKMS_INTERPOL.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
515 || FIX_WQ_LS.equals(facettype);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
516 }
8354
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
517
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
518 @Override
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
519 public String getAxisLabel(DiagramGenerator generator) {
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
520 CallMeta meta = generator.getCallContext().getMeta();
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
521
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
522 RiverAccess access = new RiverAccess((D4EArtifact)generator
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
523 .getMaster());
8354
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
524 String unit = access.getRiver().getWstUnit().getName();
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
525 return Resources.getMsg(
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
526 meta,
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
527 I18N_AXIS_LABEL,
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
528 new Object[] { unit });
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
529 }
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
530 }

http://dive4elements.wald.intevation.org