Window and Selection Management Specification

SNAP-45 - Getting 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 typeUI NameBEAM counterpartBEAM UI NameDescription
  ProductSceneViewImage View 
 
MetadataViewMetadata 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 typeUI NameBEAM counterpartBEAM UI NameDescription
 Products ProductsToolViewProducts ViewDouble 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 PixelInfoToolViewPixel Info View 
 NavigationNavigationToolViewNavigation 
 PlacemarkPlacemarkEditorToolViewVector Data Information 
 Image ColoursColorManipulationToolViewColour Manipulation 
 UncertaintyUncertaintyVisualisationToolViewUncertainty Visualisation 
 Layer ManagerLayerManagerToolViewLayer Manager 
 StyleLayerEditorToolViewLayer Editor 
 Mask ManagerMaskManagerToolViewMask Manager 
 Pin ManagerPinManagerToolViewPin Manager 
 GCP ManagerGcpManagerToolViewGCP Manager 
 SpectraSpectrumToolViewSpectrum ViewDisplay spectra at the current pixel position and for pins. May move to optional Optical Toolbox
 DetailsInformationToolViewInformation ViewDisplay information for a selected band.
 Statistics GeoCodingToolViewGeo-Coding ViewDisplay Geo-Coding for a selected band.
 Geo-CodingStatisticsToolViewStatistics ViewDisplay 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 windowActive 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 Componentsmode
openAtStartup
positionroleComment
ProductExplorerTopComponent
explorertrue10  
PixelInfoTopComponent
explorertrue20  
NavigationTopComponent
navigatortrue10  
ColorManipulationTopComponent
navigatortrue20  
UncertaintyVisualisationTopComponent
navigatorfalse30  
WorldMapTopComponent
navigatorfalse40  
WWWorldMapToolView
navigatorfalse50  
WW3DToolView
navigatorfalse60  
LayerManagerTopComponent
rightfalse10  
MaskManagerToolTopComponent
rightfalse20  
SelectionExplorerTopComponent
righttrue100developerUsed for analysis of selection state
Properties(...)propertiesfalse? Comes from NetBeans
InformationTopComponent
propertiesfalse10  
GeoCodingTopComponent
propertiesfalse20  
StatisticsTopComponent
propertiesfalse30 Should be ideally floating
DensityPlotTopComponent
propertiesfalse40 Should be ideally floating
HistogramPlotTopComponent
propertiesfalse50 Should be ideally floating
ProfilePlotTopComponent
propertiesfalse60 Should be ideally floating
ScatterPlotTopComponent
propertiesfalse70 Should be ideally floating
SpectrumTopComponent
propertiesfalse80 Should be ideally floating
PinManagerTopComponent
outputfalse10  
GcpManagerTopComponent
outputfalse20  
ScriptConsoleTopComponent

output

false

30

  
WorkspaceTopComponent
editorfalse-