# HG changeset patch # User Raimund Renkert # Date 1400664909 -7200 # Node ID d4792d01480d09a771a5255e26be61139cde0eb9 # Parent e7131b769148e6ab63fe6a27cc9b063d45169c17 New class and interface for metadata in chart series and datasets. diff -r e7131b769148 -r d4792d01480d artifacts/src/main/java/org/dive4elements/river/jfree/XYMetaDataset.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/artifacts/src/main/java/org/dive4elements/river/jfree/XYMetaDataset.java Wed May 21 11:35:09 2014 +0200 @@ -0,0 +1,32 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + +package org.dive4elements.river.jfree; + +import java.util.Map; + +import org.dive4elements.artifacts.Artifact; +import org.dive4elements.artifacts.CallContext; + + +public interface XYMetaDataset +{ + + /** + * The meta data for this data set. + */ + Map getMetaData(); + + /** + * Add meta data for this data set. + */ + void putMetaData( + Map metaData, + Artifact artifact, + CallContext context); +} diff -r e7131b769148 -r d4792d01480d artifacts/src/main/java/org/dive4elements/river/jfree/XYMetaSeriesCollection.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/artifacts/src/main/java/org/dive4elements/river/jfree/XYMetaSeriesCollection.java Wed May 21 11:35:09 2014 +0200 @@ -0,0 +1,28 @@ +package org.dive4elements.river.jfree; + +import java.util.Map; + +import org.jfree.data.xy.XYSeries; +import org.jfree.data.xy.XYSeriesCollection; + + +public class XYMetaSeriesCollection +extends XYSeriesCollection +{ + + protected Map metaData; + + public XYMetaSeriesCollection(XYSeries series) { + super(series); + if (series instanceof XYMetaDataset) { + this.metaData = ((XYMetaDataset) series).getMetaData(); + } + else { + metaData = null; + } + } + + public Map getMetaData() { + return this.metaData; + } +}