comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ChartSettings.java @ 1986:3632150dbe0b

Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress). flys-artifacts/trunk@3418 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 14 Dec 2011 14:17:31 +0000
parents
children 5c1e7c1e9e09
comparison
equal deleted inserted replaced
1985:07b176b14205 1986:3632150dbe0b
1 package de.intevation.flys.exports;
2
3 import de.intevation.artifactdatabase.state.DefaultSection;
4 import de.intevation.artifactdatabase.state.DefaultSettings;
5 import de.intevation.artifactdatabase.state.Section;
6
7
8 /**
9 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
10 */
11 public class ChartSettings extends DefaultSettings {
12
13 protected Section chartSection;
14 protected Section axesSection;
15
16
17 public ChartSettings() {
18 super();
19
20 axesSection = new DefaultSection("axes");
21 addSection(axesSection);
22 }
23
24
25 /**
26 * Sets the chart section. Old chart sections are removed.
27 *
28 * @param chartSection A new Section that stores chart specific attributes.
29 */
30 public void setChartSection(Section chartSection) {
31 Section oldChartSection = getChartSection();
32
33 if (oldChartSection != null) {
34 removeSection(oldChartSection);
35 }
36
37 this.chartSection = chartSection;
38 addSection(chartSection);
39 }
40
41
42 /**
43 * Returns the Section that stores chart specific attributes.
44 *
45 * @return the Section that stores chart specific attributes.
46 */
47 public Section getChartSection() {
48 return chartSection;
49 }
50
51
52 /**
53 * Adds a Section for a new axis of the chart.
54 *
55 * @param axisSection The Section specific for a chart axis.
56 */
57 public void addAxisSection(Section axisSection) {
58 if (axisSection != null) {
59 axesSection.addSubsection(axisSection);
60 }
61 }
62 }
63 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org