comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java @ 2263:bdd032bfd978

Minor i18n for reference curve chart added. flys-artifacts/trunk@3919 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 06 Feb 2012 13:04:52 +0000
parents dd93a8e1377a
children c9a40e3fdf16
comparison
equal deleted inserted replaced
2262:07d6b386ca76 2263:bdd032bfd978
1 package de.intevation.flys.exports; 1 package de.intevation.flys.exports;
2 2
3 import org.w3c.dom.Document;
4
5 import java.awt.Font;
6
7 import org.apache.log4j.Logger;
8
9 import org.jfree.chart.JFreeChart;
10 import org.jfree.chart.axis.NumberAxis;
11 import org.jfree.chart.title.TextTitle;
12
13 import org.jfree.data.xy.XYSeries;
14
3 import de.intevation.artifactdatabase.state.ArtifactAndFacet; 15 import de.intevation.artifactdatabase.state.ArtifactAndFacet;
4 16
5 import de.intevation.flys.artifacts.model.FacetTypes; 17 import de.intevation.flys.artifacts.model.FacetTypes;
6 18 import de.intevation.flys.artifacts.model.WW;
7 import de.intevation.flys.artifacts.model.WW.ApplyFunctionIterator; 19 import de.intevation.flys.artifacts.model.WW.ApplyFunctionIterator;
8
9 import de.intevation.flys.artifacts.model.WW;
10 import de.intevation.flys.artifacts.model.WWAxisTypes; 20 import de.intevation.flys.artifacts.model.WWAxisTypes;
11 21
12 import de.intevation.flys.jfree.StyledXYSeries; 22 import de.intevation.flys.jfree.StyledXYSeries;
13
14 import java.awt.Font;
15
16 import org.apache.log4j.Logger;
17
18 import org.jfree.chart.axis.NumberAxis;
19
20 import org.jfree.data.xy.XYSeries;
21
22 import org.w3c.dom.Document;
23 23
24 24
25 /** 25 /**
26 * An OutGenerator that generates reference curves. 26 * An OutGenerator that generates reference curves.
27 */ 27 */
38 } 38 }
39 39
40 private static Logger logger = 40 private static Logger logger =
41 Logger.getLogger(ReferenceCurveGenerator.class); 41 Logger.getLogger(ReferenceCurveGenerator.class);
42 42
43 /*
44 public static final String I18N_CHART_TITLE = 43 public static final String I18N_CHART_TITLE =
45 "chart.reference.curve.title"; 44 "chart.reference.curve.title";
46 45
47 public static final String I18N_CHART_SUBTITLE = 46 public static final String I18N_CHART_SUBTITLE =
48 "chart.reference.curve.subtitle"; 47 "chart.reference.curve.subtitle";
49 48
49 /*
50
50 public static final String I18N_XAXIS_LABEL = 51 public static final String I18N_XAXIS_LABEL =
51 "chart.reference.curve.xaxis.label"; 52 "chart.reference.curve.xaxis.label";
52 53
53 public static final String I18N_YAXIS_LABEL = 54 public static final String I18N_YAXIS_LABEL =
54 "chart.reference.curve.yaxis.label"; 55 "chart.reference.curve.yaxis.label";
55 56 */
56 public static final String I18N_CHART_TITLE_DEFAULT = 57 public static final String I18N_CHART_TITLE_DEFAULT =
57 "Bezugslinie"; 58 "Bezugslinie";
58 59 /*
59 public static final String I18N_XAXIS_LABEL_DEFAULT = 60 public static final String I18N_XAXIS_LABEL_DEFAULT =
60 "W [NN+m]"; 61 "W [NN+m]";
61 62
62 public static final String I18N_YAXIS_LABEL_DEFAULT = 63 public static final String I18N_YAXIS_LABEL_DEFAULT =
63 "W [NN + m]"; 64 "W [NN + m]";
83 } 84 }
84 axis.setLabelFont(labelFont); 85 axis.setLabelFont(labelFont);
85 return axis; 86 return axis;
86 } 87 }
87 88
89
88 /** Get default chart title. */ 90 /** Get default chart title. */
89 @Override 91 @Override
90 protected String getDefaultChartTitle() { 92 protected String getDefaultChartTitle() {
91 // TODO i18n return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT); 93 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT);
92 return "Bezugslinien"; 94 }
93 } 95
94
95 /*
96 // TODO i18n
97 @Override 96 @Override
98 protected String getDefaultChartSubtitle() { 97 protected String getDefaultChartSubtitle() {
99 double[] dist = getRange();
100
101 Object[] args = new Object[] { 98 Object[] args = new Object[] {
102 getRiverName(), 99 getRiverName(),
103 dist[0]
104 }; 100 };
105 101
106 return msg(I18N_CHART_SUBTITLE, "", args); 102 return msg(I18N_CHART_SUBTITLE, "", args);
107 } 103 }
108 104
113 109
114 if (subtitle != null && subtitle.length() > 0) { 110 if (subtitle != null && subtitle.length() > 0) {
115 chart.addSubtitle(new TextTitle(subtitle)); 111 chart.addSubtitle(new TextTitle(subtitle));
116 } 112 }
117 } 113 }
118 */
119 114
120 115
121 /** Get Label for X-axis (W). */ 116 /** Get Label for X-axis (W). */
122 @Override 117 @Override
123 protected String getDefaultXAxisLabel() { 118 protected String getDefaultXAxisLabel() {
124 // TODO i18nreturn msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); 119 // TODO i18nreturn msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT);
125 return "W!"; 120 return "W am Bezugsort- oder Pegel.";
126 } 121 }
127 122
128 123
129 /** 124 /**
130 * Get Label for primary and other Y Axes. 125 * Get Label for primary and other Y Axes.
134 protected String getDefaultYAxisLabel(int index) { 129 protected String getDefaultYAxisLabel(int index) {
135 String label = "default"; 130 String label = "default";
136 if (index == YAXIS.W.idx) { 131 if (index == YAXIS.W.idx) {
137 //label = msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); 132 //label = msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT);
138 //TODO i18n 133 //TODO i18n
139 return "W over W over W"; 134 return "W am Zielort oder -pegel";
140 } 135 }
141 136
142 return label; 137 return label;
143 } 138 }
144 139

http://dive4elements.wald.intevation.org