Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/VelocityProcessor.java @ 9203:9831f6c60473
AbstractSInfoLineProcessor refactoring
author | gernotbelger |
---|---|
date | Mon, 02 Jul 2018 13:00:59 +0200 |
parents | 23945061daec |
children | 08f46ccd37ba |
rev | line source |
---|---|
8940 | 1 /* Copyright (C) 2017 by Bundesanstalt für Gewässerkunde |
2 * Software engineering by | |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
10 | |
11 package org.dive4elements.river.artifacts.sinfo.common; | |
12 | |
13 import java.util.HashSet; | |
14 import java.util.Set; | |
15 | |
9203 | 16 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; |
8940 | 17 import org.dive4elements.artifactdatabase.state.Facet; |
18 import org.dive4elements.artifacts.CallContext; | |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8980
diff
changeset
|
19 import org.dive4elements.river.artifacts.common.AbstractCalculationResult; |
9203 | 20 import org.dive4elements.river.exports.DiagramGenerator; |
21 import org.dive4elements.river.themes.ThemeDocument; | |
8940 | 22 |
9203 | 23 public final class VelocityProcessor extends AbstractSInfoProcessor { |
8940 | 24 |
8980
b194fa64506a
SINFO - show results themes according to spec, either raw data or floating mean values.
gernotbelger
parents:
8956
diff
changeset
|
25 public static final String FACET_TKH_VELOCITY_FILTERED = "sinfo_facet_velocity"; |
8940 | 26 |
8941
a9950a3a71e5
SINFO - tkh, configured result facets and themes
gernotbelger
parents:
8940
diff
changeset
|
27 private static final String I18N_AXIS_LABEL = "sinfo.chart.tkh_velocity.section.yaxis.label"; |
8940 | 28 |
8941
a9950a3a71e5
SINFO - tkh, configured result facets and themes
gernotbelger
parents:
8940
diff
changeset
|
29 private static final String SINFO_CHART_VELOCITY_YAXIS_LABEL = "sinfo.chart.tkh_velocity.yaxis.label"; |
8940 | 30 |
8980
b194fa64506a
SINFO - show results themes according to spec, either raw data or floating mean values.
gernotbelger
parents:
8956
diff
changeset
|
31 private static final String I18N_FACET_TKH_VELOCITY_FILTERED_DESCRIPTION = "sinfo.facet.tkh_velocity.description"; |
8940 | 32 |
33 private static final Set<String> HANDLED_FACET_TYPES = new HashSet<>(); | |
34 | |
35 static { | |
36 HANDLED_FACET_TYPES.add(FACET_TKH_VELOCITY_FILTERED); | |
37 } | |
38 | |
39 public VelocityProcessor() { | |
40 super(I18N_AXIS_LABEL, HANDLED_FACET_TYPES); | |
41 } | |
42 | |
9203 | 43 protected SInfoResultType doGetType(final String facetName) { |
8940 | 44 |
45 if (FACET_TKH_VELOCITY_FILTERED.contentEquals(facetName)) | |
9203 | 46 return SInfoResultType.velocity; |
8940 | 47 |
48 final String error = String.format("Unknown facet name: %s", facetName); | |
49 throw new UnsupportedOperationException(error); | |
50 } | |
51 | |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8980
diff
changeset
|
52 public static Facet createVelocityFacet(final CallContext context, final String hash, final String id, final AbstractCalculationResult result, |
8940 | 53 final int index) { |
9203 | 54 return AbstractSInfoProcessor.createFacet(context, hash, id, result, index, SINFO_CHART_VELOCITY_YAXIS_LABEL, FACET_TKH_VELOCITY_FILTERED, |
8956 | 55 I18N_FACET_TKH_VELOCITY_FILTERED_DESCRIPTION); |
8940 | 56 } |
9203 | 57 |
58 @Override | |
59 protected String generateSeries(final DiagramGenerator generator, final ArtifactAndFacet bundle, final ThemeDocument theme, final boolean visible) { | |
60 // TODO Auto-generated method stub | |
61 return buildSeriesForType(generator, bundle, theme, visible, doGetType(bundle.getFacetName()), GAP_DISTANCE); | |
62 } | |
8940 | 63 } |