Trait

cogdebugger.ui.fieldvisualizations

EventDrivenViewer

Related Doc: package fieldvisualizations

Permalink

trait EventDrivenViewer extends Component with Viewer with ProbeListener

A field viewer that can be subscribed to an event source so as to reacively update its visualizaion in response to new data becoming available.

While you can call the viewer's update method directly, in the typical usage scenario an EventDrivenViewer will be subscribed to a cogdebugger.Probe that has been registered with the debugger's cogdebugger.ProbeManager. The probe manager will read out the data from any probed fields at regular intervals, raise NewProbeData events, and the viewers will then update themselves. Note however, that the viewer is NOT guaranteed to respond to all NewProbeData events, see more below.

The task of visualizing a field can be an expensive operation. Updating and rendering all viewers on a single thread makes for an unresponsive debugger. For this reaon, each EventDrivenViewer contains a Scala Actor that performs the update operation in response to probe date events (calling update directly on this class does NOT use the actor). Because there is no way of knowing in advance how long an update will take or the rate at which NewProbeData events will be raised, the actor only ever operates on the most recently received probe data, discarding any older messages that may have enqueued in its mailbox. While the actor is busy in the update method, the volatile busy variable will be set to true; a Probe implemenation may take advantage of this to perform additional flow control.

---

The intent was to allow for a single viewer to listen to multiple probes, so that it could compose their data in some way. The original motivation for this was Ben+Matthew's Virage tracker, in which they overlayed a moving target on a color image. The target's size, position and color was determined by one field, and the background by another. I don't know exactly what sort of hackery the resorted to go get that to work, but I know it took more effort than it ought to have.

I'd really like this to be an abstract class taking the visualization targets as arguments, but then subclasses can't extend the different Panel classes.

Linear Supertypes
ProbeListener, Viewer, Component, UIElement, LazyPublisher, Publisher, Reactor, Proxy, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. EventDrivenViewer
  2. ProbeListener
  3. Viewer
  4. Component
  5. UIElement
  6. LazyPublisher
  7. Publisher
  8. Reactor
  9. Proxy
  10. AnyRef
  11. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. trait SuperMixin extends JComponent

    Permalink
    Attributes
    protected
    Definition Classes
    Component
  2. class Worker extends SwingWorker[Unit, Unit]

    Permalink

