Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/CollisionCountProcessor.java @ 9215:0fc9c82e744e
work on collison, flood_duration
author | gernotbelger |
---|---|
date | Tue, 03 Jul 2018 17:00:48 +0200 |
parents | artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/CollisionCountProcessor.java@6393e05a9610 |
children | 08f46ccd37ba |
rev | line source |
---|---|
9125
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
2 * Software engineering by |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
3 * Björnsen Beratende Ingenieure GmbH |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
5 * |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
6 * This file is Free Software under the GNU AGPL (>=v3) |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
8 * documentation coming with Dive4Elements River for details. |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
9 */ |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
10 |
9215 | 11 package org.dive4elements.river.artifacts.sinfo.collision; |
9125
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
12 |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
13 import java.util.HashSet; |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
14 import java.util.Set; |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
15 |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
16 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
17 import org.dive4elements.artifactdatabase.state.Facet; |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
18 import org.dive4elements.artifacts.CallMeta; |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
19 import org.dive4elements.river.artifacts.resources.Resources; |
9215 | 20 import org.dive4elements.river.artifacts.sinfo.common.AbstractSInfoProcessor; |
21 import org.dive4elements.river.artifacts.sinfo.common.SInfoResultType; | |
9125
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
22 import org.dive4elements.river.exports.DiagramGenerator; |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
23 import org.dive4elements.river.themes.ThemeDocument; |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
24 |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
25 /** |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
26 * Processor to generate a data series for bed collision count data loaded from the database |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
27 * |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
28 * @author Matthias Schäfer |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
29 * |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
30 */ |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
31 public class CollisionCountProcessor extends AbstractSInfoProcessor { |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
32 |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
33 public static final String FACET_COLLISION_COUNT = "sinfo_facet_collision_count"; |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
34 |
9126 | 35 private static final String I18N_AXIS_LABEL = "chart.collision_count.section.yaxis.label"; |
9125
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
36 |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
37 private static final String I18N_SERIES_NAME_PATTERN = "collision.count.title"; |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
38 |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
39 private static final Set<String> HANDLED_FACET_TYPES = new HashSet<>(); |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
40 |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
41 static { |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
42 HANDLED_FACET_TYPES.add(FACET_COLLISION_COUNT); |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
43 } |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
44 |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
45 public CollisionCountProcessor() { |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
46 super(I18N_AXIS_LABEL, HANDLED_FACET_TYPES); |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
47 } |
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
48 |
9215 | 49 public static Facet createFacet(final int facetIndex, final CallMeta callMeta, final String year) { |
50 return new CollisionFacet(facetIndex, FACET_COLLISION_COUNT, Resources.getMsg(callMeta, I18N_SERIES_NAME_PATTERN, I18N_SERIES_NAME_PATTERN, year), | |
9195 | 51 I18N_AXIS_LABEL); |
9125
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
52 } |
9157
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9126
diff
changeset
|
53 |
9200 | 54 @Override |
55 protected String generateSeries(final DiagramGenerator generator, final ArtifactAndFacet bundle, final ThemeDocument theme, final boolean visible) { | |
56 | |
57 return buildSeriesForType(generator, bundle, theme, visible, SInfoResultType.collisionCount, null); | |
58 } | |
9125
820ae41c81b6
Fixed adding missing files for the river bed collision counts selectable in the datacage
mschaefer
parents:
diff
changeset
|
59 } |