Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeWQCurveGenerator.java @ 5867:59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Sun, 28 Apr 2013 15:23:01 +0200 |
parents | 73da40528cf2 |
children | af13ceeba52a |
comparison
equal
deleted
inserted
replaced
5866:9a6741ccf6d4 | 5867:59ff03ff48f1 |
---|---|
11 import org.apache.log4j.Logger; | 11 import org.apache.log4j.Logger; |
12 import org.jfree.data.xy.XYSeries; | 12 import org.jfree.data.xy.XYSeries; |
13 import org.w3c.dom.Document; | 13 import org.w3c.dom.Document; |
14 | 14 |
15 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; | 15 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; |
16 import org.dive4elements.river.artifacts.FLYSArtifact; | 16 import org.dive4elements.river.artifacts.D4EArtifact; |
17 import org.dive4elements.river.artifacts.access.HistoricalDischargeAccess; | 17 import org.dive4elements.river.artifacts.access.HistoricalDischargeAccess; |
18 import org.dive4elements.river.artifacts.model.FacetTypes; | 18 import org.dive4elements.river.artifacts.model.FacetTypes; |
19 import org.dive4elements.river.artifacts.model.Timerange; | 19 import org.dive4elements.river.artifacts.model.Timerange; |
20 import org.dive4elements.river.artifacts.model.WQKms; | 20 import org.dive4elements.river.artifacts.model.WQKms; |
21 | 21 |
77 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE); | 77 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE); |
78 } | 78 } |
79 | 79 |
80 @Override | 80 @Override |
81 protected String getDefaultChartSubtitle() { | 81 protected String getDefaultChartSubtitle() { |
82 FLYSArtifact flys = (FLYSArtifact) master; | 82 D4EArtifact flys = (D4EArtifact) master; |
83 Timerange evalTime = new HistoricalDischargeAccess(flys) | 83 Timerange evalTime = new HistoricalDischargeAccess(flys) |
84 .getEvaluationTimerange(); | 84 .getEvaluationTimerange(); |
85 | 85 |
86 Object[] args = new Object[] { RiverUtils.getReferenceGaugeName(flys), | 86 Object[] args = new Object[] { RiverUtils.getReferenceGaugeName(flys), |
87 evalTime.getStart(), evalTime.getEnd() }; | 87 evalTime.getStart(), evalTime.getEnd() }; |
112 logger.debug("Theme description is: " | 112 logger.debug("Theme description is: " |
113 + artifactFacet.getFacetDescription()); | 113 + artifactFacet.getFacetDescription()); |
114 | 114 |
115 if (name.equals(HISTORICAL_DISCHARGE_WQ_Q)) { | 115 if (name.equals(HISTORICAL_DISCHARGE_WQ_Q)) { |
116 doHistoricalDischargeOutQ( | 116 doHistoricalDischargeOutQ( |
117 (FLYSArtifact) artifactFacet.getArtifact(), | 117 (D4EArtifact) artifactFacet.getArtifact(), |
118 artifactFacet.getData(context), | 118 artifactFacet.getData(context), |
119 artifactFacet.getFacetDescription(), theme, visible); | 119 artifactFacet.getFacetDescription(), theme, visible); |
120 } | 120 } |
121 else if (name.equals(HISTORICAL_DISCHARGE_WQ_W)) { | 121 else if (name.equals(HISTORICAL_DISCHARGE_WQ_W)) { |
122 doHistoricalDischargeOutW( | 122 doHistoricalDischargeOutW( |
123 (FLYSArtifact) artifactFacet.getArtifact(), | 123 (D4EArtifact) artifactFacet.getArtifact(), |
124 artifactFacet.getData(context), | 124 artifactFacet.getData(context), |
125 artifactFacet.getFacetDescription(), theme, visible); | 125 artifactFacet.getFacetDescription(), theme, visible); |
126 } | 126 } |
127 else if (name.equals(HISTORICAL_DISCHARGE_WQ_CURVE)) { | 127 else if (name.equals(HISTORICAL_DISCHARGE_WQ_CURVE)) { |
128 doHistoricalDischargeCurveOut( | 128 doHistoricalDischargeCurveOut( |
129 (FLYSArtifact) artifactFacet.getArtifact(), | 129 (D4EArtifact) artifactFacet.getArtifact(), |
130 artifactFacet.getData(context), | 130 artifactFacet.getData(context), |
131 artifactFacet.getFacetDescription(), theme, visible); | 131 artifactFacet.getFacetDescription(), theme, visible); |
132 } | 132 } |
133 else if (FacetTypes.IS.MANUALPOINTS(name)) { | 133 else if (FacetTypes.IS.MANUALPOINTS(name)) { |
134 doPoints(artifactFacet.getData(context), artifactFacet, theme, | 134 doPoints(artifactFacet.getData(context), artifactFacet, theme, |
146 logger.warn("doOut(): unknown facet name: " + name); | 146 logger.warn("doOut(): unknown facet name: " + name); |
147 return; | 147 return; |
148 } | 148 } |
149 } | 149 } |
150 | 150 |
151 protected void doHistoricalDischargeOutQ(FLYSArtifact artifact, | 151 protected void doHistoricalDischargeOutQ(D4EArtifact artifact, |
152 Object data, String desc, Document theme, boolean visible) { | 152 Object data, String desc, Document theme, boolean visible) { |
153 double value = Double.valueOf(data.toString()); | 153 double value = Double.valueOf(data.toString()); |
154 addDomainMarker(new StyledValueMarker(value, theme), visible); | 154 addDomainMarker(new StyledValueMarker(value, theme), visible); |
155 } | 155 } |
156 | 156 |
157 protected void doHistoricalDischargeOutW(FLYSArtifact artifact, | 157 protected void doHistoricalDischargeOutW(D4EArtifact artifact, |
158 Object data, String desc, Document theme, boolean visible) { | 158 Object data, String desc, Document theme, boolean visible) { |
159 double value = Double.valueOf(data.toString()); | 159 double value = Double.valueOf(data.toString()); |
160 addValueMarker(new StyledValueMarker(value, theme), visible); | 160 addValueMarker(new StyledValueMarker(value, theme), visible); |
161 } | 161 } |
162 | 162 |
163 protected void doHistoricalDischargeCurveOut(FLYSArtifact artifact, | 163 protected void doHistoricalDischargeCurveOut(D4EArtifact artifact, |
164 Object data, String desc, Document theme, boolean visible) { | 164 Object data, String desc, Document theme, boolean visible) { |
165 XYSeries series = new StyledXYSeries(desc, theme); | 165 XYSeries series = new StyledXYSeries(desc, theme); |
166 StyledSeriesBuilder.addPointsQW(series, (WQKms) data); | 166 StyledSeriesBuilder.addPointsQW(series, (WQKms) data); |
167 | 167 |
168 addAxisSeries(series, YAXIS.W.idx, visible); | 168 addAxisSeries(series, YAXIS.W.idx, visible); |