Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/StyledXYSeries.java @ 1744:62efd1288e34
Fix setting of masterartifact in flyscollections.
flys-artifacts/trunk@3038 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 19 Oct 2011 16:04:40 +0000 |
parents | 1bc926b5b435 |
children | 741ba9e34c7d |
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; |
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
|
5 |
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 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
|
7 |
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 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
|
9 |
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 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
|
11 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
|
12 |
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 import de.intevation.artifacts.common.utils.XMLUtils; |
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
|
14 |
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 |
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
|
16 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
|
17 |
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
|
18 public static final String XPATH_LINE_COLOR = |
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
|
19 "/theme/field[@name='linecolor']/@default"; |
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
|
20 |
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
|
21 public static final String XPATH_LINE_SIZE = |
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
|
22 "/theme/field[@name='linesize']/@default"; |
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 |
1714
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
24 public static final String XPATH_LINE_TYPE = |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
25 "/theme/field[@name='linetype']/@default"; |
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
|
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 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
|
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 |
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
|
30 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
|
31 |
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
|
32 |
1741
1bc926b5b435
Fix for flys/issue316
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1714
diff
changeset
|
33 public StyledXYSeries(String key, Document theme) { |
1bc926b5b435
Fix for flys/issue316
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1714
diff
changeset
|
34 this(key, true, theme); |
1bc926b5b435
Fix for flys/issue316
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1714
diff
changeset
|
35 } |
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
|
36 |
1741
1bc926b5b435
Fix for flys/issue316
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1714
diff
changeset
|
37 public StyledXYSeries(String key, boolean sorted, Document theme) { |
1bc926b5b435
Fix for flys/issue316
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1714
diff
changeset
|
38 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
|
39 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
|
40 } |
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
|
41 |
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 |
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 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
|
44 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
|
45 applyLineSize(r, idx); |
1714
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
46 applyLineType(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
|
47 |
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
|
48 r.setSeriesLinesVisible(idx, true); |
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
|
49 r.setSeriesShapesVisible(idx, false); |
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 |
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 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
|
52 } |
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
|
53 |
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
|
54 |
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
|
55 protected void applyLineColor(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
|
56 String color = XMLUtils.xpathString(theme, XPATH_LINE_COLOR, null); |
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
|
57 |
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 if (color == null || color.length() == 0) { |
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; |
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 String[] rgb = color.split(","); |
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
|
63 |
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 try { |
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
|
65 Color c = new Color( |
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
|
66 Integer.valueOf(rgb[0].trim()), |
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 Integer.valueOf(rgb[1].trim()), |
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 Integer.valueOf(rgb[2].trim())); |
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 logger.debug("Set series paint color: " + c.toString()); |
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
|
71 |
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
|
72 r.setSeriesPaint(idx, c); |
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
|
73 } |
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
|
74 catch (NumberFormatException nfe) { |
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 logger.warn("Unable to set color from string: '" + color + "'"); |
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
|
76 } |
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
|
77 } |
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
|
78 |
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
|
79 |
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
|
80 protected void applyLineSize(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
|
81 String size = XMLUtils.xpathString(theme, XPATH_LINE_SIZE, null); |
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
|
82 |
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
|
83 if (size == null || size.length() == 0) { |
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
|
84 return; |
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
|
85 } |
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
|
86 |
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
|
87 try { |
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
|
88 r.setSeriesStroke( |
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
|
89 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
|
90 new BasicStroke(Integer.valueOf(size))); |
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
|
91 } |
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
|
92 catch (NumberFormatException nfe) { |
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
|
93 logger.warn("Unable to set line size from string: '" + size + "'"); |
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
|
94 } |
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
|
95 } |
1714
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
96 |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
97 |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
98 protected void applyLineType(XYLineAndShapeRenderer r, int idx) { |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
99 String dash = XMLUtils.xpathString(theme, XPATH_LINE_TYPE, null); |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
100 String size = XMLUtils.xpathString(theme, XPATH_LINE_SIZE, null); |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
101 |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
102 if (dash == null || dash.length() == 0) { |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
103 return; |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
104 } |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
105 if (size == null || size.length() == 0) { |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
106 return; |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
107 } |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
108 |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
109 String[] pattern = dash.split(","); |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
110 if(pattern.length == 1) { |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
111 return; |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
112 } |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
113 |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
114 try { |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
115 float[] dashes = new float[pattern.length]; |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
116 for (int i = 0; i < pattern.length; i++) { |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
117 dashes[i] = Float.parseFloat(pattern[i]); |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
118 } |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
119 |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
120 r.setSeriesStroke( |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
121 idx, |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
122 new BasicStroke(Integer.valueOf(size), |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
123 BasicStroke.CAP_BUTT, |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
124 BasicStroke.JOIN_ROUND, |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
125 1.0f, |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
126 dashes, |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
127 0.0f)); |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
128 } |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
129 catch(NumberFormatException nfe) { |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
130 logger.warn("Unable to set dash from string: '" + dash + "'"); |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
131 } |
004b1b0838d6
Apply line type to styled themes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
924
diff
changeset
|
132 } |
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
|
133 } |
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
|
134 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |