Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java @ 1944:21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
flys-artifacts/trunk@3334 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 30 Nov 2011 10:10:42 +0000 |
parents | 9e9cfc036a3f |
children | 65f9d707caff |
comparison
equal
deleted
inserted
replaced
1943:06d8d371d244 | 1944:21a4d2c677a1 |
---|---|
15 import org.jfree.data.xy.XYSeries; | 15 import org.jfree.data.xy.XYSeries; |
16 | 16 |
17 import de.intevation.artifacts.Artifact; | 17 import de.intevation.artifacts.Artifact; |
18 | 18 |
19 import de.intevation.artifactdatabase.state.Facet; | 19 import de.intevation.artifactdatabase.state.Facet; |
20 import de.intevation.artifactdatabase.state.ArtifactAndFacet; | |
20 | 21 |
21 import de.intevation.flys.artifacts.FLYSArtifact; | 22 import de.intevation.flys.artifacts.FLYSArtifact; |
22 import de.intevation.flys.artifacts.model.FacetTypes; | 23 import de.intevation.flys.artifacts.model.FacetTypes; |
23 import de.intevation.flys.artifacts.model.WQDay; | 24 import de.intevation.flys.artifacts.model.WQDay; |
24 import de.intevation.flys.artifacts.resources.Resources; | 25 import de.intevation.flys.artifacts.resources.Resources; |
144 } | 145 } |
145 | 146 |
146 | 147 |
147 @Override | 148 @Override |
148 public void doOut( | 149 public void doOut( |
149 Artifact artifact, | 150 ArtifactAndFacet artifactFacet, |
150 Facet facet, | 151 Document attr, |
151 Document attr, | 152 boolean visible |
152 boolean visible | |
153 ) { | 153 ) { |
154 String name = facet != null ? facet.getName() : null; | 154 String name = artifactFacet.getFacetName(); |
155 | 155 |
156 logger.debug("DurationCurveGenerator.doOut: " + name); | 156 logger.debug("DurationCurveGenerator.doOut: " + name); |
157 | 157 |
158 if (name == null || name.length() == 0) { | 158 if (name == null || name.length() == 0) { |
159 logger.error("No facet given. Cannot create dataset."); | 159 logger.error("No facet given. Cannot create dataset."); |
160 return; | 160 return; |
161 } | 161 } |
162 | 162 |
163 FLYSArtifact flys = (FLYSArtifact) artifact; | |
164 Facet f = flys.getNativeFacet(facet); | |
165 | |
166 if (name.equals(DURATION_W)) { | 163 if (name.equals(DURATION_W)) { |
167 doWOut((WQDay) f.getData(artifact, context), attr, visible); | 164 doWOut((WQDay) artifactFacet.getData(context), attr, visible); |
168 } | 165 } |
169 else if (name.equals(DURATION_Q)) { | 166 else if (name.equals(DURATION_Q)) { |
170 doQOut((WQDay) f.getData(artifact, context), attr, visible); | 167 doQOut((WQDay) artifactFacet.getData(context), attr, visible); |
171 } | 168 } |
172 else if (name.equals(COMPUTED_DISCHARGE_MAINVALUES_Q) | 169 else if (name.equals(COMPUTED_DISCHARGE_MAINVALUES_Q) |
173 || name.equals(MAINVALUES_Q) | 170 || name.equals(MAINVALUES_Q) |
174 || name.equals(COMPUTED_DISCHARGE_MAINVALUES_W) | 171 || name.equals(COMPUTED_DISCHARGE_MAINVALUES_W) |
175 || name.equals(MAINVALUES_W) | 172 || name.equals(MAINVALUES_W) |
176 ) { | 173 ) { |
177 doAnnotations( | 174 doAnnotations( |
178 (FLYSAnnotation) f.getData(artifact, context), | 175 (FLYSAnnotation) artifactFacet.getData(context), |
179 facet, attr, visible); | 176 artifactFacet.getFacet(), attr, visible); |
180 } | 177 } |
181 else { | 178 else { |
182 logger.warn("Unknown facet name: " + name); | 179 logger.warn("Unknown facet name: " + name); |
183 return; | 180 return; |
184 } | 181 } |