Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/ReferenceCurveGenerator.java @ 6905:1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 22 Aug 2013 23:31:38 +0200 |
parents | af13ceeba52a |
children | e4606eae8ea5 |
comparison
equal
deleted
inserted
replaced
6904:d710bd3df387 | 6905:1b35b2ddfc28 |
---|---|
13 import org.dive4elements.river.artifacts.model.WW; | 13 import org.dive4elements.river.artifacts.model.WW; |
14 import org.dive4elements.river.artifacts.model.WW.ApplyFunctionIterator; | 14 import org.dive4elements.river.artifacts.model.WW.ApplyFunctionIterator; |
15 import org.dive4elements.river.artifacts.model.WWAxisTypes; | 15 import org.dive4elements.river.artifacts.model.WWAxisTypes; |
16 import org.dive4elements.river.jfree.RiverAnnotation; | 16 import org.dive4elements.river.jfree.RiverAnnotation; |
17 import org.dive4elements.river.jfree.StyledXYSeries; | 17 import org.dive4elements.river.jfree.StyledXYSeries; |
18 import org.dive4elements.river.themes.ThemeDocument; | |
18 import org.dive4elements.river.utils.Formatter; | 19 import org.dive4elements.river.utils.Formatter; |
19 | 20 |
20 import java.awt.geom.Point2D; | 21 import java.awt.geom.Point2D; |
21 | 22 |
22 import org.apache.log4j.Logger; | 23 import org.apache.log4j.Logger; |
23 import org.jfree.chart.axis.NumberAxis; | 24 import org.jfree.chart.axis.NumberAxis; |
24 import org.jfree.chart.axis.NumberTickUnit; | 25 import org.jfree.chart.axis.NumberTickUnit; |
25 import org.jfree.chart.axis.TickUnits; | 26 import org.jfree.chart.axis.TickUnits; |
26 import org.jfree.chart.axis.ValueAxis; | 27 import org.jfree.chart.axis.ValueAxis; |
27 import org.jfree.data.xy.XYSeries; | 28 import org.jfree.data.xy.XYSeries; |
28 import org.w3c.dom.Document; | |
29 | 29 |
30 /** | 30 /** |
31 * An OutGenerator that generates reference curves. | 31 * An OutGenerator that generates reference curves. |
32 */ | 32 */ |
33 public class ReferenceCurveGenerator | 33 public class ReferenceCurveGenerator |
135 * @param visible Whether or not the theme is visible. | 135 * @param visible Whether or not the theme is visible. |
136 */ | 136 */ |
137 @Override | 137 @Override |
138 public void doOut( | 138 public void doOut( |
139 ArtifactAndFacet artifactFacet, | 139 ArtifactAndFacet artifactFacet, |
140 Document theme, | 140 ThemeDocument theme, |
141 boolean visible | 141 boolean visible |
142 ) { | 142 ) { |
143 String name = artifactFacet.getFacetName(); | 143 String name = artifactFacet.getFacetName(); |
144 | 144 |
145 logger.debug("ReferenceCurveGenerator.doOut: " + name); | 145 logger.debug("ReferenceCurveGenerator.doOut: " + name); |
185 } | 185 } |
186 | 186 |
187 | 187 |
188 /** Register DataSeries with (maybe transformed) points. */ | 188 /** Register DataSeries with (maybe transformed) points. */ |
189 public void doReferenceOut( | 189 public void doReferenceOut( |
190 Object data, | 190 Object data, |
191 Document theme, | 191 ThemeDocument theme, |
192 boolean visible | 192 boolean visible |
193 ) { | 193 ) { |
194 WW ww = (WW)data; | 194 WW ww = (WW)data; |
195 | 195 |
196 Object obj = context.getContextValue("reference.curve.axis.scale"); | 196 Object obj = context.getContextValue("reference.curve.axis.scale"); |
197 | 197 |
214 addAxisSeries(series, YAXIS.W.idx, visible); | 214 addAxisSeries(series, YAXIS.W.idx, visible); |
215 } | 215 } |
216 | 216 |
217 // TODO resolve duplicate in DurationCurveGenerator | 217 // TODO resolve duplicate in DurationCurveGenerator |
218 protected void doPointOut( | 218 protected void doPointOut( |
219 Point2D point, | 219 Point2D point, |
220 ArtifactAndFacet aandf, | 220 ArtifactAndFacet aandf, |
221 Document theme, | 221 ThemeDocument theme, |
222 boolean visible | 222 boolean visible |
223 ){ | 223 ){ |
224 logger.debug("ReferenceCurveGenerator.doPointOut"); | 224 logger.debug("ReferenceCurveGenerator.doPointOut"); |
225 | 225 |
226 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); | 226 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); |
227 | 227 |