diff gnv-artifacts/src/main/java/de/intevation/gnv/chart/ChartFactory.java @ 86:5d4f5d26bb7a

Some Codecleanup done gnv-artifacts/trunk@123 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Thu, 24 Sep 2009 09:39:27 +0000
parents 5eb62df21f9a
children f07637f96312
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/ChartFactory.java	Wed Sep 23 14:32:55 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/ChartFactory.java	Thu Sep 24 09:39:27 2009 +0000
@@ -66,7 +66,7 @@
 	private static boolean sDebug = sLogger.isDebugEnabled();
 
 
-	public synchronized void createSimpleTimeSeriesChart(ChartLabels pLabels, ChartStyle pStyle, String pTimeSeriesName, Collection<KeyValueDescibeData> parameters, Collection<KeyValueDescibeData> measurements, OutputStream outputStream, Collection<Result> resultSet) throws IOException, TechnicalChartException {
+	public synchronized void createSimpleTimeSeriesChart(ChartLabels pLabels, ChartStyle pStyle, Collection<KeyValueDescibeData> parameters, Collection<KeyValueDescibeData> measurements, OutputStream outputStream, Collection<Result> resultSet) throws IOException, TechnicalChartException {
 		if (sDebug)
 			sLogger.debug("createSimpleTimeSeriesChart()");
 		int lLowerLevel = Integer.MIN_VALUE;
@@ -81,12 +81,12 @@
 		}
 		if (sDebug)
 			sLogger.debug("  vor createDataset()");
-		XYDataset lSet = createDataset(pTimeSeriesName, resultSet, lUpperLevel,
+		XYDataset lSet = this.createDataset(resultSet, lUpperLevel,
 				lLowerLevel,parameters,measurements);
 		if (sDebug)
 			sLogger.debug("  nach createDataset()");
 		final Color[] color = {Color.black, Color.red, Color.green, Color.blue};
-		DateAxis domain = new DateAxis("Zeit [UTC]");
+		DateAxis domain = new DateAxis(pLabels.getDomainAxisLabel());
         NumberAxis axis;
         StandardXYItemRenderer renderer = new StandardXYItemRenderer();
 		XYPlot plot = new XYPlot();
@@ -292,7 +292,7 @@
 		return lTimeseries;
 	}
 
-	private XYDataset createDataset(String pTimeseriesName, Collection<Result> resultSet,
+	private XYDataset createDataset(Collection<Result> resultSet,
 			int lUpperCut, int lLowerCut,Collection<KeyValueDescibeData> parameters, Collection<KeyValueDescibeData> measurements) throws TechnicalChartException {
 		
 		TimeSeriesCollection lTimeSeriesCollection = new TimeSeriesCollection();
@@ -305,7 +305,6 @@
 	
 			Iterator<Result> resultIterator = resultSet.iterator();
 			if (resultIterator.hasNext()){
-    //			Row row = new Row(sArrayStrLine);
     			Result row = resultIterator.next();
     			
     			break1 = row.getString("GROUP1"); // 2
@@ -331,7 +330,6 @@
     	
     				}
     				mEnd = i;
-    				//mEnd ++;
     				dEnd = row.getDate("XORDINATE");
     				i = i + 1;
     			}
@@ -381,7 +379,7 @@
         Iterator<KeyValueDescibeData> it = values.iterator();
     	while(it.hasNext()){
     	    KeyValueDescibeData data = it.next();
-    		if (id  ==Integer.parseInt(data.getKey())){ // TODO just a hack
+    		if (id  ==Integer.parseInt(data.getKey())){
     		    return data.getValue();
     		}
     	}

http://dive4elements.wald.intevation.org