Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/process/BedDiffHeightYearProcessor.java @ 7892:e844be34a606 facet-metadata
Add metadata to chart series and datasets.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 21 May 2014 11:40:14 +0200 |
parents | ea6b441b4872 |
children | 10debf4b82be |
comparison
equal
deleted
inserted
replaced
7891:4fe290eddb43 | 7892:e844be34a606 |
---|---|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the | 5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
6 * documentation coming with Dive4Elements River for details. | 6 * documentation coming with Dive4Elements River for details. |
7 */ | 7 */ |
8 | 8 |
9 package org.dive4elements.river.exports.process; | 9 package org.dive4elements.river.exports.process; |
10 | |
11 import java.util.Map; | |
10 | 12 |
11 import org.apache.log4j.Logger; | 13 import org.apache.log4j.Logger; |
12 import org.jfree.data.xy.XYSeries; | 14 import org.jfree.data.xy.XYSeries; |
13 | 15 |
14 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; | 16 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; |
48 ArtifactAndFacet bundle, | 50 ArtifactAndFacet bundle, |
49 ThemeDocument theme, | 51 ThemeDocument theme, |
50 boolean visible) { | 52 boolean visible) { |
51 CallContext context = generator.getCallContext(); | 53 CallContext context = generator.getCallContext(); |
52 Object data = bundle.getData(context); | 54 Object data = bundle.getData(context); |
55 Map<String, String> metaData = bundle.getFacet().getMetaData( | |
56 bundle.getArtifact(), context); | |
53 | 57 |
54 if (!(data instanceof BedDiffYearResult)) { | 58 if (!(data instanceof BedDiffYearResult)) { |
55 // Should not happen if canHandle is correct | 59 // Should not happen if canHandle is correct |
56 logger.error("Can't process " + data.getClass().getName() + " objects"); | 60 logger.error("Can't process " + data.getClass().getName() + " objects"); |
57 return; | 61 return; |
71 context.getMeta(), | 75 context.getMeta(), |
72 I18N_SUBTITLE_RADIUS, | 76 I18N_SUBTITLE_RADIUS, |
73 new Object[] { radius })); | 77 new Object[] { radius })); |
74 } | 78 } |
75 BedDiffYearResult bData = (BedDiffYearResult) data; | 79 BedDiffYearResult bData = (BedDiffYearResult) data; |
76 XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme); | 80 StyledXYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme); |
81 series.putMetaData(metaData, bundle.getArtifact(), context); | |
77 StyledSeriesBuilder.addPoints(series, bData.getHeightPerYearData(), false, GAP_TOLERANCE); | 82 StyledSeriesBuilder.addPoints(series, bData.getHeightPerYearData(), false, GAP_TOLERANCE); |
78 | 83 |
79 generator.addAxisSeries(series, axisName, visible); | 84 generator.addAxisSeries(series, axisName, visible); |
80 } | 85 } |
81 | 86 |