view 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
line wrap: on
line source
package de.intevation.flys.exports;

import de.intevation.artifactdatabase.state.DefaultSection;
import de.intevation.artifactdatabase.state.DefaultSettings;
import de.intevation.artifactdatabase.state.Section;


/**
 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
 */
public class ChartSettings extends DefaultSettings {

    protected Section chartSection;
    protected Section axesSection;


    public ChartSettings() {
        super();

        axesSection = new DefaultSection("axes");
        addSection(axesSection);
    }


    /**
     * Sets the chart section. Old chart sections are removed.
     *
     * @param chartSection A new Section that stores chart specific attributes.
     */
    public void setChartSection(Section chartSection) {
        Section oldChartSection = getChartSection();

        if (oldChartSection != null) {
            removeSection(oldChartSection);
        }

        this.chartSection = chartSection;
        addSection(chartSection);
    }


    /**
     * Returns the Section that stores chart specific attributes.
     *
     * @return the Section that stores chart specific attributes.
     */
    public Section getChartSection() {
        return chartSection;
    }


    /**
     * Adds a Section for a new axis of the chart.
     *
     * @param axisSection The Section specific for a chart axis.
     */
    public void addAxisSection(Section axisSection) {
        if (axisSection != null) {
            axesSection.addSubsection(axisSection);
        }
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org