Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java @ 1645:4a8251eae217
Bugfix: #68 Set number format of chart plot axes based on the CallMeta instance for each request.
flys-artifacts/trunk@2832 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 27 Sep 2011 10:06:19 +0000 |
parents | 9383a4608d9f |
children | bdb05dc9b763 |
comparison
equal
deleted
inserted
replaced
1644:2df1f9facd6c | 1645:4a8251eae217 |
---|---|
1 package de.intevation.flys.exports; | 1 package de.intevation.flys.exports; |
2 | 2 |
3 import java.io.IOException; | 3 import java.io.IOException; |
4 import java.io.OutputStream; | 4 import java.io.OutputStream; |
5 import java.util.Locale; | |
5 | 6 |
6 import javax.xml.xpath.XPathConstants; | 7 import javax.xml.xpath.XPathConstants; |
7 | 8 |
8 import org.apache.log4j.Logger; | 9 import org.apache.log4j.Logger; |
9 | 10 |
12 | 13 |
13 import org.jfree.data.Range; | 14 import org.jfree.data.Range; |
14 | 15 |
15 import de.intevation.artifacts.Artifact; | 16 import de.intevation.artifacts.Artifact; |
16 import de.intevation.artifacts.CallContext; | 17 import de.intevation.artifacts.CallContext; |
18 import de.intevation.artifacts.CallMeta; | |
19 import de.intevation.artifacts.PreferredLocale; | |
17 | 20 |
18 import de.intevation.artifacts.ArtifactNamespaceContext; | 21 import de.intevation.artifacts.ArtifactNamespaceContext; |
19 import de.intevation.artifacts.common.utils.XMLUtils; | 22 import de.intevation.artifacts.common.utils.XMLUtils; |
20 | 23 |
21 import de.intevation.artifactdatabase.state.Facet; | 24 import de.intevation.artifactdatabase.state.Facet; |
79 } | 82 } |
80 | 83 |
81 | 84 |
82 public void setMasterArtifact(Artifact master) { | 85 public void setMasterArtifact(Artifact master) { |
83 this.master = master; | 86 this.master = master; |
87 } | |
88 | |
89 | |
90 protected Locale getLocale() { | |
91 CallMeta meta = context.getMeta(); | |
92 PreferredLocale[] prefs = meta.getLanguages(); | |
93 | |
94 int len = prefs != null ? prefs.length : 0; | |
95 | |
96 Locale[] locales = new Locale[len]; | |
97 | |
98 for (int i = 0; i < len; i++) { | |
99 locales[i] = prefs[i].getLocale(); | |
100 } | |
101 | |
102 return meta.getPreferredLocale(locales); | |
84 } | 103 } |
85 | 104 |
86 | 105 |
87 protected String msg(String key, String def) { | 106 protected String msg(String key, String def) { |
88 return Resources.getMsg(context.getMeta(), key, def); | 107 return Resources.getMsg(context.getMeta(), key, def); |