annotate artifacts/src/main/java/org/dive4elements/river/exports/process/FixWQProcessor.java @ 9556:9b8e8fc1f408

Use facetName in all processors as themeType for legend aggregation.
author gernotbelger
date Tue, 23 Oct 2018 16:26:58 +0200
parents ddcd52d239cd
children
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;
8354
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
29 import org.dive4elements.river.artifacts.resources.Resources;
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
30 import org.dive4elements.river.exports.DiagramGenerator;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
31 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
32 import org.dive4elements.river.exports.fixings.FixWQCurveGenerator;
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
33 import org.dive4elements.river.jfree.CollisionFreeXYTextAnnotation;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
34 import org.dive4elements.river.jfree.JFreeUtil;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
35 import org.dive4elements.river.jfree.RiverAnnotation;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
36 import org.dive4elements.river.jfree.StickyAxisAnnotation;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
37 import org.dive4elements.river.jfree.StyledXYSeries;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
38 import org.dive4elements.river.themes.ThemeDocument;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
39 import org.jfree.chart.annotations.XYTextAnnotation;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
40 import org.jfree.chart.plot.Marker;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
41 import org.jfree.chart.plot.ValueMarker;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
42 import org.jfree.data.xy.XYSeries;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
43 import org.jfree.ui.RectangleAnchor;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
44 import org.jfree.ui.RectangleInsets;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
45 import org.jfree.ui.TextAnchor;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
46
8364
abef2584c9a7 Fetch current km from context (and remove obsolete or superfluous comments and logging).
Tom Gottfried <tom@intevation.de>
parents: 8354
diff changeset
47 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
48
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
49 public class FixWQProcessor
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
50 extends DefaultProcessor
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
51 implements FacetTypes
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
52 {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
53 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
54
8354
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
55 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
56
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
57 public FixWQProcessor() {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
58 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
59
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
60 @Override
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
61 public void doOut(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
62 DiagramGenerator generator,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
63 ArtifactAndFacet bundle,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
64 ThemeDocument theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
65 boolean visible
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
66 ) {
8364
abef2584c9a7 Fetch current km from context (and remove obsolete or superfluous comments and logging).
Tom Gottfried <tom@intevation.de>
parents: 8354
diff changeset
67 // 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
68 // MiscDischargeProcessor or something...
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
69 String facetType = bundle.getFacetName();
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
70 log.debug("facet: " + facetType
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
71 + " name: " + bundle.getFacetDescription());
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
72 if(facetType.startsWith(FIX_SECTOR_AVERAGE_WQ)) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
73 doSectorAverageOut(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_ANALYSIS_EVENTS_WQ.equals(facetType)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
76 || FIX_REFERENCE_EVENTS_WQ.equals(facetType)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
77 || FIX_EVENTS.equals(facetType)) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
78 doEventsOut(generator, bundle, theme, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
79 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
80 else if(FIX_WQ_CURVE.equals(facetType)) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
81 doWQCurveOut(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(QSECTOR.equals(facetType)) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
84 doQSectorOut(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(STATIC_WKMS_MARKS.equals(facetType) ||
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
87 STATIC_WKMS.equals(facetType) ||
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
88 HEIGHTMARKS_POINTS.equals(facetType) ) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
89 doWAnnotations(generator, bundle, theme, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
90 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
91 else if (LONGITUDINAL_W.equals(facetType)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
92 || STATIC_WKMS_INTERPOL.equals(facetType)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
93 || FIX_WQ_LS.equals(facetType)) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
94 doWQOut(generator, bundle, theme, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
95 }
8387
8c60595fd74c Unify discharge curve subtitles.
Tom Gottfried <tom@intevation.de>
parents: 8375
diff changeset
96
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
97 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
98
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
99 /** Add sector average points to chart. */
9360
ddcd52d239cd Outliers in fixation calculation are now shown within the other 'B' event themes and get a separate symbol (triangle).
gernotbelger
parents: 9354
diff changeset
100 private void doSectorAverageOut(
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
101 DiagramGenerator generator,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
102 ArtifactAndFacet bundle,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
103 ThemeDocument theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
104 boolean visible
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
105 ) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
106 log.debug("doSectorAverageOut");
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
107 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
108 generator.getContext());
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
109 QWD qwd = qwdd != null ? qwdd.getQWD() : null;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
110
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
111 if(qwd != null) {
9556
9b8e8fc1f408 Use facetName in all processors as themeType for legend aggregation.
gernotbelger
parents: 9360
diff changeset
112 XYSeries series = new StyledXYSeries(bundle.getFacetName(),
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
113 bundle.getFacetDescription(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
114 false, true,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
115 theme);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
116 DateFormat dateFormat = DateFormat.getDateInstance(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
117 DateFormat.SHORT);
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 series.add(qwd.getQ(), qwd.getW(), false);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
120
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
121 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
122 dateFormat.format(qwd.getDate()),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
123 qwd.getQ(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
124 qwd.getW());
9348
a3f318347707 Show wq outliers within same thems with different symbol: not ready yet
gernotbelger
parents: 9325
diff changeset
125 List<XYTextAnnotation> annos = new ArrayList<>();
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
126 annos.add(anno);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
127 generator.addAxisSeries(series, axisName, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
128
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
129 if (visible && theme != null && theme.parseShowPointLabel()) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
130 RiverAnnotation flysAnno =
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
131 new RiverAnnotation(null, null, null, theme);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
132 flysAnno.setTextAnnotations(annos);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
133 generator.addAnnotations(flysAnno);
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 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
136 else {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
137 log.debug("doSectorAverageOut: qwd == null");
8206
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
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 /** Add analysis event points to chart. */
9360
ddcd52d239cd Outliers in fixation calculation are now shown within the other 'B' event themes and get a separate symbol (triangle).
gernotbelger
parents: 9354
diff changeset
143 private void doEventsOut(
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
144 DiagramGenerator generator,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
145 ArtifactAndFacet bundle,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
146 ThemeDocument theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
147 boolean visible
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
148 ) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
149 log.debug("doAnalysisEventsOut");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
150
9123
1cc7653ca84f Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents: 8858
diff changeset
151 QWD qwd = (QWD)bundle.getData(generator.getContext());
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
152
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
153 if (qwd == null) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
154 log.debug("doAnalysisEventsOut: qwd == null");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
155 return;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
156 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
157
9325
094ed9d1f2ad Fixed: change of point style of interpolated data did not change in WQ chart of fixanalysis
gernotbelger
parents: 9123
diff changeset
158 // 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
159 final ThemeDocument themeInterpolated = FixWQCurveGenerator.configureThemeInterpolated(theme, qwd);
9360
ddcd52d239cd Outliers in fixation calculation are now shown within the other 'B' event themes and get a separate symbol (triangle).
gernotbelger
parents: 9354
diff changeset
160 final XYSeries series = FixWQCurveGenerator.createQWDSeries(generator.getContext().getMeta(), bundle, themeInterpolated, qwd);
8206
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 generator.addAxisSeries(series, axisName, visible);
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 if (visible && themeInterpolated.parseShowPointLabel()) {
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
165
9348
a3f318347707 Show wq outliers within same thems with different symbol: not ready yet
gernotbelger
parents: 9325
diff changeset
166 final List<XYTextAnnotation> textAnnos = new ArrayList<>();
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
167
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
168 DateFormat dateFormat = DateFormat.getDateInstance(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
169 DateFormat.SHORT);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
170 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
171 dateFormat.format(qwd.getDate()),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
172 qwd.getQ(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
173 qwd.getW());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
174 textAnnos.add(anno);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
175
9348
a3f318347707 Show wq outliers within same thems with different symbol: not ready yet
gernotbelger
parents: 9325
diff changeset
176 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
177 flysAnno.setTextAnnotations(textAnnos);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
178 generator.addAnnotations(flysAnno);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
179 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
180 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
181
9360
ddcd52d239cd Outliers in fixation calculation are now shown within the other 'B' event themes and get a separate symbol (triangle).
gernotbelger
parents: 9354
diff changeset
182 private void doWQCurveOut(
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
183 DiagramGenerator generator,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
184 ArtifactAndFacet bundle,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
185 ThemeDocument theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
186 boolean visible
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
187 ) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
188 log.debug("doWQCurveOut");
8206
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 FixWQCurveFacet facet = (FixWQCurveFacet)bundle.getFacet();
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
191 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
192 bundle.getArtifact(), generator.getContext());
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
193
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
194 if (func == null) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
195 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
196 return;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
197 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
198
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
199 double maxQ = func.getMaxQ();
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 if (maxQ > 0) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
202 StyledXYSeries series = JFreeUtil.sampleFunction2D(
9556
9b8e8fc1f408 Use facetName in all processors as themeType for legend aggregation.
gernotbelger
parents: 9360
diff changeset
203 bundle.getFacetName(),
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
204 func.getFunction(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
205 theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
206 bundle.getFacetDescription(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
207 500, // number of samples
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
208 0.0 , // start
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
209 maxQ); // end
8375
0faa82973f60 Re-add line previously removed accidentally between lots of comments.
Tom Gottfried <tom@intevation.de>
parents: 8372
diff changeset
210
0faa82973f60 Re-add line previously removed accidentally between lots of comments.
Tom Gottfried <tom@intevation.de>
parents: 8372
diff changeset
211 generator.addAxisSeries(series, axisName, visible);
8206
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 else {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
214 log.warn("doWQCurveOut: maxQ <= 0");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
215 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
216 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
217
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
218 /** Add markers for q sectors. */
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
219 protected void doQSectorOut(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
220 DiagramGenerator generator,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
221 ArtifactAndFacet bundle,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
222 ThemeDocument theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
223 boolean visible
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
224 ) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
225 log.debug("doQSectorOut");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
226 if (!visible) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
227 return;
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
9123
1cc7653ca84f Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents: 8858
diff changeset
230 Object qsectorsObj = bundle.getData(generator.getContext());
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
231 if (qsectorsObj == null || !(qsectorsObj instanceof List)) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
232 log.warn("No QSectors coming from data.");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
233 return;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
234 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
235
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
236 List<?> qsectorsList = (List<?>) qsectorsObj;
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
237 if (qsectorsList.size() == 0
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
238 || !(qsectorsList.get(0) instanceof NamedDouble)
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
239 ) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
240 log.warn("No QSectors coming from data.");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
241 return;
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 @SuppressWarnings("unchecked")
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
245 List<NamedDouble> qsectors = (List<NamedDouble>) qsectorsList;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
246
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
247 for (NamedDouble qsector : qsectors) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
248 if (Double.isNaN(qsector.getValue())) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
249 continue;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
250 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
251 Marker m = new ValueMarker(qsector.getValue());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
252 m.setPaint(Color.black);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
253
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
254 float[] dashes = theme.parseLineStyle();
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
255 int size = theme.parseLineWidth();
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
256 BasicStroke stroke;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
257 if (dashes.length <= 1) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
258 stroke = new BasicStroke(size);
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 else {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
261 stroke = new BasicStroke(size,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
262 BasicStroke.CAP_BUTT,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
263 BasicStroke.JOIN_ROUND,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
264 1.0f,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
265 dashes,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
266 0.0f);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
267 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
268 m.setStroke(stroke);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
269
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
270 if (theme.parseShowLineLabel()) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
271 m.setLabel(qsector.getName());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
272 m.setPaint(theme.parseTextColor());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
273 m.setLabelFont(theme.parseTextFont());
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
274 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
275 Color paint = theme.parseLineColorField();
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
276 if (paint != null) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
277 m.setPaint(paint);
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 m.setLabelAnchor(RectangleAnchor.TOP_LEFT);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
280 m.setLabelTextAnchor(TextAnchor.TOP_LEFT);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
281 m.setLabelOffset(new RectangleInsets(5, 5, 10, 10));
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
282 generator.addDomainMarker(m);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
283 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
284 }
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 /**
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
287 * Add W-Annotations to plot.
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
288 * @param wqkms actual data (double[][]).
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
289 * @param theme theme to use.
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
290 */
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
291 protected void doWAnnotations(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
292 DiagramGenerator generator,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
293 ArtifactAndFacet bundle,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
294 ThemeDocument theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
295 boolean visible
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
296 ) {
9123
1cc7653ca84f Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents: 8858
diff changeset
297 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
298 List<StickyAxisAnnotation> xy = new ArrayList<>();
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
299 if (data instanceof double[][]) {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
300 log.debug("Got double[][]");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
301 double [][] values = (double [][]) data;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
302 for (int i = 0; i< values[0].length; i++) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
303 xy.add(new StickyAxisAnnotation(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
304 bundle.getFacetDescription(),
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
305 (float) values[1][i],
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
306 StickyAxisAnnotation.SimpleAxis.Y_AXIS));
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
307 }
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) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
310 generator.addAnnotations(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
311 new RiverAnnotation(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
312 bundle.getFacetDescription(), xy, null, theme));
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
313 }
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 else {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
316 // Assume its WKms.
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
317 log.debug("Got WKms");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
318 /* TODO
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
319 WKms wkms = (WKms) data;
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 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
322 (Double)generator.getContext().getContextValue(
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
323 FixChartGenerator.CURRENT_KM);
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
324 double location = (ckm != null)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
325 ? ckm.doubleValue()
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
326 : getRange()[0];
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
327 double w = StaticWKmsArtifact.getWAtKmLin(data, location);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
328 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
329 (float) w, StickyAxisAnnotation.SimpleAxis.Y_AXIS));
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 doAnnotations(new RiverAnnotation(facet.getDescription(), xy),
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
332 aandf, theme, visible);*/
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
333 }
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
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
336 /**
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
337 * Add WQ Data to plot.
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
338 * @param wqkms data as double[][]
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
339 */
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
340 protected void doWQOut(
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
341 DiagramGenerator generator,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
342 ArtifactAndFacet bundle,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
343 ThemeDocument theme,
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
344 boolean visible
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
345 ) {
9123
1cc7653ca84f Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents: 8858
diff changeset
346 Object data = bundle.getData(generator.getContext());
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
347 if (data instanceof WQKms) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
348 WQKms wqkms = (WQKms)data;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
349 // 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
350 // be delivered by the facet already
9556
9b8e8fc1f408 Use facetName in all processors as themeType for legend aggregation.
gernotbelger
parents: 9360
diff changeset
351 XYSeries series = new StyledXYSeries(bundle.getFacetName(),
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
352 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
353 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
354 .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
355
9348
a3f318347707 Show wq outliers within same thems with different symbol: not ready yet
gernotbelger
parents: 9325
diff changeset
356 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
357 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
358 return;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
359 }
8364
abef2584c9a7 Fetch current km from context (and remove obsolete or superfluous comments and logging).
Tom Gottfried <tom@intevation.de>
parents: 8354
diff changeset
360
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
361 double[] kms = wqkms.getKms();
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
362 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
363 /* 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
364 * 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
365 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
366 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
367 generator.addAxisSeries(series, axisName, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
368 if(visible && theme.parseShowPointLabel()) {
9348
a3f318347707 Show wq outliers within same thems with different symbol: not ready yet
gernotbelger
parents: 9325
diff changeset
369 List<XYTextAnnotation> textAnnos = new ArrayList<>();
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
370 XYTextAnnotation anno =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
371 new CollisionFreeXYTextAnnotation(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
372 bundle.getFacetDescription(),
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
373 wqkms.getQ(i),
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
374 wqkms.getW(i));
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
375 textAnnos.add(anno);
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
376 RiverAnnotation flysAnno =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
377 new RiverAnnotation(null, null, null, theme);
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
378 flysAnno.setTextAnnotations(textAnnos);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
379 generator.addAnnotations(flysAnno);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
380 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
381 return;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
382 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
383 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
384 }
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
385 else {
8366
061e85212d25 s/logger/log/ or removed unused logger.
Tom Gottfried <tom@intevation.de>
parents: 8364
diff changeset
386 log.debug("FixWQCurveGenerator: doWQOut: double[][]");
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
387 double [][] values = (double [][]) data;
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
388
9556
9b8e8fc1f408 Use facetName in all processors as themeType for legend aggregation.
gernotbelger
parents: 9360
diff changeset
389 XYSeries series = new StyledXYSeries(bundle.getFacetName(),
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
390 bundle.getFacetDescription(), false, true, theme);
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
391 StyledSeriesBuilder.addPoints(series, values, true);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
392
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
393 generator.addAxisSeries(series, axisName, visible);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
394 }
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 @Override
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
398 public boolean canHandle(String facettype) {
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
399 return facettype.startsWith(FIX_SECTOR_AVERAGE_WQ)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
400 || FIX_ANALYSIS_EVENTS_WQ.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
401 || FIX_REFERENCE_EVENTS_WQ.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
402 || FIX_EVENTS.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
403 || FIX_WQ_CURVE.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
404 || QSECTOR.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
405 || STATIC_WKMS_MARKS.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
406 || STATIC_WKMS.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
407 || HEIGHTMARKS_POINTS.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
408 || LONGITUDINAL_W.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
409 || STATIC_WKMS_INTERPOL.equals(facettype)
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
410 || FIX_WQ_LS.equals(facettype);
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
411 }
8354
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
412
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
413 @Override
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
414 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
415 CallMeta meta = generator.getContext().getMeta();
8354
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
416
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
417 RiverAccess access = new RiverAccess((D4EArtifact)generator
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8490
diff changeset
418 .getMaster());
8354
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
419 String unit = access.getRiver().getWstUnit().getName();
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
420 return Resources.getMsg(
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
421 meta,
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
422 I18N_AXIS_LABEL,
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
423 new Object[] { unit });
9f9857f6c464 Added y axis label to discharge processors.
Raimund Renkert <rrenkert@intevation.de>
parents: 8206
diff changeset
424 }
8206
436512d9bd94 Added processor for discharge curve in fixanalysis.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
425 }

http://dive4elements.wald.intevation.org