comparison artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java @ 6687:641f93a5fa9e

Do not translate river annotations twice. (issue1370) This fixes mainvaluesW at gauge becuase they are already translated when fetched from the artifact. I hope this is not necessary for other annotations. I could not see any.
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 29 Jul 2013 10:14:32 +0200
parents 6791411ed1fc
children 08e3c22500f3
comparison
equal deleted inserted replaced
6686:661b45d13b17 6687:641f93a5fa9e
172 // Show the W[*m] axis even if there is no data. 172 // Show the W[*m] axis even if there is no data.
173 plot.setRangeAxis(1, createYAxis(YAXIS.W.idx)); 173 plot.setRangeAxis(1, createYAxis(YAXIS.W.idx));
174 } 174 }
175 } 175 }
176 176
177 /** Translate River annotations if not at gauge. */
178 public void translateRiverAnnotation(RiverAnnotation riverAnnotation) {
179 if (getCurrentGaugeDatum() == 0d) {
180 return;
181 }
182 logger.debug("Translate some river annotation.");
183 double translate = getCurrentGaugeDatum();
184 double factor = 100d;
185 for (StickyAxisAnnotation annotation: riverAnnotation.getAxisTextAnnotations()){
186 if (!annotation.atX()) {
187 annotation.setPos((annotation.getPos() - translate)*factor);
188 }
189 }
190 for (XYTextAnnotation annotation: riverAnnotation.getTextAnnotations()) {
191 annotation.setY((annotation.getY() - translate)*factor);
192 }
193 }
194
195 @Override 177 @Override
196 public void doOut(ArtifactAndFacet aaf, Document doc, boolean visible) { 178 public void doOut(ArtifactAndFacet aaf, Document doc, boolean visible) {
197 logger.debug("doOut: " + aaf.getFacetName()); 179 logger.debug("doOut: " + aaf.getFacetName());
198 if (!prepareChartData(aaf, doc, visible)) { 180 if (!prepareChartData(aaf, doc, visible)) {
199 logger.warn("Unknown facet, name " + aaf.getFacetName()); 181 logger.warn("Unknown facet, name " + aaf.getFacetName());
254 doc, 236 doc,
255 visible); 237 visible);
256 } 238 }
257 else if (name.equals(MAINVALUES_W) || name.equals(MAINVALUES_Q)) { 239 else if (name.equals(MAINVALUES_W) || name.equals(MAINVALUES_Q)) {
258 RiverAnnotation mainValues = (RiverAnnotation) aaf.getData(context); 240 RiverAnnotation mainValues = (RiverAnnotation) aaf.getData(context);
259 translateRiverAnnotation(mainValues);
260 doAnnotations( 241 doAnnotations(
261 mainValues, 242 mainValues,
262 aaf, 243 aaf,
263 doc, 244 doc,
264 visible); 245 visible);

http://dive4elements.wald.intevation.org