Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java @ 1035:9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
flys-artifacts/trunk@2496 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 16 Aug 2011 13:24:50 +0000 |
parents | bf3b3a8d089b |
children | e6aff80b59ff |
rev | line source |
---|---|
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.exports; |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
1028
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
3 import java.util.ArrayList; |
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
4 import java.util.List; |
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
5 |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import org.apache.log4j.Logger; |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 |
1028
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
8 import org.jfree.chart.annotations.XYLineAnnotation; |
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
9 import org.jfree.chart.annotations.XYTextAnnotation; |
375
60f63539d004
Ws and Qs of a longitudinal section chart are mapped to an own range axis now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
369
diff
changeset
|
10 import org.jfree.chart.JFreeChart; |
60f63539d004
Ws and Qs of a longitudinal section chart are mapped to an own range axis now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
369
diff
changeset
|
11 import org.jfree.chart.axis.NumberAxis; |
422
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
12 import org.jfree.chart.axis.ValueAxis; |
375
60f63539d004
Ws and Qs of a longitudinal section chart are mapped to an own range axis now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
369
diff
changeset
|
13 import org.jfree.chart.plot.XYPlot; |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
14 import org.jfree.chart.title.TextTitle; |
720
d60cc6453d45
#161 Include the 0 on the second y axis (the Q axis) in longitudinal section charts intially.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
719
diff
changeset
|
15 import org.jfree.data.Range; |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
16 import org.jfree.data.xy.XYSeries; |
1034
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
17 import org.jfree.ui.TextAnchor; |
1035
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
18 import org.jfree.chart.plot.PlotRenderingInfo; |
364
8830eecad69e
Added the name of the facet to the parameterlist of OutGenerator.doOut().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
359
diff
changeset
|
19 |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 import org.w3c.dom.Document; |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 import de.intevation.artifacts.Artifact; |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 |
695
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
666
diff
changeset
|
24 import de.intevation.artifactdatabase.state.Facet; |
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
666
diff
changeset
|
25 |
422
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
26 import de.intevation.flys.artifacts.FLYSArtifact; |
706
ddd8b37d5cd3
Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
27 |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
28 import de.intevation.flys.artifacts.model.FacetTypes; |
364
8830eecad69e
Added the name of the facet to the parameterlist of OutGenerator.doOut().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
359
diff
changeset
|
29 import de.intevation.flys.artifacts.model.WQKms; |
8830eecad69e
Added the name of the facet to the parameterlist of OutGenerator.doOut().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
359
diff
changeset
|
30 |
1028
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
31 import de.intevation.flys.model.Annotation; |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 /** |
1035
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
34 * Custom annotations class that is drawn only if no collisions with other |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
35 * already drawn CustomAnnotations in current plot are found. |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
36 */ |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
37 class CustomAnnotation extends XYTextAnnotation{ |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
38 |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
39 /** |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
40 * Trivial constructor. |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
41 * |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
42 * @param text Text to display. |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
43 * @param x X-position in dataspace (typical horizontal, in km). |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
44 * @param y Y-position in dataspace (typical vertical, in m). |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
45 */ |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
46 public CustomAnnotation(String text, float x, float y) { |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
47 super(text, x, y); |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
48 } |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
49 |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
50 |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
51 /** |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
52 * Yet trivial draw without implementing any CustomAnnotation-specific |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
53 * feature. |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
54 */ |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
55 public void draw( |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
56 java.awt.Graphics2D g2, |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
57 XYPlot plot, |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
58 java.awt.geom.Rectangle2D dataArea, |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
59 ValueAxis domainAxis, |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
60 ValueAxis rangeAxis, |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
61 int rendererIndex, |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
62 PlotRenderingInfo info) { |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
63 super.draw(g2, plot, dataArea, domainAxis, rangeAxis, rendererIndex, info); |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
64 } |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
65 } |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
66 |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
67 |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
68 /** |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 * An OutGenerator that generates discharge curves. |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 * |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 */ |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
73 public class LongitudinalSectionGenerator |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
74 extends XYChartGenerator |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
75 implements FacetTypes |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
76 { |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 /** The logger that is used in this generator.*/ |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 private static Logger logger = |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 Logger.getLogger(LongitudinalSectionGenerator.class); |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
81 public static final String I18N_CHART_TITLE = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
82 "chart.longitudinal.section.title"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
83 |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
84 public static final String I18N_CHART_SUBTITLE = |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
85 "chart.longitudinal.section.subtitle"; |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
86 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
87 public static final String I18N_XAXIS_LABEL = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
88 "chart.longitudinal.section.xaxis.label"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
89 |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
90 public static final String I18N_YAXIS_LABEL = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
91 "chart.longitudinal.section.yaxis.label"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
92 |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
93 public static final String I18N_2YAXIS_LABEL = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
94 "chart.longitudinal.section.yaxis.second.label"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
95 |
664
e006da5679d2
s@m³/s@m\u00b3/s@
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
448
diff
changeset
|
96 public static final String I18N_CHART_TITLE_DEFAULT = "W-L\u00e4ngsschnitt"; |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
97 public static final String I18N_XAXIS_LABEL_DEFAULT = "km"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
98 public static final String I18N_YAXIS_LABEL_DEFAULT = "W [NN + m]"; |
664
e006da5679d2
s@m³/s@m\u00b3/s@
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
448
diff
changeset
|
99 public static final String I18N_2YAXIS_LABEL_DEFAULT = "Q [m\u00b3/s]"; |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
100 |
364
8830eecad69e
Added the name of the facet to the parameterlist of OutGenerator.doOut().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
359
diff
changeset
|
101 |
745
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
102 protected boolean inverted; |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
103 |
1028
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
104 protected List<Annotation> annotations; |
364
8830eecad69e
Added the name of the facet to the parameterlist of OutGenerator.doOut().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
359
diff
changeset
|
105 |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 public LongitudinalSectionGenerator() { |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 super(); |
1028
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
108 annotations = new ArrayList<Annotation>(); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
109 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
110 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
111 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
112 protected String getChartTitle() { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
113 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
114 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
115 |
745
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
116 public boolean isInverted() { |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
117 return inverted; |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
118 } |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
119 |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
120 public void setInverted(boolean inverted) { |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
121 this.inverted = inverted; |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
122 } |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
123 |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
124 @Override |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
125 protected void addSubtitles(JFreeChart chart) { |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
126 double[] dist = getRange(); |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
127 |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
128 Object[] args = new Object[] { |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
129 getRiverName(), |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
130 dist[0], |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
131 dist[1] |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
132 }; |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
133 |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
134 String subtitle = msg(I18N_CHART_SUBTITLE, "", args); |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
135 chart.addSubtitle(new TextTitle(subtitle)); |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
136 } |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
137 |
1028
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
138 @Override |
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
139 public JFreeChart generateChart() { |
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
140 JFreeChart c = super.generateChart(); |
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
141 XYPlot p = (XYPlot) c.getPlot(); |
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
142 |
1034
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
143 redoAnnotations(p, p.getDomainAxis()); |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
144 |
1028
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
145 return c; |
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
146 } |
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
147 |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
148 |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
149 protected String getXAxisLabel() { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
150 return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
151 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
152 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
153 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
154 protected String getYAxisLabel() { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
155 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
156 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
157 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
158 |
375
60f63539d004
Ws and Qs of a longitudinal section chart are mapped to an own range axis now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
369
diff
changeset
|
159 protected void adjustAxes(XYPlot plot) { |
60f63539d004
Ws and Qs of a longitudinal section chart are mapped to an own range axis now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
369
diff
changeset
|
160 super.adjustAxes(plot); |
60f63539d004
Ws and Qs of a longitudinal section chart are mapped to an own range axis now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
369
diff
changeset
|
161 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
162 NumberAxis qAxis = new NumberAxis( |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
397
diff
changeset
|
163 msg(I18N_2YAXIS_LABEL, I18N_2YAXIS_LABEL_DEFAULT)); |
375
60f63539d004
Ws and Qs of a longitudinal section chart are mapped to an own range axis now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
369
diff
changeset
|
164 |
666
eb45e05e5c5b
Set the second y axis to axis position 1 (starts at 0).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
664
diff
changeset
|
165 plot.setRangeAxis(1, qAxis); |
422
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
166 |
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
167 invertXAxis(plot.getDomainAxis()); |
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
168 } |
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
169 |
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
170 |
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
171 /** |
1034
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
172 * Remove all annotations from plot and re-insert them at an approximately |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
173 * okay position. The followed approach is naive but side-effect free. |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
174 */ |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
175 protected void redoAnnotations(XYPlot plot, ValueAxis axis) { |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
176 plot.clearAnnotations(); |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
177 ValueAxis yAxis = plot.getRangeAxis(); |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
178 float posY = 140.f; |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
179 if (yAxis != null) { |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
180 posY = (float) yAxis.getRange().getLowerBound(); |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
181 // Lets add some (1%) space between Text and Axis . |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
182 posY += 0.1f * (yAxis.getRange().getUpperBound() |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
183 - yAxis.getRange().getLowerBound()); |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
184 } |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
185 double freeFrom = axis.getRange().getLowerBound(); |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
186 //logger.warn("Axis lower Bound: " + freeFrom); |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
187 |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
188 // Assuming ordered annotations. |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
189 for (Annotation a: annotations) { |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
190 float posX = (float) a.getRange().getA().doubleValue(); |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
191 if (posX < freeFrom) { continue; } |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
192 String text = a.getPosition().getValue(); |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
193 |
1035
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
194 XYTextAnnotation ta = new CustomAnnotation(text, posX, posY); |
1034
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
195 double rotation = 270.0f * (Math.PI / 180.0f); |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
196 ta.setRotationAngle(rotation); |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
197 ta.setRotationAnchor(TextAnchor.CENTER_LEFT); |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
198 ta.setTextAnchor(TextAnchor.CENTER_LEFT); |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
199 plot.getRenderer().addAnnotation(ta); |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
200 XYLineAnnotation la = new XYLineAnnotation(posX, 0, posX, posY); |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
201 plot.getRenderer().addAnnotation(la); |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
202 freeFrom += 2.0; |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
203 } |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
204 } |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
205 |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
206 |
bf3b3a8d089b
Slightly improved rendering of annotations in LongitudinalSection-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1028
diff
changeset
|
207 /** |
720
d60cc6453d45
#161 Include the 0 on the second y axis (the Q axis) in longitudinal section charts intially.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
719
diff
changeset
|
208 * This method overrides the XYChartGenerators zoomY method to include the 0 |
d60cc6453d45
#161 Include the 0 on the second y axis (the Q axis) in longitudinal section charts intially.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
719
diff
changeset
|
209 * value on the Q axis. |
d60cc6453d45
#161 Include the 0 on the second y axis (the Q axis) in longitudinal section charts intially.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
719
diff
changeset
|
210 */ |
d60cc6453d45
#161 Include the 0 on the second y axis (the Q axis) in longitudinal section charts intially.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
719
diff
changeset
|
211 @Override |
d60cc6453d45
#161 Include the 0 on the second y axis (the Q axis) in longitudinal section charts intially.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
719
diff
changeset
|
212 protected boolean zoomY(XYPlot plot, ValueAxis axis, Range range, Range x) { |
734
56d70e546800
#174 Longitudinal section charts will now have an upper margin again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
720
diff
changeset
|
213 if (plot.getRangeAxisIndex(axis) == 1) { |
56d70e546800
#174 Longitudinal section charts will now have an upper margin again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
720
diff
changeset
|
214 // we want the Q axis to start at 0 if no zooming has been done |
56d70e546800
#174 Longitudinal section charts will now have an upper margin again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
720
diff
changeset
|
215 range = new Range(0d, range.getUpperBound()); |
720
d60cc6453d45
#161 Include the 0 on the second y axis (the Q axis) in longitudinal section charts intially.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
719
diff
changeset
|
216 } |
d60cc6453d45
#161 Include the 0 on the second y axis (the Q axis) in longitudinal section charts intially.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
719
diff
changeset
|
217 |
734
56d70e546800
#174 Longitudinal section charts will now have an upper margin again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
720
diff
changeset
|
218 return super.zoomY(plot, axis, range, x); |
720
d60cc6453d45
#161 Include the 0 on the second y axis (the Q axis) in longitudinal section charts intially.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
719
diff
changeset
|
219 } |
d60cc6453d45
#161 Include the 0 on the second y axis (the Q axis) in longitudinal section charts intially.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
719
diff
changeset
|
220 |
d60cc6453d45
#161 Include the 0 on the second y axis (the Q axis) in longitudinal section charts intially.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
719
diff
changeset
|
221 |
d60cc6453d45
#161 Include the 0 on the second y axis (the Q axis) in longitudinal section charts intially.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
719
diff
changeset
|
222 /** |
422
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
223 * This method inverts the x-axis based on the kilometer information of the |
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
224 * selected river. If the head of the river is at kilometer 0, the axis is |
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
225 * not inverted, otherwise it is. |
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
226 * |
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
227 * @param xaxis The domain axis. |
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
228 */ |
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
229 protected void invertXAxis(ValueAxis xaxis) { |
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
230 |
745
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
231 if (inverted) { |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
232 logger.debug("Invert X-Axis."); |
422
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
233 xaxis.setInverted(true); |
3b83341e0cf4
ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
420
diff
changeset
|
234 } |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
235 } |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
236 |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
237 |
695
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
666
diff
changeset
|
238 public void doOut(Artifact artifact, Facet facet, Document attr) { |
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
666
diff
changeset
|
239 String name = facet.getName(); |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
240 |
695
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
666
diff
changeset
|
241 logger.debug("LongitudinalSectionGenerator.doOut: " + name); |
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
666
diff
changeset
|
242 |
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
666
diff
changeset
|
243 if (name == null) { |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
244 logger.error("No facet name for doOut(). No output generated!"); |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
245 return; |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
246 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
247 |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
248 FLYSArtifact flys = (FLYSArtifact) artifact; |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
249 Facet f = flys.getNativeFacet(facet); |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
250 |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
251 if (f == null) { |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
252 return; |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
253 } |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
254 |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
255 if (name.equals(LONGITUDINAL_W)) { |
924
f7761914f745
An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
923
diff
changeset
|
256 doWOut((WQKms) f.getData(artifact, context), attr); |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
257 } |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
258 else if (name.equals(LONGITUDINAL_Q)) { |
924
f7761914f745
An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
923
diff
changeset
|
259 doQOut((WQKms) f.getData(artifact, context), attr); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
260 } |
1028
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
261 else if (name.equals(LONGITUDINAL_ANNOTATION)) { |
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
262 doAnnotationsOut(f.getData(artifact, context), attr); |
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
263 } |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
264 else { |
695
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
666
diff
changeset
|
265 logger.warn("Unknown facet name: " + name); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
266 return; |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
267 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
268 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
269 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
270 |
1028
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
271 protected void doAnnotationsOut(Object o, Document theme) { |
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
272 logger.debug("LongitudinalSectionGenerator.doAnnotationsOut"); |
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
273 this.annotations = (List<Annotation>) o; |
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
274 } |
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
275 |
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
276 |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
277 /** |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
278 * Process the output for W facets in a longitudinal section curve. |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
279 * |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
280 * @param wqkms An array of WQKms values. |
924
f7761914f745
An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
923
diff
changeset
|
281 * @param theme The theme that contains styling information. |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
282 */ |
924
f7761914f745
An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
923
diff
changeset
|
283 protected void doWOut(WQKms wqkms, Document theme) { |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
284 logger.debug("LongitudinalSectionGenerator.doWOut"); |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
285 |
924
f7761914f745
An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
923
diff
changeset
|
286 XYSeries series = new StyledXYSeries(getSeriesName(wqkms, "W"), theme); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
287 |
719
035c0095b427
Draw correction curve again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
706
diff
changeset
|
288 int size = wqkms.size(); |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
289 |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
290 if (logger.isDebugEnabled()) { |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
291 if (wqkms.size() > 0) { |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
292 logger.debug("Generate series: " + series.getKey()); |
925
0cb1a70b8b92
Added the math needed to calculate "W-Differenzen" in "Laengsschnitten"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
924
diff
changeset
|
293 logger.debug("Start km: " + wqkms.getKm(0)); |
0cb1a70b8b92
Added the math needed to calculate "W-Differenzen" in "Laengsschnitten"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
924
diff
changeset
|
294 logger.debug("End km: " + wqkms.getKm(size-1)); |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
295 logger.debug("Values : " + size); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
296 } |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
297 } |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
298 |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
299 for (int i = 0; i < size; i++) { |
925
0cb1a70b8b92
Added the math needed to calculate "W-Differenzen" in "Laengsschnitten"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
924
diff
changeset
|
300 series.add(wqkms.getKm(i), wqkms.getW(i)); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
301 } |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
302 |
923
7ca4a287cd0e
#135 Modified the way to store datasets for different chart axes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
745
diff
changeset
|
303 addFirstAxisSeries(series); |
745
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
304 |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
305 if (wqkms.guessWaterIncreasing()) { |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
306 setInverted(true); |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
307 } |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
308 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
309 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
310 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
311 /** |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
312 * Process the output for Q facets in a longitudinal section curve. |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
313 * |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
314 * @param wqkms An array of WQKms values. |
924
f7761914f745
An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
923
diff
changeset
|
315 * @param theme The theme that contains styling information. |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
316 */ |
924
f7761914f745
An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
923
diff
changeset
|
317 protected void doQOut(WQKms wqkms, Document theme) { |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
318 logger.debug("LongitudinalSectionGenerator.doQOut"); |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
319 |
924
f7761914f745
An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
923
diff
changeset
|
320 XYSeries series = new StyledXYSeries(getSeriesName(wqkms, "Q"), theme); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
321 |
719
035c0095b427
Draw correction curve again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
706
diff
changeset
|
322 int size = wqkms.size(); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
323 |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
324 if (logger.isDebugEnabled()) { |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
325 if (wqkms.size() > 0) { |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
326 logger.debug("Generate series: " + series.getKey()); |
925
0cb1a70b8b92
Added the math needed to calculate "W-Differenzen" in "Laengsschnitten"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
924
diff
changeset
|
327 logger.debug("Start km: " + wqkms.getKm(0)); |
0cb1a70b8b92
Added the math needed to calculate "W-Differenzen" in "Laengsschnitten"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
924
diff
changeset
|
328 logger.debug("End km: " + wqkms.getKm(size-1)); |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
329 logger.debug("Values : " + size); |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
330 } |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
331 } |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
332 |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
333 for (int i = 0; i < size; i++) { |
925
0cb1a70b8b92
Added the math needed to calculate "W-Differenzen" in "Laengsschnitten"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
924
diff
changeset
|
334 series.add(wqkms.getKm(i), wqkms.getQ(i)); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
335 } |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
336 |
923
7ca4a287cd0e
#135 Modified the way to store datasets for different chart axes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
745
diff
changeset
|
337 addSecondAxisSeries(series); |
745
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
338 |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
339 if (wqkms.guessWaterIncreasing()) { |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
340 setInverted(true); |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
341 } |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
342 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
343 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
344 |
448
88d9e1d75d64
W and Q curves in longitudinal section curves will now have names.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
422
diff
changeset
|
345 protected String getSeriesName(WQKms wqkms, String mode) { |
88d9e1d75d64
W and Q curves in longitudinal section curves will now have names.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
422
diff
changeset
|
346 String name = wqkms.getName(); |
88d9e1d75d64
W and Q curves in longitudinal section curves will now have names.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
422
diff
changeset
|
347 String prefix = name != null && name.indexOf(mode) >= 0 ? null : mode; |
88d9e1d75d64
W and Q curves in longitudinal section curves will now have names.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
422
diff
changeset
|
348 |
88d9e1d75d64
W and Q curves in longitudinal section curves will now have names.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
422
diff
changeset
|
349 return prefix != null && prefix.length() > 0 |
88d9e1d75d64
W and Q curves in longitudinal section curves will now have names.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
422
diff
changeset
|
350 ? prefix + "(" + name +")" |
88d9e1d75d64
W and Q curves in longitudinal section curves will now have names.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
422
diff
changeset
|
351 : name; |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
352 } |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
353 } |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
354 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |