Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/chart/XMLChartTheme.java @ 804:9058c08eac3a
Added more Javadoc in some classes of state.profile.
gnv-artifacts/trunk@886 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 08 Apr 2010 10:10:04 +0000 |
parents | 2047f318e964 |
children | 05bf8534a35a |
rev | line source |
---|---|
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.gnv.chart; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
3 import de.intevation.artifactdatabase.Config; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
4 |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import java.awt.Color; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
6 import java.awt.Font; |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
7 import java.awt.Paint; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
8 |
327
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
9 import java.awt.geom.Ellipse2D; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
10 |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import org.apache.log4j.Logger; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import org.jfree.chart.StandardChartTheme; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
14 |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import org.jfree.chart.plot.XYPlot; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
16 |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
17 import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
18 import org.jfree.chart.renderer.xy.XYBarRenderer; |
327
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
19 import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
20 |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 import org.jfree.ui.RectangleInsets; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
22 |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 import org.jfree.util.UnitType; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 import org.w3c.dom.Document; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 /** |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
28 * Implementation of JFreeChart's default implementation |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
29 * <code>StandardChartTheme</code>. This class takes an xml document with a |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
767
diff
changeset
|
30 * bunch of parameters and turns it into a <code>ChartTheme</code> to change |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
31 * the appearance of charts. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
32 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
33 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 */ |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 public class XMLChartTheme |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 extends StandardChartTheme |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 { |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
38 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
39 * Default color. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
40 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 private static final Color DEFAULT_COLOR = Color.BLACK; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
43 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
44 * Logger used for logging with log4j. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
45 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 private Logger log = Logger.getLogger(XMLChartTheme.class); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
48 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
49 * Field storing the visibility of the domain crosshair |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
50 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 protected boolean domainCrosshairVisible; |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
52 |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
53 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
54 * Field storing the visibility of the range crosshair |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
55 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 protected boolean rangeCrosshairVisible; |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
767
diff
changeset
|
57 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
58 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
59 * Field storing the visiblity of lines. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
60 */ |
327
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
61 protected boolean renderLines; |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
62 |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
63 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
64 * Field storing the visibility of data points |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
65 */ |
327
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
66 protected boolean renderShapes; |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
67 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
68 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
69 * Field storing the width of a data point |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
70 */ |
327
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
71 protected int pointWidth; |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
72 |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
73 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
74 * Field storing the height of a data point. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
75 */ |
327
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
76 protected int pointHeight; |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
78 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
79 * Field storing the base color of a bin in a histogram chart |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
80 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
81 protected Paint histogramBasePaint; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
82 |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
84 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
85 * Constructor |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
86 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
87 * @param name Name for this theme. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
88 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 public XMLChartTheme(String name) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 super(name); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
94 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
95 * Setter method for the visibility of the domain crosshair. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
96 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
97 * @param visible True, if domain crosshair should be visible |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
98 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 public void setDomainCrosshairVisible(boolean visible) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 this.domainCrosshairVisible = visible; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
104 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
105 * Getter method for retrieving the visibility of the domain crosshair. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
106 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
107 * @return Visibility of the domain crosshair. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
108 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 public boolean getDomainCrosshairVisible() { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 return domainCrosshairVisible; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
114 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
115 * Getter method for retrieving the visibility of the range crosshair. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
116 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
117 * @return Visibility of the range crosshair. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
118 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 public boolean getRangeCrosshairVisible() { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 return rangeCrosshairVisible; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
124 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
125 * Setter method for the visibility of the range crosshair. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
126 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
127 * @param visible True, if range crosshair should be visible |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
128 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 public void setRangeCrosshairVisible(boolean visible) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 this.rangeCrosshairVisible = visible; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
134 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
135 * Method to set the bin color of histograms. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
136 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
137 * @param c Bin color |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
138 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
139 public void setHistogramBasePaint(Color c) { |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
140 this.histogramBasePaint = c; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
141 } |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
142 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
143 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
144 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
145 * Getter method for retrieving the bin color. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
146 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
147 * @return Bin color |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
148 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
149 public Paint getHistogramBasePaint() { |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
150 return histogramBasePaint; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
151 } |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
152 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
153 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
154 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
155 * Take a given xml document and read the configuration of a chart |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
156 * appearance. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
157 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
158 * @param document XML document |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
159 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
160 public void applyXMLConfiguration(Document document) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
161 log.debug("create XMLChartTheme"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
162 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
163 init(document); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
164 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
165 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
166 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
167 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
168 * Start parsing the different settings from <code>document</code>. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
169 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
170 * @param document XML document |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
171 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
172 private void init(Document document) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
173 log.debug("init XMLChartTheme parameters"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
174 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
175 initChartParameters(document); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
176 initTitleParameters(document); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
177 initSubtitleParameters(document); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
178 initPlotParameters(document); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
179 initAxisParameters(document); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
180 initLegendParameters(document); |
327
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
181 initRenderer(document); |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
182 initHistogramColor(document); |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
183 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
184 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
185 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
186 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
187 * Read parameters configuring the title of a chart. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
188 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
189 * @param document XML document |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
190 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
191 private void initTitleParameters(Document document) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
192 log.debug("init title parameters."); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
193 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
194 int size = getInt(document, "theme/title/font/size/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
195 String type = getString(document, "theme/title/font/type/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
196 boolean bold = getBool(document, "theme/title/font/bold/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
197 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
198 setExtraLargeFont(createFont(type, size, bold)); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
199 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
200 String color = getString(document, "theme/title/font/color/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
201 Color c = decodeColor(color); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
202 if (c != null) |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
203 setTitlePaint(c); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
204 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
205 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
206 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
207 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
208 * Read parameters configuring the subtitle of a chart. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
209 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
210 * @param document XML document |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
211 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
212 private void initSubtitleParameters(Document document) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
213 log.debug("init title parameters."); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
214 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
215 int size = getInt(document, "theme/subtitle/font/size/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
216 String type = getString(document, "theme/subtitle/font/type/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
217 boolean bold = getBool(document, "theme/subtitle/font/bold/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
218 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
219 setLargeFont(createFont(type, size, bold)); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
220 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
221 String col = getString(document, "theme/subtitle/font/color/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
222 setSubtitlePaint(Color.decode(col)); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
223 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
224 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
225 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
226 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
227 * Read parameters configuring the background color of a chart. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
228 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
229 * @param document XML document |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
230 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
231 private void initChartParameters(Document document) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
232 log.debug("init chart parameters."); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
233 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
234 String bg = getString(document, "theme/chart/background/color/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
235 Color c = decodeColor(bg); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
236 if (c != null) |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
237 setChartBackgroundPaint(c); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
238 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
239 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
240 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
241 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
242 * Read parameters configuring the plot of a chart. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
243 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
244 * @param document XML document |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
245 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
246 private void initPlotParameters(Document document) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
247 log.debug("init plot parameters."); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
248 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
249 String tmp = null; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
250 tmp = getString(document, "theme/plot/background/color/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
251 Color c = decodeColor(tmp); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
252 if (c != null) |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
253 setPlotBackgroundPaint(c); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
254 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
255 tmp = getString(document, "theme/plot/outline/color/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
256 c = decodeColor(tmp); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
257 if (c != null) |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
258 setPlotOutlinePaint(c); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
259 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
260 tmp = getString(document, "theme/plot/domaingridline/color/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
261 c = decodeColor(tmp); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
262 if (c != null) |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
263 setDomainGridlinePaint(c); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
264 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
265 tmp = getString(document, "theme/plot/rangegridline/color/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
266 c = decodeColor(tmp); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
267 if (c != null) |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
268 setRangeGridlinePaint(c); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
269 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
270 boolean rangeCrosshairVisible = getBool( |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
271 document, "theme/plot/rangecrosshair/visible/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
272 setRangeCrosshairVisible(rangeCrosshairVisible); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
273 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
274 boolean domainCrosshairVisible = getBool( |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
275 document, "theme/plot/domaincrosshair/visible/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
276 setDomainCrosshairVisible(domainCrosshairVisible); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
277 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
278 int top = getInt(document, "theme/plot/offset/top/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
279 int bottom = getInt(document, "theme/plot/offset/bottom/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
280 int left = getInt(document, "theme/plot/offset/left/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
281 int right = getInt(document, "theme/plot/offset/right/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
282 setAxisOffset(new RectangleInsets( |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
283 UnitType.RELATIVE, |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
284 top, left, bottom, right) |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
285 ); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
286 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
287 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
288 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
289 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
290 * Read parameters configuring the axes of a plot. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
291 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
292 * @param document XML document |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
293 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
294 private void initAxisParameters(Document document) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
295 log.debug("init axis parameters."); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
296 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
297 String tmp = null; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
298 tmp = getString(document, "theme/axis/label/color/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
299 Color c = decodeColor(tmp); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
300 if (c != null) |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
301 setAxisLabelPaint(c); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
302 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
303 tmp = getString(document, "theme/axis/ticklabel/color/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
304 c = decodeColor(tmp); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
305 if (c != null) |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
306 setTickLabelPaint(c); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
307 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
308 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
309 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
310 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
311 * Read parameters configuring the legend of a chart. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
312 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
313 * @param document XML document |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
314 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
315 private void initLegendParameters(Document document) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
316 log.debug("init legend parameters."); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
317 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
318 String tmp = null; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
319 tmp = getString(document, "theme/legend/font/color/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
320 Color c = decodeColor(tmp); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
321 if (c != null) |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
322 setLegendItemPaint(c); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
323 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
324 tmp = getString(document, "theme/legend/background/color/@value"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
325 c = decodeColor(tmp); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
326 if (c != null) |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
327 setLegendBackgroundPaint(c); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
328 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
329 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
330 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
331 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
332 * Read parameters configuring the renderer of a plot. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
333 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
334 * @param document XML document |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
335 */ |
327
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
336 private void initRenderer(Document document) { |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
337 log.debug("init renderer parameters."); |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
338 |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
339 pointWidth = getInt(document, "theme/plot/itemrenderer/width/@value"); |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
340 log.debug("Read point width of " + pointWidth); |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
341 pointHeight = getInt(document, "theme/plot/itemrenderer/height/@value"); |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
342 log.debug("Read point height of " + pointHeight); |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
343 renderLines = getBool( |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
344 document, "theme/plot/itemrenderer/renderLines/@value" |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
345 ); |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
346 renderShapes = getBool( |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
347 document, "theme/plot/itemrenderer/renderPoints/@value" |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
348 ); |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
349 } |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
350 |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
351 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
352 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
353 * Read base color of bins in histogram charts. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
354 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
355 * @param document XML document |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
356 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
357 private void initHistogramColor(Document document) { |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
358 log.debug("init histogram color"); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
359 String tmp = getString(document, "theme/histogram/bar/color/@value"); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
360 Color c = decodeColor(tmp); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
361 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
362 if (c != null) |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
363 setHistogramBasePaint(c); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
364 } |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
365 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
366 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
367 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
368 * Read a xpath expression and return the matched string. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
369 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
370 * @param document Document |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
371 * @param xpath XPath expression |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
372 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
373 * @return Matched string |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
374 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
375 private static String getString(Document document, String xpath) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
376 return Config.getStringXPath(document, xpath); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
377 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
378 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
379 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
380 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
381 * Read a xpath and turn it into an integer. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
382 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
383 * @param document Document |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
384 * @param xpath XPath expression |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
385 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
386 * @return Matched string as integer representation. Return 0 if no integer |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
387 * have been found at <code>xpath</code>. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
388 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
389 private static int getInt(Document document, String xpath) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
390 String tmp = getString(document, xpath); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
391 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
392 if (tmp != null) |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
393 return Integer.parseInt(tmp); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
394 else |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
395 return 0; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
396 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
397 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
398 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
399 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
400 * Read a xpath and turn it into a boolean. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
401 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
402 * @param document Document |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
403 * @param xpath XPath expression |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
404 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
405 * @return Matched string as boolean representation. Return false if no |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
406 * boolean have been found at <code>xpath</code>. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
407 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
408 private static boolean getBool(Document document, String xpath) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
409 String tmp = getString(document, xpath); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
410 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
411 if (tmp != null) |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
412 return Boolean.parseBoolean(tmp); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
413 else |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
414 return false; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
415 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
416 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
417 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
418 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
419 * Turns a string into a color using {@link java.awt.Color}. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
420 * |
788
e8a9e84a0328
Corrected JavaDoc errors in Chart Package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
779
diff
changeset
|
421 * @param color as string |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
422 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
423 * @return Color |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
424 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
425 protected Color decodeColor(String color) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
426 try { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
427 if (color == null) |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
428 return null; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
429 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
430 return Color.decode(color); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
431 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
432 catch (NumberFormatException nfe) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
433 log.warn("Error while parsing color: " + color, nfe); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
434 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
435 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
436 return null; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
437 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
438 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
439 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
440 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
441 * Create a font with the given parameters. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
442 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
443 * @param type Font type |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
444 * @param size Font size |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
445 * @param bold Font weight |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
446 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
447 * @return Font |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
448 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
449 protected Font createFont(String type, int size, boolean bold) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
450 Font font = null; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
451 if (bold) |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
452 font = new Font(type, Font.BOLD, size); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
453 else |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
454 font = new Font(type, Font.PLAIN, size); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
455 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
456 return font; |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
457 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
458 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
459 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
460 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
461 * Apply settings of this <code>ChartTheme</code> to the given |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
462 * <code>XYPlot</code>. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
463 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
464 * @param plot XYPlot |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
465 */ |
788
e8a9e84a0328
Corrected JavaDoc errors in Chart Package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
779
diff
changeset
|
466 @Override |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
467 protected void applyToXYPlot(XYPlot plot) { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
468 log.debug("apply theme parameter to XYPlot"); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
469 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
470 super.applyToXYPlot(plot); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
471 plot.setDomainCrosshairVisible(this.domainCrosshairVisible); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
472 plot.setRangeCrosshairVisible(this.rangeCrosshairVisible); |
327
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
473 |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
767
diff
changeset
|
474 AbstractXYItemRenderer renderer = (AbstractXYItemRenderer) |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
475 plot.getRenderer(); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
476 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
477 if (renderer instanceof XYLineAndShapeRenderer) |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
478 applyToXYLineAndShapeRenderer(plot); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
479 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
480 if (renderer instanceof XYBarRenderer) |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
481 applyToXYBarRenderer(plot); |
327
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
482 } |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
483 |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
484 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
485 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
486 * Apply settings of this <code>ChartTheme</code> to the |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
487 * <code>XYLineAndShapeRenderer</code> of the given <code>XYPlot</code>. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
488 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
489 * @param plot XYPlot |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
490 */ |
327
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
491 protected void applyToXYLineAndShapeRenderer(XYPlot plot) { |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
492 if (plot == null) |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
493 return; |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
494 |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
495 XYLineAndShapeRenderer renderer = |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
496 (XYLineAndShapeRenderer) plot.getRenderer(); |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
497 |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
498 Ellipse2D.Double point = new Ellipse2D.Double( |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
499 -(pointWidth/2), -(pointHeight/2), pointWidth, pointHeight |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
500 ); |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
501 |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
502 renderer.setSeriesShape(0, point); |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
503 renderer.setSeriesShapesVisible(0, renderShapes); |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
504 renderer.setSeriesLinesVisible(0, renderLines); |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
505 |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
304
diff
changeset
|
506 plot.setRenderer(renderer); |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
507 } |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
508 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
509 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
510 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
511 * Apply settings of this <code>ChartTheme</code> to the |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
512 * <code>XYBarRenderer</code> of the given <code>XYPlot</code>. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
513 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
514 * @param plot XYPlot |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
515 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
516 protected void applyToXYBarRenderer(XYPlot plot) { |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
517 if (plot == null) |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
518 return; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
519 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
520 XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer(); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
521 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
522 renderer.setSeriesPaint(0, histogramBasePaint); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
523 } |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
524 } |
793
2047f318e964
Added missing vim control comments.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
525 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |