Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/process/BedQualityDensityProcessor.java @ 8260:48d4921665e3
Making i18n work was just easier using less wrappers in this case (issue1631).
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 11 Sep 2014 17:37:03 +0200 |
parents | e4606eae8ea5 |
children | 36faef4f8acb |
comparison
equal
deleted
inserted
replaced
8259:1fc453fbc5df | 8260:48d4921665e3 |
---|---|
11 import java.util.Map; | 11 import java.util.Map; |
12 | 12 |
13 import org.apache.log4j.Logger; | 13 import org.apache.log4j.Logger; |
14 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; | 14 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; |
15 import org.dive4elements.artifacts.CallContext; | 15 import org.dive4elements.artifacts.CallContext; |
16 import org.dive4elements.artifacts.CallMeta; | |
17 | |
18 import org.dive4elements.river.artifacts.resources.Resources; | |
16 import org.dive4elements.river.artifacts.model.FacetTypes; | 19 import org.dive4elements.river.artifacts.model.FacetTypes; |
17 import org.dive4elements.river.exports.DiagramGenerator; | 20 import org.dive4elements.river.exports.DiagramGenerator; |
18 import org.dive4elements.river.exports.StyledSeriesBuilder; | 21 import org.dive4elements.river.exports.StyledSeriesBuilder; |
19 import org.dive4elements.river.jfree.StyledXYSeries; | 22 import org.dive4elements.river.jfree.StyledXYSeries; |
20 import org.dive4elements.river.themes.ThemeDocument; | 23 import org.dive4elements.river.themes.ThemeDocument; |
22 public class BedQualityDensityProcessor extends DefaultProcessor { | 25 public class BedQualityDensityProcessor extends DefaultProcessor { |
23 | 26 |
24 private final static Logger log = | 27 private final static Logger log = |
25 Logger.getLogger(BedQualityDensityProcessor.class); | 28 Logger.getLogger(BedQualityDensityProcessor.class); |
26 | 29 |
27 public static final String I18N_AXIS_LABEL_DEFAULT = | |
28 "Dichte [t/m^3]"; | |
29 public static final String I18N_AXIS_LABEL = | 30 public static final String I18N_AXIS_LABEL = |
30 "chart.bedquality.yaxis.label.density"; | 31 "chart.bedquality.yaxis.label.density"; |
31 | 32 |
32 protected String yAxisLabel; | 33 protected String yAxisLabel; |
33 @Override | 34 @Override |
64 facettype.equals(FacetTypes.BED_QUALITY_SEDIMENT_DENSITY_TOPLAYER); | 65 facettype.equals(FacetTypes.BED_QUALITY_SEDIMENT_DENSITY_TOPLAYER); |
65 } | 66 } |
66 | 67 |
67 @Override | 68 @Override |
68 public String getAxisLabel(DiagramGenerator generator) { | 69 public String getAxisLabel(DiagramGenerator generator) { |
70 | |
71 CallMeta meta = generator.getCallContext().getMeta(); | |
72 | |
69 if (yAxisLabel != null && !yAxisLabel.isEmpty()) { | 73 if (yAxisLabel != null && !yAxisLabel.isEmpty()) { |
70 return generator.msg(yAxisLabel, I18N_AXIS_LABEL_DEFAULT); | 74 return Resources.getMsg(meta, yAxisLabel); |
71 } | 75 } |
72 return generator.msg( | 76 return Resources.getMsg(meta, I18N_AXIS_LABEL); |
73 I18N_AXIS_LABEL, | |
74 I18N_AXIS_LABEL_DEFAULT); | |
75 } | 77 } |
76 } | 78 } |