aheinecke@7165: /* Copyright (C) 2013 by Bundesanstalt für Gewässerkunde aheinecke@7165: * Software engineering by Intevation GmbH aheinecke@7165: * aheinecke@7165: * This file is Free Software under the GNU AGPL (>=v3) aheinecke@7165: * and comes with ABSOLUTELY NO WARRANTY! Check out the aheinecke@7165: * documentation coming with Dive4Elements River for details. aheinecke@7165: */ aheinecke@7165: aheinecke@7165: package org.dive4elements.river.exports.process; aheinecke@7165: aheinecke@7165: import org.apache.log4j.Logger; aheinecke@7165: import org.jfree.data.xy.XYSeries; aheinecke@7165: aheinecke@7165: import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; aheinecke@7165: import org.dive4elements.artifacts.CallContext; aheinecke@7165: import org.dive4elements.river.artifacts.model.FacetTypes; aheinecke@7165: import org.dive4elements.river.exports.DiagramGenerator; aheinecke@7165: import org.dive4elements.river.exports.StyledSeriesBuilder; aheinecke@7165: import org.dive4elements.river.jfree.StyledXYSeries; aheinecke@7165: import org.dive4elements.river.themes.ThemeDocument; aheinecke@7165: aheinecke@7165: import org.dive4elements.river.artifacts.model.FlowVelocityData; aheinecke@7165: aheinecke@7165: public class ShearStressProcessor extends DefaultProcessor { aheinecke@7165: aheinecke@7165: private final static Logger logger = aheinecke@7165: Logger.getLogger(ShearStressProcessor.class); aheinecke@7165: aheinecke@7165: public static final String I18N_AXIS_LABEL = aheinecke@7608: "chart.flow_velocity.section.yaxis.second.label"; aheinecke@7165: public static final String I18N_AXIS_LABEL_DEFAULT = aheinecke@7608: "Schubspannung 1.3 Pau [N]"; aheinecke@7165: aheinecke@7165: @Override aheinecke@7165: public void doOut( aheinecke@7165: DiagramGenerator generator, aheinecke@7165: ArtifactAndFacet bundle, aheinecke@7165: ThemeDocument theme, aheinecke@7165: boolean visible) { aheinecke@7165: CallContext context = generator.getCallContext(); aheinecke@7165: XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), aheinecke@7165: theme); aheinecke@7165: String facetName = bundle.getFacetName(); aheinecke@7165: FlowVelocityData data = (FlowVelocityData) bundle.getData(context); aheinecke@7165: aheinecke@7165: StyledSeriesBuilder.addPoints(series, data.getTauPoints(), true); aheinecke@7165: aheinecke@7165: generator.addAxisSeries(series, axisName, visible); aheinecke@7165: } aheinecke@7165: aheinecke@7165: @Override aheinecke@7165: public boolean canHandle(String facettype) { aheinecke@7165: return facettype.equals(FacetTypes.FLOW_VELOCITY_TAU) || aheinecke@7165: facettype.equals(FacetTypes.FLOW_VELOCITY_TAU_FILTERED); aheinecke@7165: } aheinecke@7165: aheinecke@7165: @Override aheinecke@7165: public String getAxisLabel(DiagramGenerator generator) { aheinecke@7165: return generator.msg( aheinecke@7165: I18N_AXIS_LABEL, aheinecke@7165: I18N_AXIS_LABEL_DEFAULT); aheinecke@7165: } aheinecke@7165: } aheinecke@7165: