annotate artifacts/src/main/java/org/dive4elements/river/exports/ChartSettings.java @ 8202:e4606eae8ea5

sed src/**/*.java 's/logger/log/g'
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 05 Sep 2014 12:58:17 +0200
parents fca46ce8e4f5
children 6dfc3a1fc70d
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3618
diff changeset
9 package org.dive4elements.river.exports;
1986
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
11 import javax.xml.xpath.XPathConstants;
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
12
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
13 import org.w3c.dom.Node;
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
14 import org.w3c.dom.NodeList;
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
15
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
16 import org.apache.log4j.Logger;
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
17
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3618
diff changeset
18 import org.dive4elements.artifacts.common.utils.XMLUtils;
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
19
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3618
diff changeset
20 import org.dive4elements.artifactdatabase.state.DefaultSection;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3618
diff changeset
21 import org.dive4elements.artifactdatabase.state.DefaultSettings;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3618
diff changeset
22 import org.dive4elements.artifactdatabase.state.Section;
1986
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 /**
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 */
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28 public class ChartSettings extends DefaultSettings {
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
30 private static final Logger log = Logger.getLogger(ChartSettings.class);
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
31
2046
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1994
diff changeset
32 protected ChartSection chartSection;
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1994
diff changeset
33 protected LegendSection legendSection;
2056
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
34 protected ExportSection exportSection;
2046
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1994
diff changeset
35 protected Section axesSection;
1986
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 public ChartSettings() {
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39 super();
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 axesSection = new DefaultSection("axes");
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 addSection(axesSection);
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 }
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 /**
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 * Sets the chart section. Old chart sections are removed.
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 *
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 * @param chartSection A new Section that stores chart specific attributes.
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 */
2046
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1994
diff changeset
51 public void setChartSection(ChartSection chartSection) {
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1994
diff changeset
52 ChartSection oldChartSection = getChartSection();
1986
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 if (oldChartSection != null) {
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 removeSection(oldChartSection);
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56 }
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58 this.chartSection = chartSection;
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59 addSection(chartSection);
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 }
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63 /**
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 * Returns the Section that stores chart specific attributes.
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 *
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 * @return the Section that stores chart specific attributes.
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 */
2046
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1994
diff changeset
68 public ChartSection getChartSection() {
1986
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 return chartSection;
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 }
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 /**
1990
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
74 * Sets the legend section. Old legend sections are removed.
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
75 *
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
76 * @param legendSection A new Section that stores legend specific
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
77 * attributes.
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
78 */
2046
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1994
diff changeset
79 public void setLegendSection(LegendSection legendSection) {
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1994
diff changeset
80 LegendSection oldLegendSection = getLegendSection();
1990
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
81
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
82 if (oldLegendSection != null) {
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
83 removeSection(oldLegendSection);
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
84 }
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
85
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
86 this.legendSection = legendSection;
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
87 addSection(legendSection);
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
88 }
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
89
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
90
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
91 /**
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
92 * Returns the Section that stores legend specific attributes.
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
93 *
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
94 * @return the Section that stores legend specific attributes.
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
95 */
2046
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1994
diff changeset
96 public LegendSection getLegendSection() {
1990
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
97 return legendSection;
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
98 }
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
99
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
100
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1986
diff changeset
101 /**
2056
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
102 * Sets the export section. Old export sections are removed.
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
103 *
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
104 * @param exportSection A new Section that stores export specific
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
105 * attributes.
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
106 */
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
107 public void setExportSection(ExportSection exportSection) {
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
108 ExportSection oldExportSection = getExportSection();
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
109
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
110 if (oldExportSection != null) {
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
111 removeSection(oldExportSection);
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
112 }
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
113
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
114 this.exportSection = exportSection;
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
115 addSection(exportSection);
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
116 }
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
117
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
118
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
119 /**
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
120 * Returns the Section that stores export specific attributes.
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
121 *
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
122 * @return the Section that stores export specific attributes.
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
123 */
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
124 public ExportSection getExportSection() {
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
125 return exportSection;
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
126 }
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
127
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
128
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
129 /**
1986
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
130 * Adds a Section for a new axis of the chart.
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
131 *
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
132 * @param axisSection The Section specific for a chart axis.
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
133 */
2050
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
134 public void addAxisSection(AxisSection axisSection) {
1986
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
135 if (axisSection != null) {
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
136 axesSection.addSubsection(axisSection);
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
137 }
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
138 }
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
139
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
140
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
141 /**
2050
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
142 * This method returns an AxisSection specified by <i>axisId</i> or null if
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
143 * no AxisSection is existing with identifier <i>axisId</i>.
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
144 *
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
145 * @param axisId The identifier of the wanted AxisSection.
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
146 *
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
147 * @return the AxisSection specified by <i>axisId</i> or null.
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
148 */
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
149 public AxisSection getAxisSection(String axisId) {
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
150 for (int i = 0, n = axesSection.getSubsectionCount(); i < n; i++) {
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
151 AxisSection as = (AxisSection) axesSection.getSubsection(i);
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
152 String id = as.getIdentifier();
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
153
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
154 if (id != null && id.equals(axisId)) {
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
155 return as;
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
156 }
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
157 }
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
158
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
159 return null;
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
160 }
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
161
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
162
c4e0e433f825 Use axes ranges specified in ChartSettings for zooming in charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
163 /**
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
164 * Parses the settings from <i>settings</i>. The result is a new
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
165 * ChartSettings instance.
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
166 *
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
167 * @param settings A <i>settings</i> node.
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
168 *
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
169 * @return a new <i>ChartSettings</i> instance.
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
170 */
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
171 public static ChartSettings parse(Node settings) {
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
172 if (settings == null) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
173 log.warn("Tried to parse ChartSettings from empty Node!");
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
174 return null;
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
175 }
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
176
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
177 ChartSettings chartSettings = new ChartSettings();
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
178
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
179 parseAxes(chartSettings, settings);
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
180 parseChart(chartSettings, settings);
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
181 parseLegend(chartSettings, settings);
2056
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
182 parseExport(chartSettings, settings);
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
183
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
184 return chartSettings;
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
185 }
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
186
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
187
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
188 protected static void parseAxes(ChartSettings target, Node settings) {
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
189 NodeList axesList = (NodeList) XMLUtils.xpath(
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
190 settings, "axes/axis", XPathConstants.NODESET, null);
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
191
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
192 int num = axesList != null ? axesList.getLength() : 0;
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
193
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
194 if (num <= 0) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
195 log.debug("No axis sections found.");
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
196 return;
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
197 }
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
198
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
199 for (int i = 0; i < num; i++) {
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
200 parseAxis(target, axesList.item(i));
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
201 }
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
202 }
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
203
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
204
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
205 protected static void parseAxis(ChartSettings target, Node axis) {
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
206 AxisSection section = new AxisSection();
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
207
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
208 String id = XMLUtils.xpathString(axis, "id", null);
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
209 String label = XMLUtils.xpathString(axis, "label", null);
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
210 String fSize = XMLUtils.xpathString(axis, "font-size", null);
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
211 String fixation = XMLUtils.xpathString(axis, "fixation", null);
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
212 String low = XMLUtils.xpathString(axis, "lower", null);
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
213 String up = XMLUtils.xpathString(axis, "upper", null);
7597
fca46ce8e4f5 (issue1225) Implement Magic labels.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
214 String sugLabel = XMLUtils.xpathString(axis, "suggested-label", null);
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
215
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
216 if (log.isDebugEnabled()) {
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
217 log.debug("Found axis id: '" + id + "'");
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
218 log.debug("Found axis label: '" + label + "'");
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
219 log.debug("Found axis font size: '" + fSize + "'");
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
220 log.debug("Found axis fixation: '" + fixation + "'");
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
221 log.debug("Found axis lower: '" + low + "'");
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
222 log.debug("Found axis upper: '" + up + "'");
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
223 log.debug("Found axis sug. label:'" + sugLabel + "'");
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
224 }
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
225
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
226 section.setIdentifier(id);
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
227 section.setLabel(label);
3405
b0ba96bbf01d Use Integer.parseInt() instead of Integer.valueOf() + Autounboxing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3153
diff changeset
228 section.setFontSize(Integer.parseInt(fSize.length() > 0 ? fSize : "-1"));
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
229 section.setFixed(Boolean.valueOf(fixation));
3405
b0ba96bbf01d Use Integer.parseInt() instead of Integer.valueOf() + Autounboxing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3153
diff changeset
230 section.setLowerRange(Double.parseDouble(low.length() > 0 ? low : "0"));
b0ba96bbf01d Use Integer.parseInt() instead of Integer.valueOf() + Autounboxing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3153
diff changeset
231 section.setUpperRange(Double.parseDouble(up.length() > 0 ? up : "0"));
7597
fca46ce8e4f5 (issue1225) Implement Magic labels.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
232 section.setSuggestedLabel(sugLabel);
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
233
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
234 target.addAxisSection(section);
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
235 }
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
236
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
237
3615
f84854eba0b3 Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3613
diff changeset
238 /**
f84854eba0b3 Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3613
diff changeset
239 * From document chart create ChartSection and populate it with attributes.
f84854eba0b3 Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3613
diff changeset
240 * Give this object to target as chartsection.
f84854eba0b3 Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3613
diff changeset
241 */
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
242 protected static void parseChart(ChartSettings target, Node chart) {
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
243 ChartSection chartSection = new ChartSection();
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
244
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
245 String title = XMLUtils.xpathString(chart, "chart/title", null);
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
246 String sub = XMLUtils.xpathString(chart, "chart/subtitle", null);
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
247 String grid = XMLUtils.xpathString(chart, "chart/display-grid", null);
3615
f84854eba0b3 Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3613
diff changeset
248 String logo = XMLUtils.xpathString(chart, "chart/display-logo", null);
3618
b7867c03760a Split logo placement property in two (vertical/horizontal).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3617
diff changeset
249 String placeh = XMLUtils.xpathString(chart, "chart/logo-placeh", null);
b7867c03760a Split logo placement property in two (vertical/horizontal).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3617
diff changeset
250 String placev = XMLUtils.xpathString(chart, "chart/logo-placev", null);
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
251
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
252 if (log.isDebugEnabled()) {
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
253 log.debug("Found chart title: '" + title + "'");
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
254 log.debug("Found chart subtitle: '" + sub + "'");
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
255 log.debug("Found chart grid: '" + grid + "'");
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
256 log.debug("Found chart logo: '" + logo + "'");
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
257 log.debug("Found chart logo placeh: '" + placeh + "'");
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
258 log.debug("Found chart logo placev: '" + placev + "'");
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
259 }
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
260
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
261 chartSection.setTitle(title);
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
262 chartSection.setSubtitle(sub);
3613
dd6e25980c91 Fixed typo.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3405
diff changeset
263 chartSection.setDisplayGrid(Boolean.valueOf(grid));
3615
f84854eba0b3 Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3613
diff changeset
264 chartSection.setDisplayLogo(logo);
3618
b7867c03760a Split logo placement property in two (vertical/horizontal).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3617
diff changeset
265 chartSection.setLogoHPlacement(placeh);
b7867c03760a Split logo placement property in two (vertical/horizontal).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3617
diff changeset
266 chartSection.setLogoVPlacement(placev);
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
267
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
268 target.setChartSection(chartSection);
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
269 }
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
270
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
271
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
272 protected static void parseLegend(ChartSettings target, Node legend) {
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
273 LegendSection section = new LegendSection();
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
274
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
275 String vis = XMLUtils.xpathString(legend, "legend/visibility", null);
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
276 String fSize = XMLUtils.xpathString(legend, "legend/font-size", null);
3153
46b9391b122a Parse legend aggregation threshold value for settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2056
diff changeset
277 String lthre = XMLUtils.xpathString(legend, "legend/aggregation-threshold", null);
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
278
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
279 if (log.isDebugEnabled()) {
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
280 log.debug("Found legend visibility: '" + vis + "'");
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
281 log.debug("Found legend font size : '" + fSize + "'");
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
282 log.debug("Found legend aggregation threshold : '" + lthre + "'");
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
283 }
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
284
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
285 section.setVisibility(Boolean.valueOf(vis));
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
286 section.setFontSize(Integer.valueOf(fSize.length() > 0 ? fSize : "-1"));
3153
46b9391b122a Parse legend aggregation threshold value for settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2056
diff changeset
287 section.setAggregationThreshold(Integer.valueOf(lthre.length() >0 ? lthre : "-1"));
1994
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
288
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
289 target.setLegendSection(section);
3e703d134bbe Parse the Settings of each Output during Collection's describe() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
290 }
2056
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
291
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
292
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
293 protected static void parseExport(ChartSettings target, Node export) {
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
294 ExportSection section = new ExportSection();
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
295
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
296 String width = XMLUtils.xpathString(export, "export/width", null);
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
297 String height = XMLUtils.xpathString(export, "export/height", null);
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
298
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
299 if (log.isDebugEnabled()) {
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
300 log.debug("Found export width : '" + width + "'");
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7597
diff changeset
301 log.debug("Found export height: '" + height + "'");
2056
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
302 }
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
303
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
304 section.setWidth(Integer.valueOf(width.length() > 0 ? width : "-1"));
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
305 section.setHeight(Integer.valueOf(height.length() > 0 ? height : "-1"));
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
306
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
307 target.setExportSection(section);
76eeb3b4358e Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2050
diff changeset
308 }
1986
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
309 }
3632150dbe0b Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
310 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org