comparison flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java @ 1734:25d481cad4fb

Simplified handling of W(Q)Kms data to plot. flys-artifacts/trunk@3019 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 18 Oct 2011 15:34:07 +0000
parents ffab6de07dc5
children 4ae7df2a74ed
comparison
equal deleted inserted replaced
1733:ffab6de07dc5 1734:25d481cad4fb
144 } 144 }
145 else if (name.equals(LONGITUDINAL_W)) { 145 else if (name.equals(LONGITUDINAL_W)) {
146 doWOut((WQKms) f.getData(artifact, context), facet, attr, visible); 146 doWOut((WQKms) f.getData(artifact, context), facet, attr, visible);
147 } 147 }
148 else if (name.equals("other.wkms")) { 148 else if (name.equals("other.wkms")) {
149 doWOut((WKms) f.getData(artifact, context), attr, visible); 149 doWOut((WKms) f.getData(artifact, context), facet, attr, visible);
150 } 150 }
151 else { 151 else {
152 logger.warn("Unknown facet name: " + name); 152 logger.warn("Unknown facet name: " + name);
153 return; 153 return;
154 } 154 }
160 * differences were calculated). 160 * differences were calculated).
161 * 161 *
162 * @param wqkms The wqkms to add to the diagram. 162 * @param wqkms The wqkms to add to the diagram.
163 * @param theme The theme that contains styling information. 163 * @param theme The theme that contains styling information.
164 */ 164 */
165 @Override
166 protected void doWOut( 165 protected void doWOut(
167 WQKms wqkms, 166 WKms wkms,
168 Facet facet, 167 Facet facet,
169 Document theme, 168 Document theme,
170 boolean visible 169 boolean visible
171 ) { 170 ) {
172 logger.debug("WDifferencesCurveGenerator.doWOut"); 171 logger.debug("WDifferencesCurveGenerator.doWOut");
173 172
174 XYSeries series = new StyledXYSeries(facet.getDescription(), theme); 173 XYSeries series = new StyledXYSeries(facet.getDescription(), theme);
175 174
176 int size = wqkms.size(); 175 int size = wkms.size();
177 176
178 for (int i = 0; i < size; i++) { 177 for (int i = 0; i < size; i++) {
179 series.add(wqkms.getKm(i), wqkms.getW(i)); 178 series.add(wkms.getKm(i), wkms.getW(i));
180 } 179 }
181 180
182 // Note: the only difference in the super-implementation 181 // Note: the only difference in the super-implementation
183 // (in LongitudinalSectionGenerator) is here (adds with 182 // (in LongitudinalSectionGenerator) is here (adds with
184 // addFirstAxisSeries() . 183 // addFirstAxisSeries() .
185 addSecondAxisSeries(series, visible); 184 addSecondAxisSeries(series, visible);
186 185
187 if (needInvertAxis(wqkms)) { 186 if (wkms instanceof WQKms) {
188 setInverted(true); 187 if (needInvertAxis((WQKms) wkms)) {
189 } 188 setInverted(true);
190 } 189 }
191 190 }
192
193 protected void doWOut(WKms wkms, Document theme, boolean visible) {
194 logger.debug("WDifferencesCurveGenerator.doWOut");
195
196 XYSeries series = new StyledXYSeries("Wurb", theme);//getSeriesName(wqkms, "W"), theme);
197
198 int size = wkms.size();
199
200 for (int i = 0; i < size; i++) {
201 series.add(wkms.getKm(i), wkms.getW(i));
202 }
203
204 // Note: the only difference in the super-implementation
205 // (in LongitudinalSectionGenerator) is here (adds with
206 // addFirstAxisSeries() .
207 addSecondAxisSeries(series, visible);
208
209 /*
210 TODO
211 if (needInvertAxis(wkms)) {
212 setInverted(true);
213 }
214 */
215 } 191 }
216 192
217 193
218 /** 194 /**
219 * Add items to dataseries which describes the differences. 195 * Add items to dataseries which describes the differences.

http://dive4elements.wald.intevation.org