Class

cogdebugger.ui.fieldvisualizations.vector

Geometric2DVectorView

Related Doc: package vector

Permalink

class Geometric2DVectorView extends TileBasedFieldPanel[libcog.VectorFieldReader] with EventDrivenViewer with ToolbarItems

Created with IntelliJ IDEA. User: gonzatob Date: 9/6/12 Time: 3:46 PM

Viewer for fields of two-dimensional geometric vectors. Vectors are displayed as directed lines on a grid, whith the grid having identical dimensions to that of the field.

Cog uses a row, column coordinate system. We can think of rows and columns corresponding to y and x in a Cartesian coordinate system, but bear in mind then that row indices increase in the downward direction, and thus our y coordinate increases in the downward direction as well. Also note the order in which we present row, column coordinates: the vertical or y component comes first. For these reasons, the canonical 2D geometric vector in Cog maps to a (-y, x) ordered pair in a traditional x-increases-to-the- right and y-increased-up Cartesian space.

So, a Cog vector v = Vector(-5, 7) looks like this in Cartesian coordinates:

                    |             v
                    |          .  .
                    |       .     .
                    |    .        .
                    | .           .
- - - - - - - - - - 0 - - - - - - - - - -
                    |
                    |
                    |
                    |
Linear Supertypes
ToolbarItems, EventDrivenViewer, ProbeListener, Viewer, TileBasedFieldPanel[libcog.VectorFieldReader], ZoomProperty, Zoomable, FlowPanel, Wrapper, SequentialContainer, Panel, Wrapper, Container, Component, UIElement, LazyPublisher, Publisher, Reactor, Proxy, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Geometric2DVectorView
  2. ToolbarItems
  3. EventDrivenViewer
  4. ProbeListener
  5. Viewer
  6. TileBasedFieldPanel
  7. ZoomProperty
  8. Zoomable
  9. FlowPanel
  10. Wrapper
  11. SequentialContainer
  12. Panel
  13. Wrapper
  14. Container
  15. Component
  16. UIElement
  17. LazyPublisher
  18. Publisher
  19. Reactor
  20. Proxy
  21. AnyRef
  22. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Geometric2DVectorView(target: AnyRef, fShape: libcog.Shape, tShape: libcog.Shape)

    Permalink

