Currently, a Display consists of a list of DisplayViews, each of which links to a Data object. After talking with a few people about use cases, it seems that this approach is too simplistic, while also being too complex.
For example, if you have a Dataset with a collection of Overlays intended to correspond to that Dataset, it would be nice for the data structures to indicate that they are specifically linked somehow, rather than just implicitly so by being in the same display.
A tree-like hierarchy of data objects would provide more explicit linkage between related objects, as well as easy duplication of the same structures across multiple displays. (TrakEM2 and Endrov both support tree-like hierarchies of data objects.)
Another problem is that we currently have no UI-agnostic mechanism to create DisplayView instances from a given Dataset or Overlay. Many plugins need to return a DatasetView or an OverlayView, but must avoid invoking e.g. "new SwingDatasetView" in code.
Further, for plugins that wish to return more complex data structures (e.g., a Dataset together with some Overlays), it would be nice to have the aforementioned tree structure, so that it can be used by those plugins.
To address these issues, I propose the following changes:
- Create a third type of DisplayView called a CompositeView that consists of a list of other DisplayViews.
- Provide a helper/factory that can generically create DatasetViews and OverlayViews.
- Potentially, for simplicity, change Display to take a single CompositeView.
See also: scijava/scijava-common#157
Migrated-From: http://trac.imagej.net/ticket/660