ingo@2074: package de.intevation.flys.jfree; ingo@2074: ingo@2074: ingo@2074: import org.apache.log4j.Logger; ingo@2074: ingo@2074: import org.w3c.dom.Document; ingo@2074: ingo@2074: import org.jfree.data.xy.XYSeries; ingo@2074: felix@2652: import de.intevation.flys.jfree.HasLabel; felix@2652: ingo@2074: ingo@2074: /** ingo@2321: * @author Ingo Weinzierl ingo@2074: */ felix@2652: public class StyledXYSeries extends XYSeries implements StyledSeries, HasLabel { ingo@2074: ingo@2074: private static final Logger logger = Logger.getLogger(StyledXYSeries.class); ingo@2074: ingo@2321: protected Style style; ingo@2321: felix@2652: /** If this Series is to be labelled, use this String as label. */ felix@2652: protected String label; felix@2652: ingo@2074: ingo@2074: public StyledXYSeries(String key, Document theme) { ingo@2074: this(key, true, theme); felix@2652: this.label = key.toString(); ingo@2074: } ingo@2074: ingo@2074: ingo@2074: /** ingo@2074: * @param sorted whether or not to sort the points. Sorting will move NANs ingo@2074: * to one extrema which can cause problems in certain ingo@2074: * algorithms. ingo@2074: */ ingo@2074: public StyledXYSeries(String key, boolean sorted, Document theme) { ingo@2074: super(key, sorted); ingo@2321: setStyle(new XYStyle(theme)); felix@2652: this.label = key.toString(); ingo@2074: } ingo@2074: ingo@2074: ingo@2321: @Override ingo@2321: public void setStyle(Style style) { ingo@2321: this.style = style; ingo@2076: } ingo@2076: ingo@2076: ingo@2321: @Override ingo@2321: public Style getStyle() { ingo@2321: return style; ingo@2074: } felix@2652: felix@2652: felix@2652: @Override felix@2652: public String getLabel() { felix@2652: return label; felix@2652: } felix@2652: felix@2652: @Override felix@2652: public void setLabel(String label) { felix@2652: this.label = label; felix@2652: } ingo@2074: } ingo@2074: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :