Class ViewManagerManager
- All Implemented Interfaces:
ActionListener
,EventListener
,IdvConstants
McIDAS-V needs to manage ViewManagers in a slightly different way than the IDV. The key differences between the two are the way previously active ViewManagers are ordered and a (hopefully) more consistent way of handling active ViewManagers.
The IDV only keeps track of the ViewManager used immediately before the current one. McV keeps track of the previously active ViewManagers in a stack. This mimics window z-ordering and always returns the user to the most recently active ViewManager upon removal of the active ViewManager.
Newly created ViewManagers and their first layer now become the active ViewManager and layer. If there is only one ViewManager, it is now displayed as active instead of just implying it. When the active ViewManager is removed, the last active ViewManager and its first layer become active.
A note to the future: McV/IDV supports two notions of active and selected ViewManagers. Say you have NxN ViewManagers in a ComponentHolder, and you want to share views among some of these ViewManagers. When one of these shared ViewManagers is activated, should all of them become the active ViewManager? We're going to have to work out how to convey which ViewManagers are shared and active, and maybe more? Good luck!
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
Whether or not to display debug messages.private static final org.slf4j.Logger
private final Stack
<ViewManager> The stack that stores the order of previously active ViewManagers.private UIManager
Convenient reference back to the UIManager.Fields inherited from class ucar.unidata.ui.WindowHolder
contents, dialog, frame, window
Fields inherited from interface ucar.unidata.idv.IdvConstants
ARG_B64BUNDLE, ARG_B64ISL, ARG_BUNDLE, ARG_CATALOG, ARG_CHOOSER, ARG_CLEARDEFAULT, ARG_CODE, ARG_CONNECT, ARG_CURRENTTIME, ARG_DATA, ARG_DEBUG, ARG_DEFAULT, ARG_DISPLAY, ARG_DXML, ARG_FIXEDTIME, ARG_HELP, ARG_IMAGE, ARG_IMAGESERVER, ARG_INSTALLPLUGIN, ARG_ISLFILE, ARG_ISLINTERACTIVE, ARG_LISTRESOURCES, ARG_MAINCLASS, ARG_MOVIE, ARG_MSG_DEBUG, ARG_MSG_RECORD, ARG_NODEFAULT, ARG_NOERRORSINGUI, ARG_NOGUI, ARG_NOONEINSTANCE, ARG_NOPLUGINS, ARG_NOPREF, ARG_ONEINSTANCEPORT, ARG_PLUGIN, ARG_PORT, ARG_PRINTJNLP, ARG_PROPERTIES, ARG_SCRIPT, ARG_SERVER, ARG_SETFILES, ARG_SITEPATH, ARG_TEMPLATE, ARG_TEST, ARG_TESTEVAL, ARG_TRACE, ARG_TRACEONLY, ARG_USERPATH, DEFAULT_DATE_FORMAT, DEFAULT_DOCPATH, DEFAULT_TIMEZONE, FILTER_CPT, FILTER_ISL, FILTER_JNLP, FILTER_XIDV, FILTER_XIDVZIDV, FILTER_XML, FILTER_ZIDV, ID_COMMANDSTORUN, ID_DATASOURCES, ID_DISPLAYCONTROLS, ID_IDV, ID_JYTHON, ID_MESSAGE, ID_MISCHASHTABLE, ID_NCIDV_VERSION, ID_VERSION, ID_VIEWMANAGERS, ID_WINDOWS, INITIAL_PROBE_EARTHLOCATION, NULL_DATA_SELECTION, NULL_STRING, PREF_APPEARANCEMODE, PREF_ARCHIVEDIR, PREF_ARCHIVENAME, PREF_AUTODISPLAYS_ENABLE, PREF_AUTODISPLAYS_SHOWGUI, PREF_AUTOSELECTDATA, PREF_CACHESIZE, PREF_CONTROLSINTABS, PREF_DATAPREFIX, PREF_DATE_FORMAT, PREF_DISTANCEUNIT, PREF_DOCACHE, PREF_EMBEDDATACHOOSERINDASHBOARD, PREF_EMBEDFIELDSELECTORINDASHBOARD, PREF_EMBEDLEGENDINDASHBOARD, PREF_EMBEDQUICKLINKSINDASHBOARD, PREF_EVENT_KEYBOARDMAP, PREF_EVENT_MOUSEMAP, PREF_EVENT_WHEELMAP, PREF_FAST_RENDER, PREF_FIELD_CACHETHRESHOLD, PREF_FILEREADDIR, PREF_FILEWRITEDIR, PREF_GEOMETRY_BY_REF, PREF_HISTORY, PREF_IMAGE_BY_REF, PREF_LARGE_REMOTE_DATA_WARN, PREF_LASTVERSION, PREF_LATLON_FORMAT, PREF_LEGEND_SHOWICONS, PREF_LOCALE, PREF_LOOKANDFEEL, PREF_MAXIMAGESIZE, PREF_MEMORY, PREF_NPOT_IMAGE, PREF_OPEN_ASK, PREF_OPEN_MERGE, PREF_OPEN_REMOVE, PREF_PROJ_LIST, PREF_SAMPLINGMODE, PREF_SHOWCONTROLWINDOW, PREF_SHOWDASHBOARD, PREF_SHOWDECODEDIALOG, PREF_SHOWHIDDENFILES, PREF_SHOWQUITCONFIRM, PREF_SITEPATH, PREF_THREADS_DATA, PREF_THREADS_RENDER, PREF_TIMEZONE, PREF_VERTICALCS, PREF_VERTICALUNIT, PREF_WINDOW_SHOWTOOLBAR, PREF_ZIDV_ASK, PREF_ZIDV_DIRECTORY, PREF_ZIDV_SAVETOTMP, PROP_3DMODE, PROP_ABOUTTEXT, PROP_APPRESOURCEPATH, PROP_CHOOSERS, PROP_CHOOSERS_ALL, PROP_CONTROLDESCRIPTORS, PROP_CONTROLDESCRIPTORS_ALL, PROP_DATAHOLDERBOUNDS, PROP_DEFAULTLOCATIONS, PROP_DISPLAYLIST_GROUP, PROP_FIXFILELOCKUP, PROP_JNLPCODEBASE, PROP_JNLPTEMPLATE, PROP_JNLPTITLE, PROP_LOADINGXML, PROP_MAP_GLOBE_LEVEL, PROP_MAP_MAP_LEVEL, PROP_MINIMUMFRAMECYCLETIME, PROP_MONITORPORT, PROP_OLDCONTROLDESCRIPTORS, PROP_ONEINSTANCEPORT, PROP_PREFERENCES, PROP_PROJ_NAME, PROP_RESOURCEFILES, PROP_SHOWCLOCK_DASH, PROP_SHOWCLOCK_VIEW, PROP_SHOWDASHBOARD, PROP_SHOWDATATREE, PROP_SHOWFORMULAS, PROP_SHOWSPLASH, PROP_SPLASHICON, PROP_UI_DESKTOP, PROP_USE_DISPLAYAREA, PROP_USE_TIMEDRIVER, PROP_VERSIONFILE, PROP_WINDOW_SCREENSIZEOFFSET, PROP_WINDOW_SIZEHEIGHT, PROP_WINDOW_SIZEWIDTH, PROP_WINDOW_USESCREENSIZE, SUFFIX_BAT, SUFFIX_CPT, SUFFIX_ISL, SUFFIX_JNLP, SUFFIX_RBI, SUFFIX_SH, SUFFIX_XIDV, SUFFIX_XML, SUFFIX_ZIDV
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addViewManager
(ViewManager newViewManager) Add the new view manager into the list if we don't have one with theViewDescriptor
of the new view manager already.protected void
Turns off layer visibility animation for allViewManager
s.private void
focusLayerControlsOn
(ViewManager vm, boolean doShow) Sets the active tab of the dashboard to the layer controls and makes the first layer (TODO: fix that!)int
int
int
boolean
Overridden so that McV can set the active ViewManager even if there is only one ViewManager.private void
inspectStack
(String msg) Helper method that'll display the ordering of the stack and a helpful debug message!void
removeViewManager
(ViewManager viewManager) Handles the removal of a ViewManager.void
This method is a bit strange.void
setViewManagerOrder
(Stack<ViewManager> newOrder) Overwrite the stack containing the ordering of previously active ViewManagers.Methods inherited from class ucar.unidata.idv.VMManager
addViewManagers, applyPreferences, captureAll, center, center, center, center, center, center, center, center, createViewManager, findOrCreateViewManager, findTransectDrawingControls, findViewManager, findViewManagerInList, getLastActiveViewManager, getViewManagers, getViewManagers, getVMState, removeAllViewManagers, removeAllViewManagers, saveViewManagerState, saveViewManagerState, setDisplayMastersActive, setDisplayMastersInactive, setTransect, showProjectionManager, transectViewsChanged, unpersistViewManagers, updateAllLegends, writeVMState
Methods inherited from class ucar.unidata.idv.IdvManager
getArgsManager, getCollabManager, getColorTableManager, getDataManager, getIdv, getIdvChooserManager, getIdvClass, getIdvProjectionManager, getIdvUIManager, getImageGenerator, getInstallManager, getJythonManager, getPersistenceManager, getPreferenceManager, getProperty, getProperty, getProperty, getPublishManager, getResourceManager, getStateManager, getStationModelManager, getStore, getVMManager, logException, showNormalCursor, showWaitCursor, waitUntilDisplaysAreDone, waitUntilDisplaysAreDone
Methods inherited from class ucar.unidata.ui.WindowHolder
actionPerformed, close, doMakeContents, getContents, getDialog, getFrame, getWindow, getWindowTitle, isShowing, removeAll, setMenuBar, setWindowTitle, shouldMakeDialog, show, show, showModal, toFront, windowIsClosing
-
Field Details
-
logger
-
DEBUG
Whether or not to display debug messages.- See Also:
-
previousVMs
The stack that stores the order of previously active ViewManagers. -
uiManager
Convenient reference back to the UIManager.
-
-
Constructor Details
-
ViewManagerManager
Create a ... manager ofViewManagers
.- Parameters:
idv
- Reference to the application session. Cannot benull
.
-
-
Method Details
-
getViewManagerCount
-
addViewManager
Add the new view manager into the list if we don't have one with theViewDescriptor
of the new view manager already.- Overrides:
addViewManager
in classVMManager
- Parameters:
newViewManager
- The new view manager
-
getViewManagerOrder
- Returns:
- Reference to the stack of previously active ViewManagers.
-
haveMoreThanOneMainViewManager
Overridden so that McV can set the active ViewManager even if there is only one ViewManager. This is just a UI nicety; it'll allow the McV UI to show the active ViewManager no matter what.- Overrides:
haveMoreThanOneMainViewManager
in classVMManager
- Returns:
- Always returns true.
-
removeViewManager
Handles the removal of a ViewManager. McV needs to override this so that the stack of previously active ViewManagers is ordered properly. McV uses this method to make the ViewPanel respond immediately to the change.- Overrides:
removeViewManager
in classVMManager
- Parameters:
viewManager
- The ViewManager being removed.
-
setLastActiveViewManager
This method is a bit strange. If the given ViewManager is null, then the IDV has removed the active ViewManager. McV will use the stack of last active ViewManagers to make the last active ViewManager active once again.
If the given ViewManager is not null, but cannot be found in the stack of previously active ViewManagers, the IDV has created a new ViewManager and McV must push it on the stack.
If the given ViewManager is not null and has been found in the stack, then the user has selected an inactive ViewManager. McV must remove the ViewManager from the stack and then push it back on top.
These steps allow McV to make the behavior of closing tabs a bit more user-friendly. The user is always returned to whichever ViewManager was last active.
- Overrides:
setLastActiveViewManager
in classVMManager
- Parameters:
vm
- See above. :(
-
setViewManagerOrder
Overwrite the stack containing the ordering of previously active ViewManagers.
Use this if you want to mess with the user's mind a little bit.
- Parameters:
newOrder
- The stack containing the new ordering of ViewManagers.
-
getComponentHolderCount
-
getComponentGroupCount
-
focusLayerControlsOn
Sets the active tab of the dashboard to the layer controls and makes the first layer (TODO: fix that!) of the given ViewManager the active layer.- Parameters:
vm
- The ViewManager to make active.doShow
- Whether or not the layer controls should become the active tab in the dashboard.
-
inspectStack
Helper method that'll display the ordering of the stack and a helpful debug message!- Parameters:
msg
- Message to include in output.
-
disableAllLayerVizAnimations
Turns off layer visibility animation for allViewManager
s. This is typically only useful for when the user has removed all layers without turning off the layer animation setting.
-