annotate artifacts/src/main/java/org/dive4elements/river/exports/process/FixWQProcessor.java @ 9348:a3f318347707

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

http://dive4elements.wald.intevation.org