Packages

final case class Reactor[A](initial: A, onMouseClickHandler: (Point, A) => A = (_: Point, a: A) => a, onMouseMoveHandler: (Point, A) => A = (_: Point, a: A) => a, onTickHandler: (A) => A = (a: A) => a, tickRate: FiniteDuration = FiniteDuration(100, MILLISECONDS), renderHandler: (A) => Image = (_: A) => Image.empty, stopHandler: (A) => Boolean = (_: A) => false) extends BaseReactor[A] with Product with Serializable

A Reactor that has reasonable defaults and a simple builder style for creating more complicated behaviour.

Source
Reactor.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Reactor
  2. Serializable
  3. Product
  4. Equals
  5. BaseReactor
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Reactor(initial: A, onMouseClickHandler: (Point, A) => A = (_: Point, a: A) => a, onMouseMoveHandler: (Point, A) => A = (_: Point, a: A) => a, onTickHandler: (A) => A = (a: A) => a, tickRate: FiniteDuration = FiniteDuration(100, MILLISECONDS), renderHandler: (A) => Image = (_: A) => Image.empty, stopHandler: (A) => Boolean = (_: A) => false)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. def draw[Alg <: Basic, Frame, Canvas]()(implicit renderer: DefaultRenderer[Alg, Frame, Canvas], runtime: IORuntime): Unit
  7. def draw[Alg <: Basic, Frame, Canvas](frame: Frame)(implicit renderer: Renderer[Alg, Frame, Canvas], runtime: IORuntime): Unit
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def image: Image
  12. val initial: A
    Definition Classes
    ReactorBaseReactor
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. def onMouseClick(location: Point, state: A): A
    Definition Classes
    ReactorBaseReactor
  18. val onMouseClickHandler: (Point, A) => A
  19. def onMouseMove(location: Point, state: A): A
    Definition Classes
    ReactorBaseReactor
  20. val onMouseMoveHandler: (Point, A) => A
  21. def onTick(state: A): A
    Definition Classes
    ReactorBaseReactor
  22. val onTickHandler: (A) => A
  23. def productElementNames: Iterator[String]
    Definition Classes
    Product
  24. def render(value: A): Image
    Definition Classes
    ReactorBaseReactor
  25. val renderHandler: (A) => Image
  26. def run[Alg <: Basic, Frame, Canvas](frame: Frame)(implicit a: AnimationRenderer[Canvas], e: Renderer[Alg, Frame, Canvas], m: MouseClick[Canvas] with MouseMove[Canvas], runtime: IORuntime): Unit

    Runs this reactor, drawing on the given frame, until stop indicates it should stop.

    Runs this reactor, drawing on the given frame, until stop indicates it should stop.

    Definition Classes
    BaseReactor
  27. def step: Reactor[A]
  28. def stop(value: A): Boolean
    Definition Classes
    ReactorBaseReactor
  29. val stopHandler: (A) => Boolean
  30. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  31. def tick[Frame, Canvas](frame: Frame)(implicit e: Renderer[Basic, Frame, Canvas], runtime: IORuntime): Option[A]

    Run one tick of this reactor, drawing on the given frame.

    Run one tick of this reactor, drawing on the given frame. Returns the next state, or None if the Reactor has stopped.

    Definition Classes
    BaseReactor
  32. val tickRate: FiniteDuration
    Definition Classes
    ReactorBaseReactor
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  36. def withOnMouseClick(f: (Point, A) => A): Reactor[A]
  37. def withOnMouseMove(f: (Point, A) => A): Reactor[A]
  38. def withOnTick(f: (A) => A): Reactor[A]
  39. def withRender(f: (A) => Image): Reactor[A]
  40. def withStop(f: (A) => Boolean): Reactor[A]
  41. def withTickRate(duration: FiniteDuration): Reactor[A]

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from BaseReactor[A]

Inherited from AnyRef

Inherited from Any

Ungrouped