added standard_frames convenience;
authorwenzelm
Wed, 02 Jan 2013 21:55:57 +0100
changeset 50691 20beafe66748
parent 50690 03c4d75e8e32
child 50692 97f951edca46
added standard_frames convenience;
src/Pure/ML/ml_statistics.scala
--- a/src/Pure/ML/ml_statistics.scala	Wed Jan 02 21:39:54 2013 +0100
+++ b/src/Pure/ML/ml_statistics.scala	Wed Jan 02 21:55:57 2013 +0100
@@ -8,6 +8,7 @@
 
 
 import scala.collection.immutable.{SortedSet, SortedMap}
+import scala.swing.{Frame, Component}
 
 import org.jfree.data.xy.{XYSeries, XYSeriesCollection}
 import org.jfree.chart.{JFreeChart, ChartPanel, ChartFactory}
@@ -126,5 +127,13 @@
 
   def chart_panel(title: String, selected_fields: Iterable[String]): ChartPanel =
     new ChartPanel(chart(title, selected_fields))
+
+  def standard_frames: Unit =
+    for ((title, selected_fields) <- ML_Statistics.standard_fields) {
+      val c = chart(title, selected_fields)
+      Swing_Thread.later {
+        new Frame { contents = Component.wrap(new ChartPanel(c)); visible = true }
+      }
+    }
 }