Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java @ 695:45cd58a2a2bb facets-slt
OutGenerators doOut() takes a facet object now instead of just its name.
flys-artifacts/branches/facets-slt@2137 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 16 Jun 2011 14:31:41 +0000 |
parents | 3dc61e00385e |
children | 708b270dfd30 |
comparison
equal
deleted
inserted
replaced
694:68c6c75a6f7c | 695:45cd58a2a2bb |
---|---|
14 import org.jfree.data.xy.XYSeries; | 14 import org.jfree.data.xy.XYSeries; |
15 import org.jfree.data.xy.XYSeriesCollection; | 15 import org.jfree.data.xy.XYSeriesCollection; |
16 | 16 |
17 import de.intevation.artifacts.Artifact; | 17 import de.intevation.artifacts.Artifact; |
18 | 18 |
19 import de.intevation.artifactdatabase.state.Facet; | |
20 | |
19 import de.intevation.flys.model.River; | 21 import de.intevation.flys.model.River; |
20 | 22 |
21 import de.intevation.flys.artifacts.WINFOArtifact; | 23 import de.intevation.flys.artifacts.WINFOArtifact; |
22 import de.intevation.flys.artifacts.model.WQDay; | 24 import de.intevation.flys.artifacts.model.WQDay; |
23 import de.intevation.flys.artifacts.resources.Resources; | 25 import de.intevation.flys.artifacts.resources.Resources; |
155 plot.setRangeAxis(1, qAxis); | 157 plot.setRangeAxis(1, qAxis); |
156 plot.mapDatasetToRangeAxis(1, 1); | 158 plot.mapDatasetToRangeAxis(1, 1); |
157 } | 159 } |
158 | 160 |
159 | 161 |
160 public void doOut(Artifact artifact, String facet, Document attr) { | 162 @Override |
161 logger.debug("DurationCurveGenerator.doOut: " + facet); | 163 public void doOut(Artifact artifact, Facet facet, Document attr) { |
162 | 164 String name = facet.getName(); |
163 if (facet == null || facet.length() == 0) { | 165 |
166 logger.debug("DurationCurveGenerator.doOut: " + name); | |
167 | |
168 if (name == null || name.length() == 0) { | |
164 logger.error("No facet given. Cannot create dataset."); | 169 logger.error("No facet given. Cannot create dataset."); |
165 return; | 170 return; |
166 } | 171 } |
167 | 172 |
168 WINFOArtifact winfo = (WINFOArtifact) artifact; | 173 WINFOArtifact winfo = (WINFOArtifact) artifact; |
169 River river = winfo.getRiver(); | 174 River river = winfo.getRiver(); |
170 | 175 |
171 if (facet.equals(DURATION_CURVE_W)) { | 176 if (name.equals(DURATION_CURVE_W)) { |
172 doWOut(getDurationCurveData(artifact), river.getName()); | 177 doWOut(getDurationCurveData(artifact), river.getName()); |
173 } | 178 } |
174 else if (facet.equals(DURATION_CURVE_Q)) { | 179 else if (name.equals(DURATION_CURVE_Q)) { |
175 doQOut(getDurationCurveData(artifact), river.getName()); | 180 doQOut(getDurationCurveData(artifact), river.getName()); |
176 } | 181 } |
177 else { | 182 else { |
178 logger.warn("Unknown facet name: " + facet); | 183 logger.warn("Unknown facet name: " + name); |
179 return; | 184 return; |
180 } | 185 } |
181 } | 186 } |
182 | 187 |
183 | 188 |