Window and Selection Management Specification
- SNAP-45Getting issue details... STATUS
Introduction
The NB window system does not distinguish between editors and views. A special window mode called "editor" is be used to arrange any window type in tabbed container. Furthermore only a single window (TopComponent) can be activated at a given time in NB.
In BEAM VISAT, we had a single, selected tool window and in addition a single, selected internal frame. Tool windows could register listeners that informed a tool window about internal frame selections and hereby image view selections.
What we need in SNAP is the currently selected view (= ProductSceneView). NB's global lookup is not directly applicable in this case, because it's content changes immediately after a new window has been activated. What needs to be implemented is a mechanism that leaves the last activated (image or metadata) view in the global lookup so that other tool windows can access it.
For the SNAP desktop application, we distingush two major types of dockable windows: document windows and tool windows. Their main difference is how they react to document opening / closing. A document may be any hierarchical data node structure that the application can open, close, display and optionally modify and save. Documents are internally represented by specific data models. The most typical document type for SNAP is an EO data product with its raster datasets and metadata tree providing the nodes.
For future evolution of SNAP, we have some additional requirements
- Developers should be able to register new document types;
- Developers should be able to register new view types for their document types;
- For a selected document node and in the case there are multiple views for a document type, SNAP users should be able to choose which view type they would like to open.
Document Windows
Document windows are any windows opened from a document or node and which keep a reference to the document or node. A single document/node type may have multiple possible document window types. There can be any number of document window instances for a single document/node. If a document is closed, associated document windows will be closed as well.
- Synonym: Editor (NB IDE, Eclipse RCP, IntelliJ IDEA)
- Persistence: They are usually not persisted as they are dependent on the currently opened documents.
- Mode: Editor Windows are usually opened in the “editor” mode.
- UI Name: Document Window
Standard SNAP document window types:
SNAP document window type | UI Name | BEAM counterpart | BEAM UI Name | Description |
---|---|---|---|---|
ProductSceneView | Image View | |||
MetadataView | Metadata View |
Tool Windows
A tool window is any dockable window that is not a document window. Tool windows usually provide specific tools for selecting, browsing and modification of documents and nodes. They may also work on activated document windows or may be independent of any selection state. If a document is closed, a tool window stays where it is and reacts to the new document node selection state or document window activation state or does nothing at all. Tool windows are usually singletons.
- Synonym: View (NB IDE, Eclipse RCP, IntelliJ IDEA also uses the term Tool Window)
- Examples: Product Explorer, Image Navigation, Colour Editor, Property Editor
- Persistence: Usually persisted so that users find their tools at preferred state and location.
- Mode: any other but “editor” mode
- UI Name: Tool Window
Standard SNAP tool window types:
SNAP tool window type | UI Name | BEAM counterpart | BEAM UI Name | Description |
---|---|---|---|---|
Products | ProductsToolView | Products View | Double clicking a node in this tool window will open an instance of the node's default document window type. A node's context menu allows for opening other document window types on the node. | |
Pixel Info | PixelInfoToolView | Pixel Info View | ||
Navigation | NavigationToolView | Navigation | ||
Placemark | PlacemarkEditorToolView | Vector Data Information | ||
Image Colours | ColorManipulationToolView | Colour Manipulation | ||
Uncertainty | UncertaintyVisualisationToolView | Uncertainty Visualisation | ||
Layer Manager | LayerManagerToolView | Layer Manager | ||
Style | LayerEditorToolView | Layer Editor | ||
Mask Manager | MaskManagerToolView | Mask Manager | ||
Pin Manager | PinManagerToolView | Pin Manager | ||
GCP Manager | GcpManagerToolView | GCP Manager | ||
Spectra | SpectrumToolView | Spectrum View | Display spectra at the current pixel position and for pins. May move to optional Optical Toolbox | |
Details | InformationToolView | Information View | Display information for a selected band. | |
Statistics | GeoCodingToolView | Geo-Coding View | Display Geo-Coding for a selected band. | |
Geo-Coding | StatisticsToolView | Statistics View | Display Statistics for a selected band. | |
HistogramPlotToolView | ||||
DensityPlotToolView | ||||
ScatterPlotToolView | ||||
ProfilePlotToolView | ||||
WorldMapToolView | ||||
TileCacheDiagnosisToolView |
Selection Management
Document and tool windows may be either activated or deactivated and there will always be only a single activated window. Active document and tool windows can be providers of the global selection. Any tool window may decide if it listens to the global selection state or if it requires an active document window. As there can only be a single global selection, the respective selection is determined by the last activated document or tool window.
The global selection provide the context used by actions such as undo, redo, cut, copy, paste, delete, edit (properties), print, etc.
The interactive tools like selection, zoom, pan, draw line, etc have a global selection state. That means, if a document window containing an image view is selected, their selection state remains the same, with other words, the same tool remains active for all editors. If no editor is active, the tools are disabled.
Default Snap Window Layout
Restoring to the default windows of the TOP COMPONENT, WINDOws-Reset Windows. For more details on how NetBean arrange the windows within.
SNAP default Window layout.
Top Components | mode | openAtStartup | position | role | Comment |
---|---|---|---|---|---|
ProductExplorerTopComponent | explorer | true | 10 | ||
PixelInfoTopComponent | explorer | true | 20 | ||
NavigationTopComponent | navigator | true | 10 | ||
ColorManipulationTopComponent | navigator | true | 20 | ||
UncertaintyVisualisationTopComponent | navigator | false | 30 | ||
WorldMapTopComponent | navigator | false | 40 | ||
WWWorldMapToolView | navigator | false | 50 | ||
WW3DToolView | navigator | false | 60 | ||
LayerManagerTopComponent | right | false | 10 | ||
MaskManagerToolTopComponent | right | false | 20 | ||
SelectionExplorerTopComponent | right | true | 100 | developer | Used for analysis of selection state |
Properties (...) | properties | false | ? | Comes from NetBeans | |
InformationTopComponent | properties | false | 10 | ||
GeoCodingTopComponent | properties | false | 20 | ||
StatisticsTopComponent | properties | false | 30 | Should be ideally floating | |
DensityPlotTopComponent | properties | false | 40 | Should be ideally floating | |
HistogramPlotTopComponent | properties | false | 50 | Should be ideally floating | |
ProfilePlotTopComponent | properties | false | 60 | Should be ideally floating | |
ScatterPlotTopComponent | properties | false | 70 | Should be ideally floating | |
SpectrumTopComponent | properties | false | 80 | Should be ideally floating | |
PinManagerTopComponent | output | false | 10 | ||
GcpManagerTopComponent | output | false | 20 | ||
ScriptConsoleTopComponent | output | false | 30 | ||
WorkspaceTopComponent | editor | false | - |