Abstract Value Members

  1. abstract def update(src: AnyRef, data: libcog.AbstractFieldMemory, simTime: Long): Unit

    Permalink

    Updates the visualization based on the contents of data.

    Updates the visualization based on the contents of data.

    The src argument was orignally meant to reference the kernel/field/object that generated the data, in order to support composite visualizations (that is, viewers that produce a visual based on the data from several different sources), but launching such viewers in the current UI is clunky at beset, so this feature isn't used. Viewers that only visualize a single field's data can probably safely ignore this arument (and indeed, most of the current ones do).

    src

    The field or object that generated the data argument

    data

    New field data that needs to be rendered by this viewer

    simTime

    The ComputeGraph's step count at the time the data argument was generated

    Definition Classes
    Viewer

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def background: Color

    Permalink
    Definition Classes
    UIElement
  6. def background_=(c: Color): Unit

    Permalink
    Definition Classes
    UIElement
  7. def border: Border

    Permalink
    Definition Classes
    Component
  8. def border_=(b: Border): Unit

    Permalink
    Definition Classes
    Component
  9. def bounds: Rectangle

    Permalink
    Definition Classes
    UIElement
  10. var busy: Boolean

    Permalink
    Attributes
    protected
  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def cursor: Cursor

    Permalink
    Definition Classes
    UIElement
  13. def cursor_=(c: Cursor): Unit

    Permalink
    Definition Classes
    UIElement
  14. def deafTo(ps: Publisher*): Unit

    Permalink
    Definition Classes
    Reactor
  15. def displayable: Boolean

    Permalink
    Definition Classes
    UIElement
  16. def enabled: Boolean

    Permalink
    Definition Classes
    Component
  17. def enabled_=(b: Boolean): Unit

    Permalink
    Definition Classes
    Component
  18. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. def equals(that: Any): Boolean

    Permalink
    Definition Classes
    Proxy → Any
  20. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. def focusable: Boolean

    Permalink
    Definition Classes
    Component
  22. def focusable_=(b: Boolean): Unit

    Permalink
    Definition Classes
    Component
  23. def font: Font

    Permalink
    Definition Classes
    UIElement
  24. def font_=(f: Font): Unit

    Permalink
    Definition Classes
    UIElement
  25. def foreground: Color

    Permalink
    Definition Classes
    UIElement
  26. def foreground_=(c: Color): Unit

    Permalink
    Definition Classes
    UIElement
  27. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  28. def hasFocus: Boolean

    Permalink
    Definition Classes
    Component
  29. def hashCode(): Int

    Permalink
    Definition Classes
    Proxy → Any
  30. def ignoreRepaint: Boolean

    Permalink
    Definition Classes
    UIElement
  31. def ignoreRepaint_=(b: Boolean): Unit

    Permalink
    Definition Classes
    UIElement
  32. var initP: JComponent

    Permalink
    Definition Classes
    Component
  33. def inputVerifier: (Component) ⇒ Boolean

    Permalink
    Definition Classes
    Component
  34. def inputVerifier_=(v: (Component) ⇒ Boolean): Unit

    Permalink
    Definition Classes
    Component
  35. def isBusy: Boolean

    Permalink
    Definition Classes
    EventDrivenViewerProbeListener
  36. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  37. def listenTo(ps: Publisher*): Unit

    Permalink
    Definition Classes
    Reactor
  38. val listeners: RefSet[Reaction] { val underlying: scala.collection.mutable.HashSet[scala.ref.Reference[scala.swing.Reactions.Reaction]] }

    Permalink
    Attributes
    protected
    Definition Classes
    Publisher
  39. def locale: Locale

    Permalink
    Definition Classes
    UIElement
  40. def location: Point

    Permalink
    Definition Classes
    UIElement
  41. def locationOnScreen: Point

    Permalink
    Definition Classes
    UIElement
  42. def maximumSize: Dimension

    Permalink
    Definition Classes
    UIElement
  43. def maximumSize_=(x: Dimension): Unit

    Permalink
    Definition Classes
    UIElement
  44. def minimumSize: Dimension

    Permalink
    Definition Classes
    UIElement
  45. def minimumSize_=(x: Dimension): Unit

    Permalink
    Definition Classes
    UIElement
  46. object mouse

    Permalink
    Definition Classes
    Component
  47. def name: String

    Permalink
    Definition Classes
    Component
  48. def name_=(s: String): Unit

    Permalink
    Definition Classes
    Component
  49. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  50. def notify(event: ProbeEvent): Unit

    Permalink
    Definition Classes
    EventDrivenViewerProbeListener
  51. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  52. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  53. def onFirstSubscribe(): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Component → UIElement → LazyPublisher
  54. def onLastUnsubscribe(): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    UIElement → LazyPublisher
  55. def opaque: Boolean

    Permalink
    Definition Classes
    Component
  56. def opaque_=(b: Boolean): Unit

    Permalink
    Definition Classes
    Component
  57. def paint(g: Graphics2D): Unit

    Permalink
    Definition Classes
    Component
  58. def paintBorder(g: Graphics2D): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Component
  59. def paintChildren(g: Graphics2D): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Component
  60. def paintComponent(g: Graphics2D): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Component
  61. lazy val peer: JComponent

    Permalink
    Definition Classes
    Component → UIElement
  62. def preferredSize: Dimension

    Permalink
    Definition Classes
    UIElement
  63. def preferredSize_=(x: Dimension): Unit

    Permalink
    Definition Classes
    UIElement
  64. val properties: ArrayBuffer[Property[_]]

    Permalink

    A list of properties that should be persisted when the app closes, and restored the next time it's launched.

    A list of properties that should be persisted when the app closes, and restored the next time it's launched. A common example of a persistent is the zoom/magnification level of the viewer. Be sure to add any relevenant properties to this list in your Viewer subclasses!

    Definition Classes
    Viewer
  65. def propertiesTag: NodeSeq

    Permalink

    Returns the XML representation of this viewer's properties, suitable for saving into a file.

    Returns the XML representation of this viewer's properties, suitable for saving into a file.

    Definition Classes
    Viewer
  66. def publish(e: Event): Unit

    Permalink
    Definition Classes
    Publisher
  67. val reactions: Reactions

    Permalink
    Definition Classes
    Reactor
  68. def repaint(rect: Rectangle): Unit

    Permalink
    Definition Classes
    UIElement
  69. def repaint(): Unit

    Permalink
    Definition Classes
    UIElement
  70. def requestFocus(): Unit

    Permalink
    Definition Classes
    Component
  71. def requestFocusInWindow(): Boolean

    Permalink
    Definition Classes
    Component
  72. def reset(): Unit

    Permalink

    Reset the visualization.

    Reset the visualization. An optional operation; subclasses must override this method or else it does nothing.

    Definition Classes
    Viewer
  73. def revalidate(): Unit

    Permalink
    Definition Classes
    Component
  74. def self: Component

    Permalink
    Definition Classes
    UIElement → Proxy
  75. def showing: Boolean

    Permalink
    Definition Classes
    UIElement
  76. def size: Dimension

    Permalink
    Definition Classes
    UIElement
  77. def subscribe(listener: Reaction): Unit

    Permalink
    Definition Classes
    LazyPublisher → Publisher
  78. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  79. def toString(): String

    Permalink
    Definition Classes
    Component → Proxy → AnyRef → Any
  80. def toolkit: Toolkit

    Permalink
    Definition Classes
    UIElement
  81. def tooltip: String

    Permalink
    Definition Classes
    Component
  82. def tooltip_=(t: String): Unit

    Permalink
    Definition Classes
    Component
  83. def unsubscribe(listener: Reaction): Unit

    Permalink
    Definition Classes
    LazyPublisher → Publisher
  84. def visible: Boolean

    Permalink
    Definition Classes
    UIElement
  85. def visible_=(b: Boolean): Unit

    Permalink
    Definition Classes
    UIElement
  86. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  87. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  88. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  89. def xLayoutAlignment: Double

    Permalink
    Definition Classes
    Component
  90. def xLayoutAlignment_=(x: Double): Unit

    Permalink
    Definition Classes
    Component
  91. def xmlToProperties(node: Node): Unit

    Permalink

    Parses the XML tag produced by the propertiesTag method and restores any saved valued to this Viewer.

    Parses the XML tag produced by the propertiesTag method and restores any saved valued to this Viewer.

    Definition Classes
    Viewer
  92. def yLayoutAlignment: Double

    Permalink
    Definition Classes
    Component
  93. def yLayoutAlignment_=(y: Double): Unit

    Permalink
    Definition Classes
    Component

Inherited from ProbeListener

Inherited from Viewer

Inherited from Component

Inherited from UIElement

Inherited from LazyPublisher

Inherited from Publisher

Inherited from Reactor

Inherited from Proxy

Inherited from AnyRef

Inherited from Any

Ungrouped