[Schmitzm-commits] r132 - trunk/src/schmitzm/jfree
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Sat May 30 22:02:25 CEST 2009
Author: alfonx
Date: 2009-05-30 22:02:25 +0200 (Sat, 30 May 2009)
New Revision: 132
Modified:
trunk/src/schmitzm/jfree/JFreeChartUtil.java
Log:
Basically possible to open a Scatterplot from the tool menu.
Modified: trunk/src/schmitzm/jfree/JFreeChartUtil.java
===================================================================
--- trunk/src/schmitzm/jfree/JFreeChartUtil.java 2009-05-30 19:58:13 UTC (rev 131)
+++ trunk/src/schmitzm/jfree/JFreeChartUtil.java 2009-05-30 20:02:25 UTC (rev 132)
@@ -11,6 +11,8 @@
package schmitzm.jfree;
import java.awt.Color;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Locale;
import org.apache.log4j.Logger;
@@ -37,6 +39,8 @@
import org.jfree.data.xy.XYSeriesCollection;
import schmitzm.jfree.chart.renderer.SelectionXYLineAndShapeRenderer;
+import schmitzm.jfree.chart.selection.DatasetSelectionModel;
+import schmitzm.jfree.chart.selection.DatasetSelectionModelProvider;
import schmitzm.lang.LangUtil;
import schmitzm.lang.ResourceProvider;
@@ -168,6 +172,23 @@
renderer.setSeriesPaint(0, Color.blue);
plot.setRenderer(datasetCount, renderer);
}
+
+ /**
+ * Returns all Rednerer
+ * @param chart
+ * @return
+ */
+public static List<DatasetSelectionModel<?>> getDatasetSelectionModelFor(JFreeChart chart) {
+ ArrayList<DatasetSelectionModel<?>> renderers = new ArrayList<DatasetSelectionModel<?>>();
+
+ for (int i = 0; i < chart.getXYPlot().getRendererCount(); i++) {
+ XYItemRenderer renderer = chart.getXYPlot().getRenderer(i);
+ if (renderer instanceof DatasetSelectionModelProvider){
+ renderers.add( ((DatasetSelectionModelProvider)renderer).getSelectionModel());
+ }
+ }
+ return renderers;
+}
More information about the Schmitzm-commits
mailing list