comparison artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java @ 6527:e1e04db79e3c

issue1370: Translate main values if needed.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 02 Jul 2013 08:21:10 +0200
parents f3e5c6d6b0a2
children 2afe2fe12576
comparison
equal deleted inserted replaced
6526:abb7a2d4c632 6527:e1e04db79e3c
160 (D4EArtifact) getMaster(), 0.1d); 160 (D4EArtifact) getMaster(), 0.1d);
161 } 161 }
162 else return 0d; 162 else return 0d;
163 } 163 }
164 164
165 /** Translate River annotations if not at gauge. */
166 public void translateRiverAnnotation(RiverAnnotation riverAnnotation) {
167 if (getCurrentGaugeDatum() == 0d) {
168 return;
169 }
170 logger.debug("Translate some river annotation.");
171 double translate = getCurrentGaugeDatum();
172 double factor = 100d;
173 for (StickyAxisAnnotation annotation: riverAnnotation.getAxisTextAnnotations()){
174 if (!annotation.atX()) {
175 annotation.setPos((annotation.getPos() - translate)*factor);
176 }
177 }
178 for (XYTextAnnotation annotation: riverAnnotation.getTextAnnotations()) {
179 annotation.setY((annotation.getY() - translate)*factor);
180 }
181 }
165 182
166 @Override 183 @Override
167 public void doOut(ArtifactAndFacet aaf, Document doc, boolean visible) { 184 public void doOut(ArtifactAndFacet aaf, Document doc, boolean visible) {
168 logger.debug("doOut: " + aaf.getFacetName()); 185 logger.debug("doOut: " + aaf.getFacetName());
169 if (!prepareChartData(aaf, doc, visible)) { 186 if (!prepareChartData(aaf, doc, visible)) {
224 aaf.getFacetDescription(), 241 aaf.getFacetDescription(),
225 doc, 242 doc,
226 visible); 243 visible);
227 } 244 }
228 else if (name.equals(MAINVALUES_W) || name.equals(MAINVALUES_Q)) { 245 else if (name.equals(MAINVALUES_W) || name.equals(MAINVALUES_Q)) {
246 RiverAnnotation mainValues = (RiverAnnotation) aaf.getData(context);
247 translateRiverAnnotation(mainValues);
229 doAnnotations( 248 doAnnotations(
230 ((RiverAnnotation) aaf.getData(context)), 249 mainValues,
231 aaf, 250 aaf,
232 doc, 251 doc,
233 visible); 252 visible);
234 } 253 }
235 else if (FacetTypes.IS.MANUALPOINTS(aaf.getFacetName())) { 254 else if (FacetTypes.IS.MANUALPOINTS(aaf.getFacetName())) {

http://dive4elements.wald.intevation.org