ProbedField being visualized.
User-presentable strings corresponding to the visualizations
available for the target
field.
A map from the Strings in options
to their
respective visualization instances.
Change the currently active display.
Change the currently active display. Also adds/removes some controls from the toolbar as appropriate (e.g. adds zoom buttons for Zoomable views or removes them for views that cannot be zoomed).
Key into the displayOptions
map for the desired view.
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!
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.
Reset the visualization.
Reset the visualization. An optional operation; subclasses must override this method or else it does nothing.
Restore this object to the state described in the given XML node.
Restore this object to the state described in the given XML node.
Encode the state of this panel into an XML tag.
Encode the state of this panel into an XML tag.
A toolbar that hosts common controls for the visualizations installed as children in this SuperPanel, as well as the combo box that allows switching between different visualizations.
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).
The field or object that generated the data
argument
New field data that needs to be rendered by this viewer
The ComputeGraph's step count at the time the data
argument was generated
Updates the visualization based on the contents of data
.
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.
A high-level visualization container that lets a user choose switch between available visualization options for a particular field.
Besides a target field, this class also requires as arguments a list of user-friendly visualization names and a factory that uses those names as keys to produce an actual Viewer instance. The superpanel itself is presented as a BorderPanel with a toolbar at the top and the visualization in the center. The selectable viewer's names are presented to the user in a ComboBox installed in the toolbar after any visualiztion specific controls (which are installed if a given Viewer implements the ToolbarItems trait). This combobox will only appear if there is more than one available visualization.
The first visualization named in the
options
argument is used as the default and will be immediately installed in the superpanel as part of initialization.While
viewerFactory
can be any map from Strings to Viewers, consider making it some sort of lazy or memoized map, particularly if any of the Viewer instances has substantial startup time. cogdebugger.Memoize#apply cogdebugger.MemoizeThis class was designed with the expectation that we'll wish to implement a subclass specific to each particualar type of field. A companion object with a straightforward factory method can make the instantiation of the subclass cleaner. E.g., for ColorFields (which currently only have one visualization):
Created by gonztobi on 4/10/2014.