Type Members

  1. class Content extends BufferWrapper[Component]

    Permalink
    Attributes
    protected
    Definition Classes
    Wrapper
  2. trait SuperMixin extends JComponent

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

    Permalink
    Definition Classes
    EventDrivenViewer

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. val ZoomProperty: FloatProperty

    Permalink
    Definition Classes
    ZoomProperty
  5. val _contents: Content

    Permalink
    Attributes
    protected
    Definition Classes
    Wrapper
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def background: Color

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

    Permalink
    Definition Classes
    UIElement
  9. def border: Border

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

    Permalink
    Definition Classes
    Component
  11. def bounds: Rectangle

    Permalink
    Definition Classes
    UIElement
  12. var busy: Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    EventDrivenViewer
  13. val canvas: Panel { ... /* 5 definitions in type refinement */ }

    Permalink
    Attributes
    protected
    Definition Classes
    TileBasedFieldPanel
  14. val cellSize: Int

    Permalink
    Definition Classes
    TileBasedFieldPanel
  15. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. val cols: Int

    Permalink
    Definition Classes
    TileBasedFieldPanel
  17. val contents: Buffer[Component]

    Permalink
    Definition Classes
    Wrapper → Wrapper → SequentialContainer → Container
  18. def cursor: Cursor

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

    Permalink
    Definition Classes
    UIElement
  20. var data: Option[libcog.VectorFieldReader]

    Permalink
    Attributes
    protected
    Definition Classes
    TileBasedFieldPanel
  21. def deafTo(ps: Publisher*): Unit

    Permalink
    Definition Classes
    Reactor
  22. val dim: Int

    Permalink
    Definition Classes
    TileBasedFieldPanel
  23. var disallowNegativeZoom: Boolean

    Permalink
    Definition Classes
    ZoomProperty
  24. def displayable: Boolean

    Permalink
    Definition Classes
    UIElement
  25. def draw0D(data: libcog.VectorFieldReader, g: Graphics2D): Unit

    Permalink
    Definition Classes
    TileBasedFieldPanel
  26. def draw1D(data: libcog.VectorFieldReader, g: Graphics2D): Unit

    Permalink
    Definition Classes
    TileBasedFieldPanel
  27. def draw2D(data: libcog.VectorFieldReader, g: Graphics2D): Unit

    Permalink
    Definition Classes
    TileBasedFieldPanel
  28. def draw3D(data: libcog.VectorFieldReader, g: Graphics2D): Unit

    Permalink
    Definition Classes
    TileBasedFieldPanel
  29. def drawElement(data: libcog.VectorFieldReader, g: Graphics2D, indices: Int*): Unit

    Permalink

    Draw the single field element at the given indices.

    Draw the single field element at the given indices.

    Called after the pen has been moved to the top-left corner of the cell to draw in. Clients should take care to draw within the bounds of the cell, which is a cellSize by cellSize square.

    It would be nice if we could give an element as an argument instead of a bunch of indices, but the Field class doesn't currently define any means to actually extract elements from the field; that's left to subclasses. Further complicating things, the panel classes don't know in advance how many dimensions the data field has, so we have to use a variable length indices parameter. If your field class has a read(indices: Int*) method, you can get the current element, regardless of field dimensions, like so:

    val element = read(indices: _*)
    Definition Classes
    Geometric2DVectorViewTileBasedFieldPanel
  30. def drawElements(data: libcog.VectorFieldReader, g: Graphics2D): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    TileBasedFieldPanel
  31. var drawGrid: Boolean

    Permalink
    Definition Classes
    TileBasedFieldPanel
  32. def enabled: Boolean

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

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

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

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

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

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

    Permalink
    Definition Classes
    Component
  39. def font: Font

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

    Permalink
    Definition Classes
    UIElement
  41. def foreground: Color

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  44. def hGap: Int

    Permalink
    Definition Classes
    FlowPanel
  45. def hGap_=(n: Int): Unit

    Permalink
    Definition Classes
    FlowPanel
  46. def hasFocus: Boolean

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

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

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

    Permalink
    Definition Classes
    UIElement
  50. var initP: JComponent

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

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

    Permalink
    Definition Classes
    Component
  53. def isBusy: Boolean

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

    Permalink
    Definition Classes
    Any
  55. def layerHeight: Int

    Permalink
    Definition Classes
    TileBasedFieldPanel
  56. def layerWidth: Int

    Permalink
    Definition Classes
    TileBasedFieldPanel
  57. val layers: Int

    Permalink
    Definition Classes
    TileBasedFieldPanel
  58. val layersInARow: Int

    Permalink
    Definition Classes
    TileBasedFieldPanel
  59. def listenTo(ps: Publisher*): Unit

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

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

    Permalink
    Definition Classes
    UIElement
  62. def location: Point

    Permalink
    Definition Classes
    UIElement
  63. def locationOnScreen: Point

    Permalink
    Definition Classes
    UIElement
  64. var margin: Int

    Permalink
    Attributes
    protected
    Definition Classes
    TileBasedFieldPanel
  65. def maximumSize: Dimension

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

    Permalink
    Definition Classes
    UIElement
  67. def minimumSize: Dimension

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

    Permalink
    Definition Classes
    UIElement
  69. object mouse

    Permalink
    Definition Classes
    Component
  70. def name: String

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

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

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

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

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

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

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

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

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

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

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

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

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

    Permalink
    Attributes
    protected
    Definition Classes
    Component
  84. lazy val peer: JPanel

    Permalink
    Definition Classes
    FlowPanel → Panel → Wrapper → Component → UIElement
  85. def preferredSize: Dimension

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

    Permalink
    Definition Classes
    UIElement
  87. 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
  88. 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
  89. def publish(e: Event): Unit

    Permalink
    Definition Classes
    Publisher
  90. val reactions: Reactions

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

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

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

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

    Permalink
    Definition Classes
    Component
  95. 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
  96. def revalidate(): Unit

    Permalink
    Definition Classes
    Component
  97. val rows: Int

    Permalink
    Definition Classes
    TileBasedFieldPanel
  98. def self: Component

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

    Permalink
    Definition Classes
    UIElement
  100. def size: Dimension

    Permalink
    Definition Classes
    UIElement
  101. var stroke: BasicStroke

    Permalink
    Attributes
    protected
    Definition Classes
    TileBasedFieldPanel
  102. def subscribe(listener: Reaction): Unit

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

    Permalink
    Definition Classes
    AnyRef
  104. def targets: Set[AnyRef]

    Permalink
  105. val tmpVector: Vector

    Permalink
  106. def toString(): String

    Permalink
    Definition Classes
    Component → Proxy → AnyRef → Any
  107. def toolbarComponents: Seq[ComponentGroup]

    Permalink

    Builds the toolbar controls and displays for this visualization and returns them as a sequence of ComponentGroups.

    Builds the toolbar controls and displays for this visualization and returns them as a sequence of ComponentGroups. In this case, the first group of components contains the "magnitude panel" (showing the lengths of the shortest and longest vectors in the field) and the second group contains controls that change how the view is rendered.

    Definition Classes
    Geometric2DVectorViewToolbarItems
  108. def toolkit: Toolkit

    Permalink
    Definition Classes
    UIElement
  109. def tooltip: String

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

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

    Permalink
    Definition Classes
    LazyPublisher → Publisher
  112. def update(src: AnyRef, data: libcog.AbstractFieldMemory, time: 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

    Definition Classes
    Geometric2DVectorViewViewer
  113. def update(target: AnyRef, data: libcog.VectorFieldReader): Unit

    Permalink

    Update the data being viewed with new "data".

    Update the data being viewed with new "data".

    Definition Classes
    TileBasedFieldPanel
  114. def updateStatistics(data: libcog.VectorFieldReader): Unit

    Permalink

    Compute any needed statistics on your data (for display or to help draw later).

    Compute any needed statistics on your data (for display or to help draw later). Called after new data has been received (in updateData) but before drawing begins for that new data.

    Definition Classes
    Geometric2DVectorViewTileBasedFieldPanel
  115. def vGap: Int

    Permalink
    Definition Classes
    FlowPanel
  116. def vGap_=(n: Int): Unit

    Permalink
    Definition Classes
    FlowPanel
  117. def visible: Boolean

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

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

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

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

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

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

    Permalink
    Definition Classes
    Component
  124. 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
  125. def yLayoutAlignment: Double

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

    Permalink
    Definition Classes
    Component
  127. def zoomIn(): Unit

    Permalink

    Increase zoom level by zDelta.

    Increase zoom level by zDelta.

    Definition Classes
    ZoomPropertyZoomable
  128. val zoomIncrement: Float

    Permalink

    Default zoom/unzoom increment used by zoomIn and zoomOut.

    Default zoom/unzoom increment used by zoomIn and zoomOut. When the ZoomType is Additive, this value is added to or substracted from the current zoomLevel. In multiplicative mode, zoomLevel is multipled by zDelta on zooming in or by its reciprocal on zooming out.

    Definition Classes
    TileBasedFieldPanelZoomProperty
  129. def zoomLevel: Float

    Permalink
    Definition Classes
    ZoomProperty
  130. def zoomLevel_=(value: Float): Unit

    Permalink
    Definition Classes
    ZoomProperty
  131. def zoomOut(): Unit

    Permalink

    Decrease zoom level by zDelta.

    Decrease zoom level by zDelta.

    Definition Classes
    ZoomPropertyZoomable
  132. var zoomType: ZoomType

    Permalink

    Controls how zDelta is applied to the current zoom level.

    Controls how zDelta is applied to the current zoom level. In Additive, a delta is added to the current zoom level; in Multiplicative mode, the zoom level is multiplied by delta when zooming in, and by its reciprocal when zooming out.

    Default zoom type is additive. If you change it to multiplicative, you should probably ensure that the default zDelta is something other than 1f, as multiplying by one probably won't do anything.

    Definition Classes
    ZoomProperty

Inherited from ToolbarItems

Inherited from EventDrivenViewer

Inherited from ProbeListener

Inherited from Viewer

Inherited from ZoomProperty

Inherited from Zoomable

Inherited from FlowPanel

Inherited from Wrapper

Inherited from SequentialContainer

Inherited from Panel

Inherited from Wrapper

Inherited from Container

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