annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/MainValuesQFacet.java @ 4255:670e98f5a441

Fixed leak while merging facets. The ThemeList that is used by OutputHelper to sort the Facets for an Output now uses a list to store the ManagedFacets. The correct order is made up by sorting the List using Collections.sort() function of the Java JDK. Therfore, the ManagedFacet class implements the Comparable interface. The return value of its compareTo(other) method depends on the value of the 'position' field.
author Ingo Weinzierl <weinzierl.ingo@googlemail.com>
date Thu, 25 Oct 2012 14:01:46 +0200
parents 35a6c9a49a76
children
rev   line source
1085
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts.model;
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
2
1679
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1113
diff changeset
3 import java.util.ArrayList;
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1113
diff changeset
4 import java.util.List;
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1113
diff changeset
5
2778
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
6 import org.apache.log4j.Logger;
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
7
1085
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
8 import de.intevation.artifacts.Artifact;
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
9 import de.intevation.artifacts.CallContext;
2778
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
10 import de.intevation.artifacts.DataProvider;
1679
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1113
diff changeset
11
1085
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
12 import de.intevation.artifactdatabase.state.DefaultFacet;
1679
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1113
diff changeset
13
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1113
diff changeset
14 import de.intevation.flys.artifacts.MainValuesArtifact;
2778
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
15 import de.intevation.flys.artifacts.math.Linear;
1679
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1113
diff changeset
16 import de.intevation.flys.jfree.FLYSAnnotation;
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1113
diff changeset
17 import de.intevation.flys.jfree.StickyAxisAnnotation;
1085
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
18
2163
105097966111 Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2161
diff changeset
19 import de.intevation.flys.exports.DurationCurveGenerator;
105097966111 Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2161
diff changeset
20
2778
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
21
1085
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
22 /**
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
23 * Facet to show Main Q Values.
2161
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1957
diff changeset
24 * TODO Join with W implementation.
1085
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
25 */
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
26 public class MainValuesQFacet
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
27 extends DefaultFacet
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
28 implements FacetTypes {
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
29
2778
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
30 /** Own logger. */
3778
35a6c9a49a76 Fixed wrong assigned loggers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3442
diff changeset
31 private static Logger logger = Logger.getLogger(MainValuesQFacet.class);
2778
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
32
1957
3b08b8aacfb0 Fix flys/issue423, do not interpolate main values at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1809
diff changeset
33 /** Do we want MainValues at Gauge (not interpolated)? */
3b08b8aacfb0 Fix flys/issue423, do not interpolate main values at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1809
diff changeset
34 protected boolean isAtGauge;
3b08b8aacfb0 Fix flys/issue423, do not interpolate main values at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1809
diff changeset
35
3442
cd5eb8f5f6f1 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3317
diff changeset
36
1085
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
37 /** Trivial Constructor. */
1957
3b08b8aacfb0 Fix flys/issue423, do not interpolate main values at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1809
diff changeset
38 public MainValuesQFacet(String name, String description, boolean atGauge) {
1112
aeae4d20f32f Fix translations of Main Values Facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1085
diff changeset
39 this.description = description;
2163
105097966111 Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2161
diff changeset
40 this.name = name;
105097966111 Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2161
diff changeset
41 this.index = 0;
105097966111 Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2161
diff changeset
42 this.isAtGauge = atGauge;
1085
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
43 }
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
44
3442
cd5eb8f5f6f1 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3317
diff changeset
45
2778
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
46 /**
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
47 * Set the hit-point in Q where a line drawn from the axis would hit the
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
48 * curve in WQDay (if hit).
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
49 * Employ linear interpolation.
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
50 */
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
51 protected static void setHitPoint(WQDay wqday, StickyAxisAnnotation annotation) {
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
52 int idx = 0;
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
53 float q = annotation.getPos();
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
54 boolean qIncreases = wqday.getQ(0) < wqday.getQ(wqday.size()-1);
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
55 if (qIncreases) {
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
56 while (idx < wqday.size() && wqday.getQ(idx) < q) {
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
57 idx++;
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
58 }
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
59 }
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
60 else {
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
61 idx = wqday.size() -1;
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
62 while (idx > 0 && wqday.getQ(idx) > q) {
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
63 idx--;
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
64 }
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
65 }
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
66
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
67 double day = 0d;
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
68 int mod = (qIncreases) ? -1 : +1;
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
69 if (idx != 0 && idx <= wqday.size()-1) {
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
70 day = Linear.linear(q, wqday.getQ(idx +mod), wqday.getQ(idx),
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
71 wqday.getDay(idx+mod), wqday.getDay(idx));
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
72 annotation.setHitPoint((float)day);
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
73 }
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
74 else {
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
75 logger.debug("StickyAnnotation does not hit wqday curve");
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
76 }
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
77 }
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
78
1085
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
79
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
80 /**
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
81 * Returns the data this facet requires.
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
82 *
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
83 * @param artifact the owner artifact.
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
84 * @param context the CallContext (ignored).
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
85 *
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
86 * @return the data.
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
87 */
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
88 @Override
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
89 public Object getData(Artifact artifact, CallContext context) {
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
90 MainValuesArtifact mvArtifact = (MainValuesArtifact) artifact;
1679
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1113
diff changeset
91
2163
105097966111 Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2161
diff changeset
92 List<NamedDouble> qs = mvArtifact.getMainValuesQ(isAtGauge);
2161
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1957
diff changeset
93 List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>();
1679
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1113
diff changeset
94
2778
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
95 WQDay wqdays = null;
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
96 List<DataProvider> providers = context.
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
97 getDataProvider(DurationCurveFacet.BB_DURATIONCURVE);
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
98 if (providers.size() < 1) {
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
99 logger.warn("Could not find durationcurve data provider.");
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
100 }
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
101 else {
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
102 wqdays = (WQDay) providers.get(0).provideData(
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
103 DurationCurveFacet.BB_DURATIONCURVE,
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
104 null,
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
105 context);
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
106 }
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
107
2163
105097966111 Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2161
diff changeset
108 // Rather specific case, Q-Annotations at a maybe second yaxis.
2778
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
109 StickyAxisAnnotation annotation = null;
2163
105097966111 Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2161
diff changeset
110 if (this.name.equals(DURATION_MAINVALUES_Q)) {
105097966111 Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2161
diff changeset
111 for (NamedDouble q: qs) {
2778
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
112 annotation =
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
113 new StickyAxisAnnotation(
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
114 q.getName(),
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
115 (float) q.getValue(),
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
116 StickyAxisAnnotation.SimpleAxis.Y_AXIS,
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
117 DurationCurveGenerator.YAXIS.Q.idx);
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
118 xy.add(annotation);
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
119 if (wqdays != null) {
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
120 setHitPoint(wqdays, annotation);
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
121 }
2163
105097966111 Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2161
diff changeset
122 }
105097966111 Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2161
diff changeset
123 }
105097966111 Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2161
diff changeset
124 else {
105097966111 Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2161
diff changeset
125 for (NamedDouble q: qs) {
2778
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
126 annotation =
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
127 new StickyAxisAnnotation(
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
128 q.getName(),
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
129 (float) q.getValue(),
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
130 StickyAxisAnnotation.SimpleAxis.X_AXIS);
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
131 xy.add(annotation);
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
132 if (wqdays != null) {
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
133 setHitPoint(wqdays, annotation);
26f2e7e500dd Also draw lines from q mainvalues to duration curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
134 }
2163
105097966111 Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2161
diff changeset
135 }
1679
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1113
diff changeset
136 }
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1113
diff changeset
137
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1113
diff changeset
138 return new FLYSAnnotation(description, xy);
1085
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
139 }
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
140
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
141
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
142 /**
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
143 * Create a deep copy of this Facet.
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
144 * @return a deep copy.
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
145 */
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
146 @Override
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
147 public MainValuesQFacet deepCopy() {
1957
3b08b8aacfb0 Fix flys/issue423, do not interpolate main values at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1809
diff changeset
148 MainValuesQFacet copy = new MainValuesQFacet(this.name,
3b08b8aacfb0 Fix flys/issue423, do not interpolate main values at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1809
diff changeset
149 description, this.isAtGauge);
1085
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
150 copy.set(this);
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
151 return copy;
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
152 }
07878836ee0d Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
153 }
1809
f6a190f6aaff Give outputname to artifacts getInitialFacetActivity, generate second pair of MainvalueFacets for discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1679
diff changeset
154 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org