src/Tools/jEdit/src/monitor_dockable.scala
changeset 56715 52125652e82a
parent 55618 995162143ef4
child 56770 e160ae47db94
     1.1 --- a/src/Tools/jEdit/src/monitor_dockable.scala	Fri Apr 25 12:27:18 2014 +0200
     1.2 +++ b/src/Tools/jEdit/src/monitor_dockable.scala	Fri Apr 25 12:51:08 2014 +0200
     1.3 @@ -9,7 +9,6 @@
     1.4  
     1.5  import isabelle._
     1.6  
     1.7 -import scala.actors.Actor._
     1.8  import scala.swing.{TextArea, ScrollPane, Component}
     1.9  
    1.10  import org.jfree.chart.ChartPanel
    1.11 @@ -35,23 +34,18 @@
    1.12    set_content(new ChartPanel(chart))
    1.13  
    1.14  
    1.15 -  /* main actor */
    1.16 +  /* main */
    1.17  
    1.18 -  private val main_actor = actor {
    1.19 -    loop {
    1.20 -      react {
    1.21 -        case Session.Statistics(props) =>
    1.22 -          Swing_Thread.later {
    1.23 -            rev_stats ::= props
    1.24 -            delay_update.invoke()
    1.25 -          }
    1.26 +  private val main =
    1.27 +    Session.Consumer[Session.Statistics](getClass.getName) {
    1.28 +      case stats =>
    1.29 +        Swing_Thread.later {
    1.30 +          rev_stats ::= stats.props
    1.31 +          delay_update.invoke()
    1.32 +        }
    1.33 +    }
    1.34  
    1.35 -        case bad => System.err.println("Monitor_Dockable: ignoring bad message " + bad)
    1.36 -      }
    1.37 -    }
    1.38 -  }
    1.39 -
    1.40 -  override def init() { PIDE.session.statistics += main_actor }
    1.41 -  override def exit() { PIDE.session.statistics -= main_actor }
    1.42 +  override def init() { PIDE.session.statistics += main }
    1.43 +  override def exit() { PIDE.session.statistics -= main }
    1.44  }
    1.45