comparison flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java @ 1712:7e19449d7826

#253 Modified the title creation of chart curves - titles will now equal the Facet's description. flys-artifacts/trunk@2984 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 17 Oct 2011 10:47:36 +0000
parents e99b4bd32cd5
children ffab6de07dc5
comparison
equal deleted inserted replaced
1711:f708120cb7bc 1712:7e19449d7826
136 } 136 }
137 137
138 if (name.equals(W_DIFFERENCES)) { 138 if (name.equals(W_DIFFERENCES)) {
139 doWDifferencesOut( 139 doWDifferencesOut(
140 (WKms) f.getData(artifact, context), 140 (WKms) f.getData(artifact, context),
141 f.getDescription(), 141 facet,
142 attr, 142 attr,
143 visible); 143 visible);
144 } 144 }
145 else if (name.equals(LONGITUDINAL_W)) { 145 else if (name.equals(LONGITUDINAL_W)) {
146 doWOut((WQKms) f.getData(artifact, context), attr, visible); 146 doWOut((WQKms) f.getData(artifact, context), facet, attr, visible);
147 } 147 }
148 else { 148 else {
149 logger.warn("Unknown facet name: " + name); 149 logger.warn("Unknown facet name: " + name);
150 return; 150 return;
151 } 151 }
158 * 158 *
159 * @param wqkms The wqkms to add to the diagram. 159 * @param wqkms The wqkms to add to the diagram.
160 * @param theme The theme that contains styling information. 160 * @param theme The theme that contains styling information.
161 */ 161 */
162 @Override 162 @Override
163 protected void doWOut(WQKms wqkms, Document theme, boolean visible) { 163 protected void doWOut(
164 WQKms wqkms,
165 Facet facet,
166 Document theme,
167 boolean visible
168 ) {
164 logger.debug("WDifferencesCurveGenerator.doWOut"); 169 logger.debug("WDifferencesCurveGenerator.doWOut");
165 170
166 XYSeries series = new StyledXYSeries(getSeriesName(wqkms, "W"), theme); 171 XYSeries series = new StyledXYSeries(facet.getDescription(), theme);
167 172
168 int size = wqkms.size(); 173 int size = wqkms.size();
169 174
170 for (int i = 0; i < size; i++) { 175 for (int i = 0; i < size; i++) {
171 series.add(wqkms.getKm(i), wqkms.getW(i)); 176 series.add(wqkms.getKm(i), wqkms.getW(i));
185 /** 190 /**
186 * Add items to dataseries which describes the differences. 191 * Add items to dataseries which describes the differences.
187 */ 192 */
188 protected void doWDifferencesOut( 193 protected void doWDifferencesOut(
189 WKms wkms, 194 WKms wkms,
190 String seriesName, 195 Facet facet,
191 Document theme, 196 Document theme,
192 boolean visible 197 boolean visible
193 ) { 198 ) {
194 logger.debug("WDifferencesCurveGenerator.doWDifferencesOut"); 199 logger.debug("WDifferencesCurveGenerator.doWDifferencesOut");
195 if (wkms == null) { 200 if (wkms == null) {
196 logger.warn("No data to add to WDifferencesChart."); 201 logger.warn("No data to add to WDifferencesChart.");
197 return; 202 return;
198 } 203 }
199 204
200 int size = wkms.size(); 205 int size = wkms.size();
201 XYSeries series = new StyledXYSeries(seriesName, theme); 206 XYSeries series = new StyledXYSeries(facet.getDescription(), theme);
202 207
203 if (logger.isDebugEnabled()) { 208 if (logger.isDebugEnabled()) {
204 if (wkms.size() > 0) { 209 if (wkms.size() > 0) {
205 logger.debug("Generate series: " + series.getKey()); 210 logger.debug("Generate series: " + series.getKey());
206 logger.debug("Start km: " + wkms.getKm(0)); 211 logger.debug("Start km: " + wkms.getKm(0));

http://dive4elements.wald.intevation.org