Package ucar.unidata.idv
Class VMManager
java.lang.Object
ucar.unidata.ui.WindowHolder
ucar.unidata.idv.IdvManager
ucar.unidata.idv.VMManager
- All Implemented Interfaces:
ActionListener
,EventListener
,IdvConstants
This class manages the set of
ViewManager
s. It handles
initializing them after unpersistence, managing the set of view manager
states (this is where you can save off the state of a view manager
and then reapply it. So you can save projection, map, etc., name it
and use it later.)- Author:
- IDV development team
-
Field Summary
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
ConstructorsConstructorDescriptionConstruct this manager with the given idv. -
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.void
addViewManagers
(List newVms) Add the view managers in the listvoid
Apply the user preferences to all ViewManagersvoid
Capture an image for all ViewManagersvoid
center()
Set the projection on all MapViewManagers to be the projection of the first display.void
Set the projection on all MapViewManagers to be the projection of the first display.void
center
(ucar.unidata.geoloc.ProjectionRect pr) Zoom and center all of the MapViewManager-s at the given rectvoid
Zoom and center all of the MapViewManager-s at the given rectvoid
center
(EarthLocation el) Center all of the MapViewManager-s at the given pointvoid
center
(EarthLocation el, List viewManagers) Center the view managers in the list to the given pointvoid
center
(MapProjection mp) Center all of the MapViewManager-s at the given pointvoid
center
(MapProjection mp, List viewManagers) Center all of the MapViewManager-s at the given pointcreateViewManager
(ViewDescriptor viewDescriptor, String properties) Create the given ViewManagerfindOrCreateViewManager
(ViewDescriptor viewDescriptor, String properties) As the name implies find the view manager identified by the given viewDescriptor or create a new one.Find a TDCfindViewManager
(ViewDescriptor viewDescriptor) Find the view manager identified by the given view descriptorstatic ViewManager
findViewManagerInList
(ViewDescriptor viewDescriptor, List vms) Find the view manager in the given list that is defined by the given view descriptor.Get theViewManager
whose window was last active.Get the list of activeViewManager
sGet all of the view managers of the given classInstantiates (if needed) and returns the list ofTwoFacedObject
s that is the set of saved viewpointsboolean
Is there currently more than one possibly active viewmanagervoid
Remove all view managersvoid
removeAllViewManagers
(boolean andDestroyThem) Remove all view managersvoid
removeViewManager
(ViewManager viewManager) Remove the given view manager from the list.protected void
Popup a dialog asking the user for the name of the saved ViewManager.void
Iterate through all of the ViewManager-s and tell each on to setMasterActivevoid
Iterate through all of the ViewManager-s and tell each on to setMasterInactivevoid
setLastActiveViewManager
(ViewManager viewManager) Set theViewManager
whose window was last active.void
setTransect
(Transect transect) Set the Transect used for all TransectViewManagersvoid
Find the firstViewManager
in the list and have it show its @[link ucar.unidata.view.geoloc.ProjectionManager}.void
Be notified that a transect view manager has changed.void
unpersistViewManagers
(List newViewManagers) Do the initialization of the unpersistedViewManager
.void
_more_void
Write the viewpoints listMethods 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
-
Constructor Details
-
VMManager
Construct this manager with the given idv.- Parameters:
idv
- The IDV
-
-
Method Details
-
getViewManagers
Get the list of activeViewManager
s- Returns:
- List of view managers.
-
getViewManagers
Get all of the view managers of the given class- Parameters:
c
- ViewManager class- Returns:
- List of ViewManagers
-
captureAll
public void captureAll()Capture an image for all ViewManagers -
applyPreferences
public void applyPreferences()Apply the user preferences to all ViewManagers -
setLastActiveViewManager
Set theViewManager
whose window was last active.- Parameters:
viewManager
- The last active view manager
-
haveMoreThanOneMainViewManager
public boolean haveMoreThanOneMainViewManager()Is there currently more than one possibly active viewmanager- Returns:
- More than one active view managers
-
getLastActiveViewManager
Get theViewManager
whose window was last active.- Returns:
- The last active view manager
-
findViewManager
Find the view manager identified by the given view descriptor- Parameters:
viewDescriptor
- The id of the VM- Returns:
- The VM or null if none found
-
findViewManagerInList
Find the view manager in the given list that is defined by the given view descriptor.- Parameters:
viewDescriptor
- The view descriptorvms
- List of ViewManagers- Returns:
- The view manager or null if none found
-
transectViewsChanged
public void transectViewsChanged()Be notified that a transect view manager has changed. This may be from a zoom, etc. Notify any TransectDrawingControls. -
findTransectDrawingControls
Find a TDC- Returns:
- The TDC
-
updateAllLegends
public void updateAllLegends()_more_ -
writeVMState
public void writeVMState()Write the viewpoints list -
getVMState
Instantiates (if needed) and returns the list ofTwoFacedObject
s that is the set of saved viewpoints- Returns:
- List that holds the viewpoints
-
saveViewManagerState
Popup a dialog asking the user for the name of the saved ViewManager. If provided, add a new TwoFacedObject to the list of saved ViewManagers and write the list to disk.- Parameters:
vm
- The view manager to save
-
addViewManager
Add the new view manager into the list if we don't have one with theViewDescriptor
of the new view manager already.- Parameters:
newViewManager
- The new view manager
-
addViewManagers
Add the view managers in the list- Parameters:
newVms
- New view managers
-
removeAllViewManagers
public void removeAllViewManagers()Remove all view managers -
removeAllViewManagers
public void removeAllViewManagers(boolean andDestroyThem) Remove all view managers- Parameters:
andDestroyThem
- If true then also call destroy
-
removeViewManager
Remove the given view manager from the list.- Parameters:
viewManager
- The view manager to be removed.
-
showProjectionManager
public void showProjectionManager()Find the firstViewManager
in the list and have it show its @[link ucar.unidata.view.geoloc.ProjectionManager}. -
unpersistViewManagers
Do the initialization of the unpersistedViewManager
.- Parameters:
newViewManagers
- List of view managers to unpersist
-
setDisplayMastersActive
public void setDisplayMastersActive()Iterate through all of the ViewManager-s and tell each on to setMasterActive -
setDisplayMastersInactive
public void setDisplayMastersInactive()Iterate through all of the ViewManager-s and tell each on to setMasterInactive -
findOrCreateViewManager
As the name implies find the view manager identified by the given viewDescriptor or create a new one.- Parameters:
viewDescriptor
- The id to look forproperties
- Properties to pass if we create one.- Returns:
- The found or created ViewManager
-
createViewManager
Create the given ViewManager- Parameters:
viewDescriptor
- Identifies the VMproperties
- Property string to pass- Returns:
- The new one
-
center
Center all of the MapViewManager-s at the given point- Parameters:
el
- The point- Throws:
RemoteException
- On badnessVisADException
- On badness
-
center
Center the view managers in the list to the given point- Parameters:
el
- Point to center toviewManagers
- ViewManagers to center- Throws:
RemoteException
- On badnessVisADException
- On badness
-
center
Center all of the MapViewManager-s at the given point- Parameters:
mp
- Set all view managers projection to the- Throws:
RemoteException
- On badnessVisADException
- On badness
-
center
Center all of the MapViewManager-s at the given point- Parameters:
mp
- new projectionviewManagers
- ViewManagers to center- Throws:
RemoteException
- On badnessVisADException
- On badness
-
center
Zoom and center all of the MapViewManager-s at the given rect- Parameters:
pr
- The projection rect to zoom and center to- Throws:
RemoteException
- On badnessVisADException
- On badness
-
center
public void center(ucar.unidata.geoloc.ProjectionRect pr, List viewManagers) throws VisADException, RemoteException Zoom and center all of the MapViewManager-s at the given rect- Parameters:
pr
- The projection rect to zoom and center toviewManagers
- ViewManagers to center- Throws:
RemoteException
- On badnessVisADException
- On badness
-
center
Set the projection on all MapViewManagers to be the projection of the first display.- Throws:
RemoteException
- On badnessVisADException
- On badness
-
center
Set the projection on all MapViewManagers to be the projection of the first display.- Parameters:
viewManagers
- ViewManagers to center- Throws:
RemoteException
- On badnessVisADException
- On badness
-
setTransect
Set the Transect used for all TransectViewManagers- Parameters:
transect
- The transect
-