annotate flys-artifacts/src/main/java/de/intevation/flys/exports/StyledXYSeries.java @ 2072:4cdd9c4896f6

#393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series. flys-artifacts/trunk@3581 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 04 Jan 2012 12:24:35 +0000
parents e384d78ff78b
children
rev   line source
924
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.exports;
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import java.awt.BasicStroke;
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 import java.awt.Color;
1753
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
5 import java.awt.geom.Ellipse2D;
924
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 import org.apache.log4j.Logger;
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9 import org.w3c.dom.Document;
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import org.jfree.data.xy.XYSeries;
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13
1753
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
14 import de.intevation.flys.utils.ThemeUtil;
924
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15
1814
a9b690d864a7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
16 /**
2017
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1963
diff changeset
17 * Dataseries in two dimensions with additional theme-document and further
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1963
diff changeset
18 * display options.
1814
a9b690d864a7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
19 * The theme-document will later "style" the graphical representation.
2017
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1963
diff changeset
20 * The display options can be used to control the z-order and the axis of the
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1963
diff changeset
21 * dataseries.
1814
a9b690d864a7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
22 */
924
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 public class StyledXYSeries extends XYSeries {
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 protected Document theme;
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 private static final Logger logger = Logger.getLogger(StyledXYSeries.class);
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29
1741
1bc926b5b435 Fix for flys/issue316
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1714
diff changeset
30 public StyledXYSeries(String key, Document theme) {
1bc926b5b435 Fix for flys/issue316
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1714
diff changeset
31 this(key, true, theme);
1bc926b5b435 Fix for flys/issue316
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1714
diff changeset
32 }
924
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33
1814
a9b690d864a7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
34
a9b690d864a7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
35 /**
a9b690d864a7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
36 * @param sorted whether or not to sort the points. Sorting will move NANs
a9b690d864a7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
37 * to one extrema which can cause problems in certain
a9b690d864a7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
38 * algorithms.
a9b690d864a7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
39 */
1741
1bc926b5b435 Fix for flys/issue316
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1714
diff changeset
40 public StyledXYSeries(String key, boolean sorted, Document theme) {
1bc926b5b435 Fix for flys/issue316
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1714
diff changeset
41 super(key, sorted);
924
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 this.theme = theme;
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 }
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45
2017
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1963
diff changeset
46 /**
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1963
diff changeset
47 * Applies line color, size and type attributes to renderer, also
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1963
diff changeset
48 * whether to draw lines and/or points.
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1963
diff changeset
49 */
924
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 public XYLineAndShapeRenderer applyTheme(XYLineAndShapeRenderer r, int idx){
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 applyLineColor(r, idx);
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 applyLineSize(r, idx);
1714
004b1b0838d6 Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 924
diff changeset
53 applyLineType(r, idx);
1753
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
54 applyShowLine(r, idx);
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
55 applyShowPoints(r, idx);
2072
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
56 applyShowMinimum(r, idx);
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
57 applyShowMaximum(r, idx);
924
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59 return r;
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 }
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62
2017
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1963
diff changeset
63 /** Set line color to renderer. */
924
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 protected void applyLineColor(XYLineAndShapeRenderer r, int idx) {
1753
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
65 Color c = ThemeUtil.parseLineColorField(theme);
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
66 r.setSeriesPaint(idx, c);
924
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 }
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 protected void applyLineSize(XYLineAndShapeRenderer r, int idx) {
1753
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
71 int size = ThemeUtil.parseLineWidth(theme);
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
72 r.setSeriesStroke(
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
73 idx,
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
74 new BasicStroke(Integer.valueOf(size)));
924
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 }
1714
004b1b0838d6 Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 924
diff changeset
76
004b1b0838d6 Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 924
diff changeset
77
004b1b0838d6 Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 924
diff changeset
78 protected void applyLineType(XYLineAndShapeRenderer r, int idx) {
1753
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
79 int size = ThemeUtil.parseLineWidth(theme);
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
80 float[] dashes = ThemeUtil.parseLineStyle(theme);
1714
004b1b0838d6 Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 924
diff changeset
81
1753
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
82 // Do not apply the dashed style.
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
83 if (dashes.length <= 1) {
1714
004b1b0838d6 Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 924
diff changeset
84 return;
004b1b0838d6 Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 924
diff changeset
85 }
004b1b0838d6 Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 924
diff changeset
86
1753
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
87 r.setSeriesStroke(
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
88 idx,
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
89 new BasicStroke(Integer.valueOf(size),
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
90 BasicStroke.CAP_BUTT,
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
91 BasicStroke.JOIN_ROUND,
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
92 1.0f,
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
93 dashes,
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
94 0.0f));
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
95 }
1714
004b1b0838d6 Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 924
diff changeset
96
1753
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
97
2017
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1963
diff changeset
98 /**
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1963
diff changeset
99 * Sets form and visibility of points.
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1963
diff changeset
100 */
1753
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
101 protected void applyShowPoints(XYLineAndShapeRenderer r, int idx) {
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
102 boolean show = ThemeUtil.parseShowPoints(theme);
1963
6c24ffe946a5 Issue 413.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1814
diff changeset
103 int size = ThemeUtil.parseLineWidth(theme);
6c24ffe946a5 Issue 413.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1814
diff changeset
104 r.setSeriesShape(idx, new Ellipse2D.Double(- size,
6c24ffe946a5 Issue 413.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1814
diff changeset
105 - size,
6c24ffe946a5 Issue 413.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1814
diff changeset
106 2 * size,
6c24ffe946a5 Issue 413.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1814
diff changeset
107 2 * size));
1753
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
108 r.setSeriesShapesVisible(idx, show);
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
109 r.setDrawOutlines(true);
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
110 }
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
111
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
112
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
113 protected void applyShowLine(XYLineAndShapeRenderer r, int idx) {
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
114 boolean show = ThemeUtil.parseShowLine(theme);
741ba9e34c7d Apply the attributes 'showpoints' and 'showline'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1741
diff changeset
115 r.setSeriesLinesVisible(idx, show);
1714
004b1b0838d6 Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 924
diff changeset
116 }
2072
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
117
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
118
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
119 protected void applyShowMinimum(XYLineAndShapeRenderer r, int idx) {
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
120 if (!(r instanceof EnhancedLineAndShapeRenderer)) {
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
121 return;
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
122 }
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
123
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
124 boolean visible = ThemeUtil.parseShowMinimum(theme);
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
125
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
126 EnhancedLineAndShapeRenderer er = (EnhancedLineAndShapeRenderer) r;
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
127 er.setIsMinimumShapeVisisble(idx, visible);
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
128 }
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
129
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
130
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
131 protected void applyShowMaximum(XYLineAndShapeRenderer r, int idx) {
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
132 if (!(r instanceof EnhancedLineAndShapeRenderer)) {
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
133 return;
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
134 }
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
135
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
136 boolean visible = ThemeUtil.parseShowMaximum(theme);
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
137
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
138 EnhancedLineAndShapeRenderer er = (EnhancedLineAndShapeRenderer) r;
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
139 er.setIsMaximumShapeVisible(idx, visible);
4cdd9c4896f6 #393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2017
diff changeset
140 }
924
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
141 }
f7761914f745 An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
142 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org