Mercurial > dive4elements > river
view flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeLongitudinalSectionGenerator.java @ 4282:8b4988815974
Added marker for Ws and Qs in Historical Discharge WQ charts.
Therefore, the XYChartGenerator got two new methods addDomainMarker(Marker, boolean) and addValueMarker(Marker, boolean).
The boolean parameters determine, if the marker should be visible or not. This is analogous to addAxisSeries(XYSeries, int, boolean).
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 29 Oct 2012 05:59:27 +0100 |
parents | 1fcaeced48f2 |
children | 9425b7c51b73 |
line wrap: on
line source
package de.intevation.flys.exports; import org.apache.log4j.Logger; import org.jfree.data.xy.XYSeries; import org.w3c.dom.Document; import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.artifactdatabase.state.Facet; import de.intevation.flys.artifacts.model.FacetTypes; import de.intevation.flys.artifacts.model.WQCKms; import de.intevation.flys.artifacts.model.WQKms; import de.intevation.flys.artifacts.model.WKms; import de.intevation.flys.jfree.FLYSAnnotation; import de.intevation.flys.jfree.StyledXYSeries; /** * An OutGenerator that generates discharge longitudinal section curves. * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class DischargeLongitudinalSectionGenerator extends LongitudinalSectionGenerator implements FacetTypes { private static Logger logger = Logger.getLogger(DischargeLongitudinalSectionGenerator.class); public DischargeLongitudinalSectionGenerator() { super(); } @Override public void doOut( ArtifactAndFacet artifactFacet, Document attr, boolean visible ) { logger.debug("DischargeLongitudinalSectionGenerator.doOut"); String name = artifactFacet.getFacetName(); if (name == null) { return; } Facet facet = artifactFacet.getFacet(); if (IS.WQ_KM(name)) { doWOut( (WQKms) artifactFacet.getData(context), artifactFacet, attr, visible); } else if (name.equals(DISCHARGE_LONGITUDINAL_Q)) { doQOut( (WQKms) artifactFacet.getData(context), artifactFacet, attr, visible); } else if (name.equals(DISCHARGE_LONGITUDINAL_C)) { doCorrectedWOut( (WQCKms) artifactFacet.getData(context), facet, attr, visible); } else if (IS.W_KM(name)) { doWOut( (WKms) artifactFacet.getData(context), artifactFacet, attr, visible); } else if (name.equals(LONGITUDINAL_ANNOTATION)) { doAnnotations((FLYSAnnotation) artifactFacet.getData(context), artifactFacet, attr, visible); } else if (FacetTypes.IS.MANUALPOINTS(name)) { doPoints(artifactFacet.getData(context), artifactFacet, attr, visible, YAXIS.W.idx); } else { logger.warn("Unknown facet name: " + name); } } /** * Adds a new series for the corrected W curve. * * @param wqckms The object that contains the corrected W values. * @param theme The theme that contains styling information. */ protected void doCorrectedWOut( WQCKms wqckms, Facet facet, Document theme, boolean visible ) { logger.debug("DischargeLongitudinalSectionGenerator.doCorrectedWOut"); int size = wqckms.size(); if (size > 0) { XYSeries series = new StyledXYSeries( facet.getDescription(), theme); for (int i = 0; i < size; i++) { series.add(wqckms.getKm(i), wqckms.getC(i)); } addAxisSeries(series, YAXIS.W.idx, visible); } if (wqckms.guessWaterIncreasing()) { setInverted(true); } } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :