Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java @ 1745:4ae7df2a74ed
Fix NPE in WDiff-diagram because no ranges present in masterartifact.
flys-artifacts/trunk@3039 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 19 Oct 2011 16:06:01 +0000 |
parents | 25d481cad4fb |
children | f7072039ad84 |
comparison
equal
deleted
inserted
replaced
1744:62efd1288e34 | 1745:4ae7df2a74ed |
---|---|
1 package de.intevation.flys.exports; | 1 package de.intevation.flys.exports; |
2 | 2 |
3 import org.apache.log4j.Logger; | 3 import org.apache.log4j.Logger; |
4 | |
5 import org.jfree.chart.title.TextTitle; | |
4 | 6 |
5 import org.jfree.chart.JFreeChart; | 7 import org.jfree.chart.JFreeChart; |
6 import org.jfree.chart.plot.XYPlot; | 8 import org.jfree.chart.plot.XYPlot; |
7 import org.jfree.data.xy.XYSeries; | 9 import org.jfree.data.xy.XYSeries; |
8 import org.jfree.data.Range; | 10 import org.jfree.data.Range; |
72 protected String get2YAxisDefaultLabel() { | 74 protected String get2YAxisDefaultLabel() { |
73 return I18N_WDIFF_2YAXIS_LABEL_DEFAULT; | 75 return I18N_WDIFF_2YAXIS_LABEL_DEFAULT; |
74 } | 76 } |
75 | 77 |
76 | 78 |
79 | |
77 /** | 80 /** |
78 * Gets key to look up internationalized String for the charts subtitle. | 81 * Gets key to look up internationalized String for the charts subtitle. |
79 * @return key to look up translated subtitle. | 82 * @return key to look up translated subtitle. |
80 */ | 83 */ |
81 @Override | 84 @Override |
186 if (wkms instanceof WQKms) { | 189 if (wkms instanceof WQKms) { |
187 if (needInvertAxis((WQKms) wkms)) { | 190 if (needInvertAxis((WQKms) wkms)) { |
188 setInverted(true); | 191 setInverted(true); |
189 } | 192 } |
190 } | 193 } |
194 } | |
195 | |
196 /** | |
197 * Add (internationalized) subtitle to chart. | |
198 * Overridden to avoid trying to access the range of masterartifact. | |
199 * @see getChartSubtitleKey | |
200 */ | |
201 @Override | |
202 protected void addSubtitles(JFreeChart chart) { | |
203 | |
204 // TODO i18n | |
205 /* | |
206 Object[] args = new Object[] { | |
207 getRiverName() | |
208 }; | |
209 */ | |
210 String subtitle = getRiverName(); | |
211 chart.addSubtitle(new TextTitle(subtitle)); | |
191 } | 212 } |
192 | 213 |
193 | 214 |
194 /** | 215 /** |
195 * Add items to dataseries which describes the differences. | 216 * Add items to dataseries which describes the differences. |