[Schmitzm-commits] r255 - trunk/src/schmitzm/jfree

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Jul 31 15:39:19 CEST 2009


Author: alfonx
Date: 2009-07-31 15:39:18 +0200 (Fri, 31 Jul 2009)
New Revision: 255

Modified:
   trunk/src/schmitzm/jfree/JFreeChartUtil.java
Log:

	/** Collect renderers from CategoryPlot */
	if (plot instanceof CategoryPlot) {
		CategoryPlot catPlot = (CategoryPlot)plot;
		

Modified: trunk/src/schmitzm/jfree/JFreeChartUtil.java
===================================================================
--- trunk/src/schmitzm/jfree/JFreeChartUtil.java	2009-07-31 12:32:56 UTC (rev 254)
+++ trunk/src/schmitzm/jfree/JFreeChartUtil.java	2009-07-31 13:39:18 UTC (rev 255)
@@ -2,7 +2,7 @@
  * Copyright (c) 2009 Martin O. J. Schmitz.
  * 
  * This file is part of the SCHMITZM library - a collection of utility 
- * classes based on Java 1.6, focussing (not only) on Java Swing 
+ * classes based on Java 1.6, focusing (not only) on Java Swing 
  * and the Geotools library.
  * 
  * The SCHMITZM project is hosted at:
@@ -47,6 +47,7 @@
 import org.jfree.chart.event.RendererChangeListener;
 import org.jfree.chart.labels.StandardXYToolTipGenerator;
 import org.jfree.chart.labels.XYToolTipGenerator;
+import org.jfree.chart.plot.CategoryPlot;
 import org.jfree.chart.plot.Plot;
 import org.jfree.chart.plot.PlotOrientation;
 import org.jfree.chart.plot.XYPlot;
@@ -398,6 +399,7 @@
 	
 	Plot plot = chart.getPlot();
 	
+	/** Collect renderers from XYPlot */	
 	if (plot instanceof XYPlot) {
 		XYPlot xyplot = (XYPlot)plot;
 
@@ -410,7 +412,18 @@
 		}
 	}
 	
-	// TODO Other types of Charts have the renderers hidden somewhere else.
+	/** Collect renderers from CategoryPlot */
+	if (plot instanceof CategoryPlot) {
+		CategoryPlot catPlot = (CategoryPlot)plot;
+		
+		for (int i = 0; i < catPlot.getRendererCount(); i++) {
+			CategoryItemRenderer renderer = catPlot.getRenderer(i);
+			if (renderer instanceof DatasetSelectionModelProvider &&
+					((DatasetSelectionModelProvider)renderer).getSelectionModel() instanceof FeatureDatasetSelectionModel){
+				renderers.add( (FeatureDatasetSelectionModel)((DatasetSelectionModelProvider)renderer).getSelectionModel());
+			}
+		}
+	}
 	
 	return renderers;
   }



More information about the Schmitzm-commits mailing list