Mercurial > dive4elements > river
view artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/VelocityProcessor.java @ 9617:1d4262a68f1f
#12 Minuend/Subtrahend + MergeConflict #19 CollisionCalculation
author | dnt_bjoernsen <d.tironi@bjoernsen.de> |
---|---|
date | Thu, 10 Oct 2019 15:29:02 +0200 |
parents | 08f46ccd37ba |
children |
line wrap: on
line source
/* Copyright (C) 2017 by Bundesanstalt für Gewässerkunde * Software engineering by * Björnsen Beratende Ingenieure GmbH * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt * * This file is Free Software under the GNU AGPL (>=v3) * and comes with ABSOLUTELY NO WARRANTY! Check out the * documentation coming with Dive4Elements River for details. */ package org.dive4elements.river.artifacts.sinfo.common; import java.util.HashSet; import java.util.Set; import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; import org.dive4elements.artifactdatabase.state.Facet; import org.dive4elements.artifacts.CallContext; import org.dive4elements.river.artifacts.common.AbstractCalculationResult; import org.dive4elements.river.artifacts.common.AbstractProcessor; import org.dive4elements.river.exports.DiagramGenerator; import org.dive4elements.river.themes.ThemeDocument; public final class VelocityProcessor extends AbstractProcessor { public static final String FACET_TKH_VELOCITY_FILTERED = "sinfo_facet_velocity"; private static final String I18N_AXIS_LABEL = "sinfo.chart.tkh_velocity.section.yaxis.label"; private static final String SINFO_CHART_VELOCITY_YAXIS_LABEL = "sinfo.chart.tkh_velocity.yaxis.label"; private static final String I18N_FACET_TKH_VELOCITY_FILTERED_DESCRIPTION = "sinfo.facet.tkh_velocity.description"; private static final Set<String> HANDLED_FACET_TYPES = new HashSet<>(); static { HANDLED_FACET_TYPES.add(FACET_TKH_VELOCITY_FILTERED); } public VelocityProcessor() { super(I18N_AXIS_LABEL, HANDLED_FACET_TYPES); } protected SInfoResultType doGetType(final String facetName) { if (FACET_TKH_VELOCITY_FILTERED.contentEquals(facetName)) return SInfoResultType.velocity; final String error = String.format("Unknown facet name: %s", facetName); throw new UnsupportedOperationException(error); } public static Facet createVelocityFacet(final CallContext context, final String hash, final String id, final AbstractCalculationResult result, final int index) { return AbstractProcessor.createFacet(context, hash, id, result, index, SINFO_CHART_VELOCITY_YAXIS_LABEL, FACET_TKH_VELOCITY_FILTERED, I18N_FACET_TKH_VELOCITY_FILTERED_DESCRIPTION); } @Override protected String generateSeries(final DiagramGenerator generator, final ArtifactAndFacet bundle, final ThemeDocument theme, final boolean visible) { // TODO Auto-generated method stub return buildSeriesForType(generator, bundle, theme, visible, doGetType(bundle.getFacetName()), GAP_DISTANCE); } }