Mercurial > dive4elements > river
changeset 7890:d4792d01480d facet-metadata
New class and interface for metadata in chart series and datasets.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 21 May 2014 11:35:09 +0200 |
parents | e7131b769148 |
children | 4fe290eddb43 |
files | artifacts/src/main/java/org/dive4elements/river/jfree/XYMetaDataset.java artifacts/src/main/java/org/dive4elements/river/jfree/XYMetaSeriesCollection.java |
diffstat | 2 files changed, 60 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /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<String, String> getMetaData(); + + /** + * Add meta data for this data set. + */ + void putMetaData( + Map<String, String> metaData, + Artifact artifact, + CallContext context); +}
--- /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<String, String> metaData; + + public XYMetaSeriesCollection(XYSeries series) { + super(series); + if (series instanceof XYMetaDataset) { + this.metaData = ((XYMetaDataset) series).getMetaData(); + } + else { + metaData = null; + } + } + + public Map<String, String> getMetaData() { + return this.metaData; + } +}