comparison artifacts/src/main/java/org/dive4elements/river/exports/DischargeCurveGenerator.java @ 9556:9b8e8fc1f408

Use facetName in all processors as themeType for legend aggregation.
author gernotbelger
date Tue, 23 Oct 2018 16:26:58 +0200
parents 740d65e4aa14
children
comparison
equal deleted inserted replaced
9555:ef5754ba5573 9556:9b8e8fc1f408
236 final MiscDischargeProcessor dProcessor = new MiscDischargeProcessor(getRange()[0]); 236 final MiscDischargeProcessor dProcessor = new MiscDischargeProcessor(getRange()[0]);
237 if (dProcessor.canHandle(name)) { 237 if (dProcessor.canHandle(name)) {
238 // In Base DischargeCurveGenerator, always at gauge, use WCm axis. 238 // In Base DischargeCurveGenerator, always at gauge, use WCm axis.
239 dProcessor.doOut(this, artifactFacet, theme, visible, YAXIS.WCm.idx); 239 dProcessor.doOut(this, artifactFacet, theme, visible, YAXIS.WCm.idx);
240 } else if (name.equals(DISCHARGE_CURVE) || name.equals(GAUGE_DISCHARGE_CURVE)) { 240 } else if (name.equals(DISCHARGE_CURVE) || name.equals(GAUGE_DISCHARGE_CURVE)) {
241 doDischargeOut((D4EArtifact) artifactFacet.getArtifact(), artifactFacet.getData(context), artifactFacet.getFacetDescription(), theme, visible); 241 doDischargeOut(artifactFacet.getFacetName(),(D4EArtifact) artifactFacet.getArtifact(), artifactFacet.getData(context), artifactFacet.getFacetDescription(), theme, visible);
242 } else if (FacetTypes.IS.MANUALPOINTS(name)) { 242 } else if (FacetTypes.IS.MANUALPOINTS(name)) {
243 doPoints(artifactFacet.getData(context), artifactFacet, theme, visible, YAXIS.W.idx); 243 doPoints(artifactFacet.getData(context), artifactFacet, theme, visible, YAXIS.W.idx);
244 } else if (STATIC_WQ.equals(name)) { 244 } else if (STATIC_WQ.equals(name)) {
245 doWQOut(artifactFacet.getData(context), artifactFacet, theme, visible); 245 doWQOut(artifactFacet.getData(context), artifactFacet, theme, visible);
246 } else { 246 } else {
249 } 249 }
250 } 250 }
251 251
252 /** 252 /**
253 * Add series with discharge curve to diagram. 253 * Add series with discharge curve to diagram.
254 */ 254 * @param string
255 protected void doDischargeOut(final D4EArtifact artifact, final Object o, final String description, final ThemeDocument theme, final boolean visible) { 255 */
256 protected void doDischargeOut(String facetName, final D4EArtifact artifact, final Object o, final String description, final ThemeDocument theme, final boolean visible) {
256 log.debug("DischargeCurveGenerator.doDischargeOut"); 257 log.debug("DischargeCurveGenerator.doDischargeOut");
257 final WQKms wqkms = (WQKms) o; 258 final WQKms wqkms = (WQKms) o;
258 259
259 final String gaugeName = wqkms.getName(); 260 final String gaugeName = wqkms.getName();
260 261
270 if (gauge == null) { 271 if (gauge == null) {
271 log.debug("no gauge found"); 272 log.debug("no gauge found");
272 return; 273 return;
273 } 274 }
274 275
275 final XYSeries series = new StyledXYSeries(description, theme); 276 final XYSeries series = new StyledXYSeries(facetName, description, theme);
276 277
277 StyledSeriesBuilder.addPointsQW(series, wqkms); 278 StyledSeriesBuilder.addPointsQW(series, wqkms);
278 279
279 addAxisSeries(series, YAXIS.W.idx, visible); 280 addAxisSeries(series, YAXIS.W.idx, visible);
280 } 281 }
287 * @param theme 288 * @param theme
288 * theme to use. 289 * theme to use.
289 */ 290 */
290 protected void doQOut(final Object wqkms, final ArtifactAndFacet aaf, final ThemeDocument theme, final boolean visible) { 291 protected void doQOut(final Object wqkms, final ArtifactAndFacet aaf, final ThemeDocument theme, final boolean visible) {
291 log.debug("DischargeCurveGenerator: doQOut (add W/Q data)."); 292 log.debug("DischargeCurveGenerator: doQOut (add W/Q data).");
292 final XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); 293 final XYSeries series = new StyledXYSeries(aaf.getFacetName(), aaf.getFacetDescription(), theme);
293 294
294 StyledSeriesBuilder.addPointsQW(series, (WQKms) wqkms); 295 StyledSeriesBuilder.addPointsQW(series, (WQKms) wqkms);
295 296
296 addAxisSeries(series, YAXIS.W.idx, visible); 297 addAxisSeries(series, YAXIS.W.idx, visible);
297 } 298 }
354 doAnnotations(new RiverAnnotation(title, xy), aaf, theme, visible); 355 doAnnotations(new RiverAnnotation(title, xy), aaf, theme, visible);
355 return; 356 return;
356 } 357 }
357 358
358 // Otherwise add points. 359 // Otherwise add points.
359 final XYSeries series = new StyledXYSeries(title, theme); 360 final XYSeries series = new StyledXYSeries(aaf.getFacetName(),title, theme);
360 361
361 if (translate != 0d) { 362 if (translate != 0d) {
362 StyledSeriesBuilder.addPointsQW(series, data, -translate, 100d); 363 StyledSeriesBuilder.addPointsQW(series, data, -translate, 100d);
363 addAxisSeries(series, YAXIS.W.idx, visible); 364 addAxisSeries(series, YAXIS.W.idx, visible);
364 } else { 365 } else {

http://dive4elements.wald.intevation.org