Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/process/BedQualityPorosityProcessor.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 | 693778752ee7 |
children | 98ca61cb58fb |
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; |
30 public static final String I18N_AXIS_LABEL_DEFAULT = | 32 public static final String I18N_AXIS_LABEL_DEFAULT = |
31 "Porosität [%]"; | 33 "Porosität [%]"; |
32 public static final String I18N_AXIS_LABEL = | 34 public static final String I18N_AXIS_LABEL = |
33 "chart.bedquality.yaxis.label.porosity"; | 35 "chart.bedquality.yaxis.label.porosity"; |
34 | 36 |
37 protected String yAxisLabel; | |
38 | |
35 @Override | 39 @Override |
36 public void doOut( | 40 public void doOut( |
37 DiagramGenerator generator, | 41 DiagramGenerator generator, |
38 ArtifactAndFacet bundle, | 42 ArtifactAndFacet bundle, |
39 ThemeDocument theme, | 43 ThemeDocument theme, |
40 boolean visible) { | 44 boolean visible) { |
41 CallContext context = generator.getCallContext(); | 45 CallContext context = generator.getCallContext(); |
42 XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), | 46 Map<String, String> metaData = bundle.getFacet().getMetaData(); |
47 StyledXYSeries series = new StyledXYSeries(bundle.getFacetDescription(), | |
43 theme); | 48 theme); |
49 series.putMetaData(metaData, bundle.getArtifact(), context); | |
50 yAxisLabel = metaData.get("Y"); | |
44 Object data = bundle.getData(context); | 51 Object data = bundle.getData(context); |
45 String facetName = bundle.getFacetName(); | 52 String facetName = bundle.getFacetName(); |
46 double [][] points; | 53 double [][] points; |
47 | 54 |
48 if (facetName.equals(FacetTypes.BED_QUALITY_POROSITY_TOPLAYER)) { | 55 if (facetName.equals(FacetTypes.BED_QUALITY_POROSITY_TOPLAYER)) { |
67 facettype.equals(FacetTypes.POROSITY); | 74 facettype.equals(FacetTypes.POROSITY); |
68 } | 75 } |
69 | 76 |
70 @Override | 77 @Override |
71 public String getAxisLabel(DiagramGenerator generator) { | 78 public String getAxisLabel(DiagramGenerator generator) { |
79 if (yAxisLabel != null && !yAxisLabel.isEmpty()) { | |
80 return generator.msg(yAxisLabel, I18N_AXIS_LABEL_DEFAULT); | |
81 } | |
72 return generator.msg( | 82 return generator.msg( |
73 I18N_AXIS_LABEL, | 83 I18N_AXIS_LABEL, |
74 I18N_AXIS_LABEL_DEFAULT); | 84 I18N_AXIS_LABEL_DEFAULT); |
75 } | 85 } |
76 } | 86 } |