Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java @ 73:504570de21fd
Refactoring Work depending on Infrastructurchanges in the Artifact-Module
gnv-artifacts/trunk@79 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Mon, 14 Sep 2009 10:32:38 +0000 |
parents | d117fd4b82e5 |
children | 9b41f3688610 |
comparison
equal
deleted
inserted
replaced
72:1fece4da4f2f | 73:504570de21fd |
---|---|
5 | 5 |
6 import java.awt.Color; | 6 import java.awt.Color; |
7 import java.awt.Dimension; | 7 import java.awt.Dimension; |
8 import java.io.ByteArrayOutputStream; | 8 import java.io.ByteArrayOutputStream; |
9 import java.io.IOException; | 9 import java.io.IOException; |
10 import java.io.OutputStream; | |
10 import java.util.Collection; | 11 import java.util.Collection; |
11 import java.util.Iterator; | 12 import java.util.Iterator; |
12 | 13 |
13 import org.apache.log4j.Logger; | 14 import org.apache.log4j.Logger; |
14 | 15 |
44 */ | 45 */ |
45 public boolean validate() { | 46 public boolean validate() { |
46 return true; | 47 return true; |
47 } | 48 } |
48 | 49 |
49 /** | 50 /** |
50 * @see de.intevation.gnv.transition.OutputTransition#out(java.lang.String) | 51 * @see de.intevation.gnv.transition.OutputTransition#out(java.lang.String, java.io.OutputStream) |
51 */ | 52 */ |
52 public byte[] out(String outputMode) throws TransitionException { | 53 public void out(String outputMode, OutputStream outputStream) throws TransitionException { |
53 log.debug("TimeSeriesOutputTransition"); | 54 log.debug("TimeSeriesOutputTransition"); |
54 try { | 55 try { |
55 this.advance(); // TODO nur neu holen wenn hash auf chartResult sich geändert hat | 56 this.advance(); // TODO nur neu holen wenn hash auf chartResult sich geändert hat |
56 ByteArrayOutputStream os = new ByteArrayOutputStream(); | |
57 ChartFactory chartFactory = new ChartFactory(); | 57 ChartFactory chartFactory = new ChartFactory(); |
58 | 58 |
59 Collection<KeyValueDescibeData> parameters = this.getParameters(); | 59 Collection<KeyValueDescibeData> parameters = this.getParameters(); |
60 Collection<KeyValueDescibeData> measurements = this.getMeasurements(); | 60 Collection<KeyValueDescibeData> measurements = this.getMeasurements(); |
61 String timeSeriesName = "BLA"; | 61 String timeSeriesName = "BLA"; |
64 lDiagramTitle.append(/*mSelectedFis.getTitle()*/ "FIS-TITLE").append(" - ").append(/*mSelectedFeatureId[0].getTitle()*/"FeatureTitle"); // TODO: FIXME | 64 lDiagramTitle.append(/*mSelectedFis.getTitle()*/ "FIS-TITLE").append(" - ").append(/*mSelectedFeatureId[0].getTitle()*/"FeatureTitle"); // TODO: FIXME |
65 String domainLable = "BLA"; // TODO woher bekommen wir das | 65 String domainLable = "BLA"; // TODO woher bekommen wir das |
66 ChartLabels chartLables = new ChartLabels(lDiagramTitle.toString(),domainLable , /*mSelectedParams[0].getTitle()*/ "Selected Params Title"); | 66 ChartLabels chartLables = new ChartLabels(lDiagramTitle.toString(),domainLable , /*mSelectedParams[0].getTitle()*/ "Selected Params Title"); |
67 chartFactory.createSimpleTimeSeriesChart(chartLables, chartStyle, timeSeriesName, | 67 chartFactory.createSimpleTimeSeriesChart(chartLables, chartStyle, timeSeriesName, |
68 parameters, measurements, | 68 parameters, measurements, |
69 os, this.chartResult); | 69 outputStream, this.chartResult); |
70 return os.toByteArray(); | |
71 } catch (IOException e) { | 70 } catch (IOException e) { |
72 log.error(e,e); | 71 log.error(e,e); |
73 throw new TransitionException(e); | 72 throw new TransitionException(e); |
74 } catch (TechnicalChartException e) { | 73 } catch (TechnicalChartException e) { |
75 log.error(e,e); | 74 log.error(e,e); |