Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/chart/XMLChartTheme.java @ 1141:f030acb8d999
dummy merge for repo head
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:15:18 +0200 |
parents | dec4257ad570 |
children |
rev | line source |
---|---|
1115
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
1 /* |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
2 * Copyright (c) 2010 by Intevation GmbH |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
3 * |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
4 * This program is free software under the LGPL (>=v2.1) |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
5 * Read the file LGPL.txt coming with the software for details |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
6 * or visit http://www.gnu.org/licenses/ if it does not exist. |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
7 */ |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
8 |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 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
|
10 |
1117
dec4257ad570
Changed imports to fit new positions of XMLUtils and Config
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1115
diff
changeset
|
11 import de.intevation.artifacts.common.utils.Config; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
12 |
304
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 java.awt.Color; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
14 import java.awt.Font; |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
15 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
|
16 |
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
|
17 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
|
18 |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 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
|
20 |
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.chart.StandardChartTheme; |
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.chart.plot.XYPlot; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
24 |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
25 import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
26 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
|
27 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
|
28 |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 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
|
30 |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 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
|
32 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 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
|
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 /** |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
36 * 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
|
37 * <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
|
38 * 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
|
39 * 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
|
40 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
41 * @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
|
42 */ |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 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
|
44 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
|
45 { |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
46 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
47 * Default color. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
48 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 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
|
50 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
51 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
52 * 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
|
53 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 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
|
55 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
56 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
57 * 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
|
58 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 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
|
60 |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
61 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
62 * 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
|
63 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 protected boolean rangeCrosshairVisible; |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
767
diff
changeset
|
65 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
66 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
67 * 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
|
68 */ |
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
|
69 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
|
70 |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
71 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
72 * 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
|
73 */ |
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
|
74 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
|
75 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
76 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
77 * 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
|
78 */ |
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
|
79 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
|
80 |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
81 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
82 * 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
|
83 */ |
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
|
84 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
|
85 |
767
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 * 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
|
88 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
89 protected Paint histogramBasePaint; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
90 |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
92 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
93 * Constructor |
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 * @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
|
96 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 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
|
98 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
|
99 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
102 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
103 * 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
|
104 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
105 * @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
|
106 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 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
|
108 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
|
109 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
112 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
113 * 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
|
114 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
115 * @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
|
116 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 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
|
118 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
|
119 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
122 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
123 * 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
|
124 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
125 * @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
|
126 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 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
|
128 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
|
129 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
132 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
133 * 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
|
134 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
135 * @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
|
136 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 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
|
138 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
|
139 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
142 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
143 * 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
|
144 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
145 * @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
|
146 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
147 public void setHistogramBasePaint(Color c) { |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
148 this.histogramBasePaint = c; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
149 } |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
150 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
151 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
152 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
153 * 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
|
154 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
155 * @return Bin color |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
156 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
157 public Paint getHistogramBasePaint() { |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
158 return histogramBasePaint; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
159 } |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
160 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
161 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
162 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
163 * 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
|
164 * appearance. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
165 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
166 * @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
|
167 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
168 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
|
169 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
|
170 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
171 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
|
172 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
173 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
174 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
175 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
176 * 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
|
177 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
178 * @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
|
179 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
180 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
|
181 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
|
182 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
183 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
|
184 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
|
185 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
|
186 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
|
187 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
|
188 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
|
189 initRenderer(document); |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
190 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
|
191 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
192 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
193 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
194 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
195 * 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
|
196 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
197 * @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
|
198 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
199 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
|
200 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
|
201 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
202 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
|
203 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
|
204 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
|
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 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
|
207 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
208 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
|
209 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
|
210 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
|
211 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
|
212 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
213 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
214 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
215 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
216 * 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
|
217 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
218 * @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
|
219 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
220 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
|
221 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
|
222 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
223 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
|
224 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
|
225 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
|
226 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
227 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
|
228 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
229 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
|
230 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
|
231 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
232 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
233 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
234 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
235 * 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
|
236 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
237 * @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
|
238 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
239 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
|
240 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
|
241 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
242 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
|
243 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
|
244 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
|
245 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
|
246 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
247 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
248 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
249 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
250 * 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
|
251 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
252 * @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
|
253 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
254 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
|
255 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
|
256 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
257 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
|
258 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
|
259 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
|
260 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
|
261 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
|
262 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
263 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
|
264 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
|
265 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
|
266 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
|
267 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
268 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
|
269 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
|
270 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
|
271 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
|
272 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
273 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
|
274 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
|
275 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
|
276 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
|
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 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
|
279 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
|
280 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
|
281 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
282 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
|
283 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
|
284 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
|
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 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
|
287 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
|
288 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
|
289 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
|
290 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
|
291 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
|
292 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
|
293 ); |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
294 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
295 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
296 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
297 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
298 * 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
|
299 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
300 * @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
|
301 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
302 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
|
303 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
|
304 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
305 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
|
306 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
|
307 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
|
308 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
|
309 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
|
310 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
311 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
|
312 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
|
313 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
|
314 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
|
315 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
316 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
317 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
318 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
319 * 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
|
320 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
321 * @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
|
322 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
323 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
|
324 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
|
325 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
326 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
|
327 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
|
328 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
|
329 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
|
330 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
|
331 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
332 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
|
333 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
|
334 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
|
335 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
|
336 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
337 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
338 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
339 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
340 * 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
|
341 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
342 * @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
|
343 */ |
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
|
344 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
|
345 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
|
346 |
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 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
|
348 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
|
349 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
|
350 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
|
351 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
|
352 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
|
353 ); |
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
|
354 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
|
355 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
|
356 ); |
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
|
357 } |
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
|
358 |
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
|
359 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
360 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
361 * 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
|
362 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
363 * @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
|
364 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
365 private void initHistogramColor(Document document) { |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
366 log.debug("init histogram color"); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
367 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
|
368 Color c = decodeColor(tmp); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
369 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
370 if (c != null) |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
371 setHistogramBasePaint(c); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
372 } |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
373 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
374 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
375 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
376 * 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
|
377 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
378 * @param document Document |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
379 * @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
|
380 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
381 * @return Matched string |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
382 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
383 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
|
384 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
|
385 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
386 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
387 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
388 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
389 * 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
|
390 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
391 * @param document Document |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
392 * @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
|
393 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
394 * @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
|
395 * 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
|
396 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
397 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
|
398 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
|
399 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
400 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
|
401 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
|
402 else |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
403 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
|
404 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
405 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
406 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
407 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
408 * 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
|
409 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
410 * @param document Document |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
411 * @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
|
412 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
413 * @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
|
414 * 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
|
415 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
416 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
|
417 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
|
418 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
419 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
|
420 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
|
421 else |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
422 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
|
423 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
424 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
425 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
426 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
427 * 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
|
428 * |
788
e8a9e84a0328
Corrected JavaDoc errors in Chart Package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
779
diff
changeset
|
429 * @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
|
430 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
431 * @return Color |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
432 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
433 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
|
434 try { |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
435 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
|
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 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
|
439 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
440 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
|
441 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
|
442 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
443 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
444 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
|
445 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
446 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
447 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
448 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
449 * 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
|
450 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
451 * @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
|
452 * @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
|
453 * @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
|
454 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
455 * @return Font |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
456 */ |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
457 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
|
458 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
|
459 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
|
460 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
|
461 else |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
462 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
|
463 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
464 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
|
465 } |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
466 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
467 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
468 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
469 * 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
|
470 * <code>XYPlot</code>. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
471 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
472 * @param plot XYPlot |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
473 */ |
788
e8a9e84a0328
Corrected JavaDoc errors in Chart Package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
779
diff
changeset
|
474 @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
|
475 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
|
476 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
|
477 |
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
478 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
|
479 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
|
480 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
|
481 |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
767
diff
changeset
|
482 AbstractXYItemRenderer renderer = (AbstractXYItemRenderer) |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
483 plot.getRenderer(); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
484 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
485 if (renderer instanceof XYLineAndShapeRenderer) |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
486 applyToXYLineAndShapeRenderer(plot); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
487 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
488 if (renderer instanceof XYBarRenderer) |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
489 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
|
490 } |
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 |
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 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
493 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
494 * 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
|
495 * <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
|
496 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
497 * @param plot XYPlot |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
498 */ |
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
|
499 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
|
500 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
|
501 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
|
502 |
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 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
|
504 (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
|
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 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
|
507 -(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
|
508 ); |
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
|
509 |
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
|
510 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
|
511 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
|
512 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
|
513 |
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
|
514 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
|
515 } |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
516 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
517 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
518 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
519 * 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
|
520 * <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
|
521 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
522 * @param plot XYPlot |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
617
diff
changeset
|
523 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
524 protected void applyToXYBarRenderer(XYPlot plot) { |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
525 if (plot == null) |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
526 return; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
527 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
528 XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer(); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
529 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
530 renderer.setSeriesPaint(0, histogramBasePaint); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
531 } |
304
a16d337c5678
The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
532 } |
836
05bf8534a35a
Using unix line endings only.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
793
diff
changeset
|
533 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |