summaryrefslogtreecommitdiff
path: root/src/swing/scala/swing/SwingActor.scala
blob: bd400de85941f4216bf590ea7ed1645b25e2d7c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2007-2011, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */



package scala.swing

import scala.actors._

// Dummy to keep ant from recompiling on every run.
trait SwingActor { }

/*object SwingActor {
  /**
   * Similar to Actor.actor, but creates an instance of a SwingActor.
   */
  def apply(body: => Unit): Actor =
    new SwingActor { def act() = body }.start()
}

/**
 * An actor that runs on the Swing event dispatching thread (EDT).
 */
abstract class SwingActor extends Actor {
  override val scheduler = new SchedulerAdapter {
    def execute(op: =>Unit) = Swing onEDT op
    def onTerminate(a: Actor)(op: => Unit) {}
    def terminated(a: Actor) {}
  }
}*/