teichmann@5863: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde teichmann@5863: * Software engineering by Intevation GmbH teichmann@5863: * teichmann@5994: * This file is Free Software under the GNU AGPL (>=v3) teichmann@5863: * and comes with ABSOLUTELY NO WARRANTY! Check out the teichmann@5994: * documentation coming with Dive4Elements River for details. teichmann@5863: */ teichmann@5863: teichmann@5831: package org.dive4elements.river.exports; ingo@1990: ingo@1990: ingo@1990: /** felix@3148: * Settings regarding legend of chart. ingo@1990: * @author Ingo Weinzierl ingo@1990: */ ingo@2058: public class LegendSection extends TypeSection { ingo@1990: felix@3148: public static final String VISIBILITY_ATTR = "visibility"; felix@3148: public static final String FONTSIZE_ATTR = "font-size"; felix@3148: public static final String AGGREGATION_ATTR = "aggregation-threshold"; ingo@1990: ingo@1990: ingo@1990: public LegendSection() { ingo@1990: super("legend"); ingo@1990: } ingo@1990: ingo@1990: felix@3148: /** Register font size attribute and value. */ ingo@1990: public void setFontSize(int fontSize) { ingo@1990: if (fontSize <= 0) { ingo@1990: return; ingo@1990: } ingo@1990: ingo@2058: setIntegerValue(FONTSIZE_ATTR, fontSize); ingo@1990: } ingo@1990: ingo@1990: ingo@2046: public Integer getFontSize() { ingo@2058: return getIntegerValue(FONTSIZE_ATTR); ingo@2046: } ingo@2046: ingo@2046: felix@3148: public Integer getAggregationThreshold() { felix@3148: return getIntegerValue(AGGREGATION_ATTR); felix@3148: } felix@3148: felix@3148: felix@3148: public void setAggregationThreshold(int aggregationThreshold) { felix@3148: setIntegerValue(AGGREGATION_ATTR, Math.abs(aggregationThreshold)); felix@3148: } felix@3148: felix@3148: ingo@1990: public void setVisibility(boolean visibility) { ingo@2058: setBooleanValue(VISIBILITY_ATTR, visibility); ingo@1990: } ingo@2046: ingo@2046: ingo@2046: public Boolean getVisibility() { ingo@2058: return getBooleanValue(VISIBILITY_ATTR); ingo@2046: } ingo@1990: } ingo@1990: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :