[PATCH 1 of 5] New class and interface for metadata in chart series and datasets
Wald Commits
scm-commit at wald.intevation.org
Wed May 21 11:43:48 CEST 2014
# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1400664909 -7200
# Branch facet-metadata
# 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<String, String> getMetaData();
+
+ /**
+ * Add meta data for this data set.
+ */
+ void putMetaData(
+ Map<String, String> 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<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;
+ }
+}
More information about the Dive4Elements-commits
mailing list