Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FlowVelocityState.java @ 4466:4d856f11e527
FlowVelocityState: Create new discharge facet.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 09 Nov 2012 12:08:15 +0100 |
parents | 5b8919ef601d |
children | bb267a0aa8c2 |
comparison
equal
deleted
inserted
replaced
4465:ffed8687e2b1 | 4466:4d856f11e527 |
---|---|
18 import de.intevation.flys.artifacts.model.FlowVelocityData; | 18 import de.intevation.flys.artifacts.model.FlowVelocityData; |
19 import de.intevation.flys.artifacts.model.FlowVelocityFacet; | 19 import de.intevation.flys.artifacts.model.FlowVelocityFacet; |
20 import de.intevation.flys.artifacts.resources.Resources; | 20 import de.intevation.flys.artifacts.resources.Resources; |
21 | 21 |
22 | 22 |
23 /* State in which flow velocities can/will be calculated. */ | |
23 public class FlowVelocityState extends DefaultState implements FacetTypes { | 24 public class FlowVelocityState extends DefaultState implements FacetTypes { |
24 | 25 |
25 private static Logger logger = Logger.getLogger(FlowVelocityState.class); | 26 private static Logger logger = Logger.getLogger(FlowVelocityState.class); |
26 | |
27 | 27 |
28 public static final String I18N_MAINCHANNEL_FACET = | 28 public static final String I18N_MAINCHANNEL_FACET = |
29 "facet.flow_velocity.mainchannel"; | 29 "facet.flow_velocity.mainchannel"; |
30 | 30 |
31 public static final String I18N_TOTALCHANNEL_FACET = | 31 public static final String I18N_TOTALCHANNEL_FACET = |
32 "facet.flow_velocity.totalchannel"; | 32 "facet.flow_velocity.totalchannel"; |
33 | 33 |
34 public static final String I18N_TAU_FACET = | 34 public static final String I18N_TAU_FACET = |
35 "facet.flow_velocity.tauchannel"; | 35 "facet.flow_velocity.tauchannel"; |
36 | |
37 public static final String I18N_DISCHARGE_FACET = | |
38 "facet.flow_velocity.discharge"; | |
36 | 39 |
37 | 40 |
38 @Override | 41 @Override |
39 public Object computeAdvance( | 42 public Object computeAdvance( |
40 FLYSArtifact artifact, | 43 FLYSArtifact artifact, |
92 ComputeType.ADVANCE, | 95 ComputeType.ADVANCE, |
93 id, | 96 id, |
94 hash | 97 hash |
95 )); | 98 )); |
96 | 99 |
100 newFacets.add(new FlowVelocityFacet( | |
101 idx, | |
102 FLOW_VELOCITY_DISCHARGE, | |
103 buildDischargeName(artifact, context, d), | |
104 ComputeType.ADVANCE, | |
105 id, | |
106 hash | |
107 )); | |
108 | |
97 idx++; | 109 idx++; |
98 } | 110 } |
99 | 111 |
100 Facet csv = new DataFacet( | 112 Facet csv = new DataFacet( |
101 CSV, "CSV data", ComputeType.ADVANCE, hash, id); | 113 CSV, "CSV data", ComputeType.ADVANCE, hash, id); |
146 ) { | 158 ) { |
147 return buildFacetName(flys, cc, data, I18N_TOTALCHANNEL_FACET); | 159 return buildFacetName(flys, cc, data, I18N_TOTALCHANNEL_FACET); |
148 } | 160 } |
149 | 161 |
150 | 162 |
163 protected String buildDischargeName( | |
164 FLYSArtifact flys, | |
165 CallContext cc, | |
166 FlowVelocityData data | |
167 ) { | |
168 return buildFacetName(flys, cc, data, I18N_DISCHARGE_FACET); | |
169 } | |
170 | |
151 protected String buildTauName( | 171 protected String buildTauName( |
152 FLYSArtifact flys, | 172 FLYSArtifact flys, |
153 CallContext cc, | 173 CallContext cc, |
154 FlowVelocityData data | 174 FlowVelocityData data |
155 ) { | 175 ) { |