ingo@1986: package de.intevation.flys.exports; ingo@1986: ingo@1986: import de.intevation.artifactdatabase.state.DefaultSection; ingo@1986: import de.intevation.artifactdatabase.state.DefaultSettings; ingo@1986: import de.intevation.artifactdatabase.state.Section; ingo@1986: ingo@1986: ingo@1986: /** ingo@1986: * @author Ingo Weinzierl ingo@1986: */ ingo@1986: public class ChartSettings extends DefaultSettings { ingo@1986: ingo@1986: protected Section chartSection; ingo@1990: protected Section legendSection; ingo@1986: protected Section axesSection; ingo@1986: ingo@1986: ingo@1986: public ChartSettings() { ingo@1986: super(); ingo@1986: ingo@1986: axesSection = new DefaultSection("axes"); ingo@1986: addSection(axesSection); ingo@1986: } ingo@1986: ingo@1986: ingo@1986: /** ingo@1986: * Sets the chart section. Old chart sections are removed. ingo@1986: * ingo@1986: * @param chartSection A new Section that stores chart specific attributes. ingo@1986: */ ingo@1986: public void setChartSection(Section chartSection) { ingo@1986: Section oldChartSection = getChartSection(); ingo@1986: ingo@1986: if (oldChartSection != null) { ingo@1986: removeSection(oldChartSection); ingo@1986: } ingo@1986: ingo@1986: this.chartSection = chartSection; ingo@1986: addSection(chartSection); ingo@1986: } ingo@1986: ingo@1986: ingo@1986: /** ingo@1986: * Returns the Section that stores chart specific attributes. ingo@1986: * ingo@1986: * @return the Section that stores chart specific attributes. ingo@1986: */ ingo@1986: public Section getChartSection() { ingo@1986: return chartSection; ingo@1986: } ingo@1986: ingo@1986: ingo@1986: /** ingo@1990: * Sets the legend section. Old legend sections are removed. ingo@1990: * ingo@1990: * @param legendSection A new Section that stores legend specific ingo@1990: * attributes. ingo@1990: */ ingo@1990: public void setLegendSection(Section legendSection) { ingo@1990: Section oldLegendSection = getLegendSection(); ingo@1990: ingo@1990: if (oldLegendSection != null) { ingo@1990: removeSection(oldLegendSection); ingo@1990: } ingo@1990: ingo@1990: this.legendSection = legendSection; ingo@1990: addSection(legendSection); ingo@1990: } ingo@1990: ingo@1990: ingo@1990: /** ingo@1990: * Returns the Section that stores legend specific attributes. ingo@1990: * ingo@1990: * @return the Section that stores legend specific attributes. ingo@1990: */ ingo@1990: public Section getLegendSection() { ingo@1990: return legendSection; ingo@1990: } ingo@1990: ingo@1990: ingo@1990: /** ingo@1986: * Adds a Section for a new axis of the chart. ingo@1986: * ingo@1986: * @param axisSection The Section specific for a chart axis. ingo@1986: */ ingo@1986: public void addAxisSection(Section axisSection) { ingo@1986: if (axisSection != null) { ingo@1986: axesSection.addSubsection(axisSection); ingo@1986: } ingo@1986: } ingo@1986: } ingo@1986: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :