comparison gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java @ 334:e37930705daa

Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one. gnv-artifacts/trunk@400 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 07 Dec 2009 17:03:24 +0000
parents 1c427acb6c76
children
comparison
equal deleted inserted replaced
333:19571fd1d0e8 334:e37930705daa
11 import java.util.ArrayList; 11 import java.util.ArrayList;
12 import java.util.Collection; 12 import java.util.Collection;
13 import java.util.Iterator; 13 import java.util.Iterator;
14 import java.util.List; 14 import java.util.List;
15 import java.util.Locale; 15 import java.util.Locale;
16 import java.util.Vector;
16 17
17 import javax.xml.transform.Transformer; 18 import javax.xml.transform.Transformer;
18 import javax.xml.transform.TransformerConfigurationException; 19 import javax.xml.transform.TransformerConfigurationException;
19 import javax.xml.transform.TransformerException; 20 import javax.xml.transform.TransformerException;
20 import javax.xml.transform.TransformerFactory; 21 import javax.xml.transform.TransformerFactory;
220 log.debug( 221 log.debug(
221 "Best locale - regarding intersection of server and " + 222 "Best locale - regarding intersection of server and " +
222 "browser locales - is " + locale.toString() 223 "browser locales - is " + locale.toString()
223 ); 224 );
224 225
225 Collection parameters = this.getParameters(uuid); 226 Collection parameters = this.getCleanedParameters(uuid);
226 Collection measurements = this.getMeasurements(uuid); 227 Collection measurements = this.getMeasurements(uuid);
227 Collection dates = this.getDates(uuid); 228 Collection dates = this.getDates(uuid);
228 229
229 ChartLabels chartLables = new ChartLabels( 230 ChartLabels chartLables = new ChartLabels(
230 createChartTitle(locale, uuid), 231 createChartTitle(locale, uuid),
270 "browser locales - is " + locale.toString() 271 "browser locales - is " + locale.toString()
271 ); 272 );
272 273
273 createPDF( 274 createPDF(
274 outputStream, 275 outputStream,
275 getParameters(uuid), 276 getCleanedParameters(uuid),
276 getMeasurements(uuid), 277 getMeasurements(uuid),
277 getDates(uuid), 278 getDates(uuid),
278 new ChartLabels( 279 new ChartLabels(
279 createChartTitle(locale, uuid), 280 createChartTitle(locale, uuid),
280 createChartSubtitle(locale, uuid), 281 createChartSubtitle(locale, uuid),
306 "browser locales - is " + locale.toString() 307 "browser locales - is " + locale.toString()
307 ); 308 );
308 309
309 createSVG( 310 createSVG(
310 outputStream, 311 outputStream,
311 getParameters(uuid), 312 getCleanedParameters(uuid),
312 getMeasurements(uuid), 313 getMeasurements(uuid),
313 getDates(uuid), 314 getDates(uuid),
314 new ChartLabels( 315 new ChartLabels(
315 createChartTitle(locale, uuid), 316 createChartTitle(locale, uuid),
316 createChartSubtitle(locale, uuid), 317 createChartSubtitle(locale, uuid),
372 // no format found relating to mimeType, default export as PNG 373 // no format found relating to mimeType, default export as PNG
373 return IMG_EXPORT_FORMAT[0]; 374 return IMG_EXPORT_FORMAT[0];
374 } 375 }
375 376
376 377
378 protected Collection getCleanedParameters(Collection parameters) {
379 Iterator iter = parameters.iterator();
380 Collection parameter = new Vector(parameters);
381 while (iter.hasNext()) {
382 KeyValueDescibeData data = (KeyValueDescibeData)iter.next();
383 if (!data.isSelected())
384 parameter.remove(data);
385 }
386
387 return parameter;
388 }
389
390
391 protected Collection getCleanedParameters(String uuid) {
392 return getCleanedParameters(getParameters(uuid));
393 }
394
395
377 /** 396 /**
378 * @param outputStream 397 * @param outputStream
379 * @param chartResult 398 * @param chartResult
380 * @throws UnsupportedEncodingException 399 * @throws UnsupportedEncodingException
381 * @throws IOException 400 * @throws IOException

http://dive4elements.wald.intevation.org